setup-makefiles.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2016 The CyanogenMod Project
  4. # Copyright (C) 2017 The LineageOS Project
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. set -e
  19. # Load extract_utils and do some sanity checks
  20. MY_DIR="${BASH_SOURCE%/*}"
  21. if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
  22. CM_ROOT="$MY_DIR"/../..
  23. HELPER="$CM_ROOT"/vendor/cm/build/tools/extract_utils.sh
  24. if [ ! -f "$HELPER" ]; then
  25. echo "Unable to find helper script at $HELPER"
  26. exit 1
  27. fi
  28. . "$HELPER"
  29. # Initialize the helper for common gapps
  30. setup_vendor "$GAPPS_COMMON" "$VENDOR" "$CM_ROOT"
  31. # Copyright headers
  32. write_headers
  33. # Common gapps
  34. write_makefiles "$MY_DIR"/common-proprietary-files.txt
  35. # We are done with common
  36. write_footers
  37. # Reinitialize the helper for target gapps
  38. setup_vendor "$TARGET" "$VENDOR" "$CM_ROOT"
  39. # Copyright headers and guards
  40. write_headers
  41. write_makefiles "$MY_DIR"/proprietary-files-$TARGET.txt
  42. write_makefiles "$MY_DIR"/proprietary-files.txt
  43. printf '\n%s\n' "\$(call inherit-product, vendor/gapps/common/common-vendor.mk)" >> "$PRODUCTMK"
  44. # We are done with target
  45. write_footers
  46. for f in `find "$MY_DIR" -type f -name Android.mk`; do sed -i s/ifeq/ifneq/g $f; done