setup-makefiles.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2016 The CyanogenMod Project
  4. # Copyright (C) 2017-2018 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. export INITIAL_COPYRIGHT_YEAR=2017
  20. export GAPPS_COMMON=common
  21. export VENDOR=gapps
  22. # Load extract_utils and do some sanity checks
  23. MY_DIR="${BASH_SOURCE%/*}"
  24. if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
  25. LINEAGE_ROOT="$MY_DIR"/../..
  26. HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh
  27. if [ ! -f "$HELPER" ]; then
  28. echo "Unable to find helper script at $HELPER"
  29. exit 1
  30. fi
  31. . "$HELPER"
  32. # Initialize the helper for common gapps
  33. setup_vendor "$GAPPS_COMMON" "$VENDOR" "$LINEAGE_ROOT" true
  34. # Copyright headers
  35. write_headers "arm arm64 x86"
  36. # Common gapps
  37. write_makefiles "$MY_DIR"/proprietary-files-common.txt
  38. # We are done with common
  39. write_footers
  40. for TARGET in arm arm64 x86; do
  41. # Reinitialize the helper for target gapps
  42. setup_vendor "$TARGET" "$VENDOR" "$LINEAGE_ROOT" true
  43. # Copyright headers and guards
  44. write_headers "$TARGET"
  45. write_makefiles "$MY_DIR"/proprietary-files-$TARGET.txt
  46. printf '\n%s\n' "\$(call inherit-product, vendor/gapps/common/common-vendor.mk)" >> "$PRODUCTMK"
  47. sed -i 's/TARGET_DEVICE/TARGET_ARCH/g' "$ANDROIDMK"
  48. # We are done with target
  49. write_footers
  50. done