setup-makefiles.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. function vendor_imports() {
  20. cat << EOF >> "$1"
  21. "device/xiaomi/sm8450-common",
  22. "hardware/qcom-caf/sm8450",
  23. "hardware/qcom-caf/wlan",
  24. "hardware/xiaomi",
  25. "vendor/qcom/opensource/commonsys/display",
  26. "vendor/qcom/opensource/commonsys-intf/display",
  27. "vendor/qcom/opensource/dataservices",
  28. EOF
  29. }
  30. # Initialize the helper for common
  31. setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true
  32. # Warning headers and guards
  33. write_headers "cupid diting marble mayfly mondrian thor unicorn zeus ziyi zizhan"
  34. # The standard common blobs
  35. write_makefiles "${MY_DIR}/proprietary-files.txt" true
  36. # Finish
  37. write_footers
  38. if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
  39. # Reinitialize the helper for device
  40. source "${MY_DIR}/../${DEVICE}/setup-makefiles.sh"
  41. setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
  42. # Warning headers and guards
  43. write_headers
  44. # The standard device blobs
  45. write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" true
  46. if [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then
  47. append_firmware_calls_to_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt"
  48. fi
  49. # Finish
  50. write_footers
  51. fi