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