Jeevan Shriram | 062058c | 2016-11-07 16:46:44 -0800 | [diff] [blame] | 1 | #Android makefile to build bootloader as a part of Android Build |
lijuang | 65c51d5 | 2018-03-28 13:52:57 +0800 | [diff] [blame] | 2 | CLANG_BIN := $(ANDROID_BUILD_TOP)/$(LLVM_PREBUILTS_PATH)/ |
| 3 | ABL_USE_SDLLVM := false |
| 4 | |
| 5 | ifneq ($(wildcard $(SDCLANG_PATH)),) |
| 6 | ifeq ($(shell echo $(SDCLANG_PATH) | head -c 1),/) |
| 7 | CLANG_BIN := $(SDCLANG_PATH)/ |
| 8 | else |
| 9 | CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH)/ |
| 10 | endif |
| 11 | |
| 12 | ABL_USE_SDLLVM := true |
Ashwini Muduganti | 36db63f | 2017-12-12 14:20:38 -0800 | [diff] [blame] | 13 | endif |
| 14 | |
Maria Yu | f12a361 | 2017-06-27 11:28:16 +0800 | [diff] [blame] | 15 | ifneq ($(wildcard $(SDCLANG_PATH_2)),) |
Ashwini Muduganti | 36db63f | 2017-12-12 14:20:38 -0800 | [diff] [blame] | 16 | ifeq ($(shell echo $(SDCLANG_PATH_2) | head -c 1),/) |
| 17 | CLANG_BIN := $(SDCLANG_PATH_2)/ |
| 18 | else |
| 19 | CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH_2)/ |
| 20 | endif |
lijuang | 65c51d5 | 2018-03-28 13:52:57 +0800 | [diff] [blame] | 21 | |
| 22 | ABL_USE_SDLLVM := true |
Maria Yu | f12a361 | 2017-06-27 11:28:16 +0800 | [diff] [blame] | 23 | endif |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 24 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 25 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true) |
| 26 | VERIFIED_BOOT := VERIFIED_BOOT=1 |
| 27 | else |
| 28 | VERIFIED_BOOT := VERIFIED_BOOT=0 |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 29 | endif |
| 30 | |
Mukesh Ojha | 8dc65f5 | 2018-03-27 00:59:30 +0530 | [diff] [blame^] | 31 | ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
| 32 | BUILD_SYSTEM_ROOT_IMAGE := BUILD_SYSTEM_ROOT_IMAGE=1 |
| 33 | else |
| 34 | BUILD_SYSTEM_ROOT_IMAGE := BUILD_SYSTEM_ROOT_IMAGE=0 |
| 35 | endif |
| 36 | |
Shivaprasad Hongal | 3860bbf | 2017-04-27 17:40:13 -0700 | [diff] [blame] | 37 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 38 | VERIFIED_BOOT_2 := VERIFIED_BOOT_2=1 |
| 39 | else |
| 40 | VERIFIED_BOOT_2 := VERIFIED_BOOT_2=0 |
| 41 | endif |
| 42 | |
Zhen Kong | dd5c5e3 | 2017-07-05 13:44:45 -0700 | [diff] [blame] | 43 | ifeq ($(BOARD_LEVB_ENABLE),true) |
| 44 | VERIFIED_BOOT_LE := VERIFIED_BOOT_LE=1 |
| 45 | else |
| 46 | VERIFIED_BOOT_LE := VERIFIED_BOOT_LE=0 |
| 47 | endif |
| 48 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 49 | ifeq ($(TARGET_BUILD_VARIANT),user) |
Vijay Kumar Pendoti | 9946e04 | 2016-09-16 17:38:51 +0530 | [diff] [blame] | 50 | USER_BUILD_VARIANT := USER_BUILD_VARIANT=1 |
| 51 | else |
| 52 | USER_BUILD_VARIANT := USER_BUILD_VARIANT=0 |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 53 | endif |
| 54 | |
Maria Yu | 3a174b8 | 2017-06-23 19:33:26 +0800 | [diff] [blame] | 55 | # For most platform, abl needed always be built |
| 56 | # in aarch64 arthitecture to run. |
| 57 | # Specify BOOTLOADER_ARCH if needed to built with |
| 58 | # other ARCHs. |
| 59 | ifeq ($(BOOTLOADER_ARCH),) |
| 60 | BOOTLOADER_ARCH := AARCH64 |
| 61 | endif |
| 62 | TARGET_ARCHITECTURE := $(BOOTLOADER_ARCH) |
| 63 | |
Jeevan Shriram | d29e440 | 2017-11-06 14:04:11 -0800 | [diff] [blame] | 64 | ifeq ($(TARGET_ARCHITECTURE),arm) |
| 65 | CLANG35_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION)/bin/arm-linux-androideabi- |
| 66 | CLANG35_GCC_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION) |
| 67 | else |
| 68 | CLANG35_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)/bin/aarch64-linux-android- |
| 69 | CLANG35_GCC_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION) |
| 70 | endif |
| 71 | |
| 72 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 73 | # ABL ELF output |
| 74 | TARGET_ABL := $(PRODUCT_OUT)/abl.elf |
Channagoud Kadabi | 9dff4e2 | 2016-02-10 11:19:49 -0800 | [diff] [blame] | 75 | TARGET_EMMC_BOOTLOADER := $(TARGET_ABL) |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 76 | ABL_OUT := $(TARGET_OUT_INTERMEDIATES)/ABL_OBJ |
| 77 | |
| 78 | abl_clean: |
| 79 | $(hide) rm -f $(TARGET_ABL) |
| 80 | |
| 81 | $(ABL_OUT): |
| 82 | mkdir -p $(ABL_OUT) |
| 83 | |
| 84 | # Top level target |
| 85 | $(TARGET_ABL): abl_clean | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARGET) |
Jeevan Shriram | d29e440 | 2017-11-06 14:04:11 -0800 | [diff] [blame] | 86 | $(MAKE) -C bootable/bootloader/edk2 \ |
| 87 | BOOTLOADER_OUT=../../../$(ABL_OUT) \ |
| 88 | all \ |
Mukesh Ojha | 8dc65f5 | 2018-03-27 00:59:30 +0530 | [diff] [blame^] | 89 | $(BUILD_SYSTEM_ROOT_IMAGE) \ |
Jeevan Shriram | d29e440 | 2017-11-06 14:04:11 -0800 | [diff] [blame] | 90 | $(VERIFIED_BOOT) \ |
| 91 | $(VERIFIED_BOOT_2) \ |
Zhen Kong | dd5c5e3 | 2017-07-05 13:44:45 -0700 | [diff] [blame] | 92 | $(VERIFIED_BOOT_LE) \ |
Jeevan Shriram | d29e440 | 2017-11-06 14:04:11 -0800 | [diff] [blame] | 93 | $(USER_BUILD_VARIANT) \ |
| 94 | CLANG_BIN=$(CLANG_BIN) \ |
| 95 | CLANG_PREFIX=$(CLANG35_PREFIX)\ |
lijuang | 65c51d5 | 2018-03-28 13:52:57 +0800 | [diff] [blame] | 96 | ABL_USE_SDLLVM=$(ABL_USE_SDLLVM) \ |
Jeevan Shriram | d29e440 | 2017-11-06 14:04:11 -0800 | [diff] [blame] | 97 | CLANG_GCC_TOOLCHAIN=$(CLANG35_GCC_TOOLCHAIN)\ |
| 98 | TARGET_ARCHITECTURE=$(TARGET_ARCHITECTURE) |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 99 | |