Jeevan Shriram | 062058c | 2016-11-07 16:46:44 -0800 | [diff] [blame] | 1 | #Android makefile to build bootloader as a part of Android Build |
Maria Yu | f12a361 | 2017-06-27 11:28:16 +0800 | [diff] [blame] | 2 | CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH)/ |
| 3 | ifneq ($(wildcard $(SDCLANG_PATH_2)),) |
| 4 | CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH_2)/ |
| 5 | endif |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 6 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 7 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true) |
| 8 | VERIFIED_BOOT := VERIFIED_BOOT=1 |
| 9 | else |
| 10 | VERIFIED_BOOT := VERIFIED_BOOT=0 |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 11 | endif |
| 12 | |
Shivaprasad Hongal | 3860bbf | 2017-04-27 17:40:13 -0700 | [diff] [blame] | 13 | ifeq ($(BOARD_AVB_ENABLE),true) |
| 14 | VERIFIED_BOOT_2 := VERIFIED_BOOT_2=1 |
| 15 | else |
| 16 | VERIFIED_BOOT_2 := VERIFIED_BOOT_2=0 |
| 17 | endif |
| 18 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 19 | ifeq ($(TARGET_BUILD_VARIANT),user) |
Vijay Kumar Pendoti | 9946e04 | 2016-09-16 17:38:51 +0530 | [diff] [blame] | 20 | USER_BUILD_VARIANT := USER_BUILD_VARIANT=1 |
| 21 | else |
| 22 | USER_BUILD_VARIANT := USER_BUILD_VARIANT=0 |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 23 | endif |
| 24 | |
Maria Yu | 3a174b8 | 2017-06-23 19:33:26 +0800 | [diff] [blame] | 25 | # For most platform, abl needed always be built |
| 26 | # in aarch64 arthitecture to run. |
| 27 | # Specify BOOTLOADER_ARCH if needed to built with |
| 28 | # other ARCHs. |
| 29 | ifeq ($(BOOTLOADER_ARCH),) |
| 30 | BOOTLOADER_ARCH := AARCH64 |
| 31 | endif |
| 32 | TARGET_ARCHITECTURE := $(BOOTLOADER_ARCH) |
| 33 | |
Jeevan Shriram | d29e440 | 2017-11-06 14:04:11 -0800 | [diff] [blame^] | 34 | ifeq ($(TARGET_ARCHITECTURE),arm) |
| 35 | CLANG35_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION)/bin/arm-linux-androideabi- |
| 36 | CLANG35_GCC_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION) |
| 37 | else |
| 38 | CLANG35_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION)/bin/aarch64-linux-android- |
| 39 | CLANG35_GCC_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-$(TARGET_GCC_VERSION) |
| 40 | endif |
| 41 | |
| 42 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 43 | # ABL ELF output |
| 44 | TARGET_ABL := $(PRODUCT_OUT)/abl.elf |
Channagoud Kadabi | 9dff4e2 | 2016-02-10 11:19:49 -0800 | [diff] [blame] | 45 | TARGET_EMMC_BOOTLOADER := $(TARGET_ABL) |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 46 | ABL_OUT := $(TARGET_OUT_INTERMEDIATES)/ABL_OBJ |
| 47 | |
| 48 | abl_clean: |
| 49 | $(hide) rm -f $(TARGET_ABL) |
| 50 | |
| 51 | $(ABL_OUT): |
| 52 | mkdir -p $(ABL_OUT) |
| 53 | |
| 54 | # Top level target |
| 55 | $(TARGET_ABL): abl_clean | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARGET) |
Jeevan Shriram | d29e440 | 2017-11-06 14:04:11 -0800 | [diff] [blame^] | 56 | $(MAKE) -C bootable/bootloader/edk2 \ |
| 57 | BOOTLOADER_OUT=../../../$(ABL_OUT) \ |
| 58 | all \ |
| 59 | $(VERIFIED_BOOT) \ |
| 60 | $(VERIFIED_BOOT_2) \ |
| 61 | $(USER_BUILD_VARIANT) \ |
| 62 | CLANG_BIN=$(CLANG_BIN) \ |
| 63 | CLANG_PREFIX=$(CLANG35_PREFIX)\ |
| 64 | CLANG_GCC_TOOLCHAIN=$(CLANG35_GCC_TOOLCHAIN)\ |
| 65 | TARGET_ARCHITECTURE=$(TARGET_ARCHITECTURE) |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 66 | |
Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame] | 67 | .PHONY: abl |
| 68 | |
| 69 | abl: $(TARGET_ABL) |