setup-makefiles.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2016 The CyanogenMod Project
  4. # Copyright (C) 2017-2023 The LineageOS Project
  5. #
  6. # SPDX-License-Identifier: Apache-2.0
  7. #
  8. set -e
  9. # Load extract_utils and do some sanity checks
  10. MY_DIR="${BASH_SOURCE%/*}"
  11. if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
  12. ANDROID_ROOT="${MY_DIR}/../../.."
  13. HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
  14. if [ ! -f "${HELPER}" ]; then
  15. echo "Unable to find helper script at ${HELPER}"
  16. exit 1
  17. fi
  18. source "${HELPER}"
  19. # Initialize the helper for common
  20. setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true
  21. # Warning headers and guards
  22. write_headers "cupid diting marble mayfly mondrian thor unicorn zeus ziyi zizhan"
  23. # The standard common blobs
  24. write_makefiles "${MY_DIR}/proprietary-files.txt" true
  25. # Finish
  26. write_footers
  27. if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
  28. # Reinitialize the helper for device
  29. setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
  30. # Warning headers and guards
  31. write_headers
  32. # The standard device blobs
  33. write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" true
  34. if [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then
  35. append_firmware_calls_to_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt"
  36. fi
  37. # Finish
  38. write_footers
  39. fi