blob: d292437848bd44f1fac8fb51baee5d83f5c0635f [file] [log] [blame]
Jeevan Shriram062058c2016-11-07 16:46:44 -08001#Android makefile to build bootloader as a part of Android Build
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -08002
3CLANG_BIN := $(ANDROID_BUILD_TOP)/$(LLVM_PREBUILTS_PATH)/
4
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -08005ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
6 VERIFIED_BOOT := VERIFIED_BOOT=1
7else
8 VERIFIED_BOOT := VERIFIED_BOOT=0
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -08009endif
10
Shivaprasad Hongal3860bbf2017-04-27 17:40:13 -070011ifeq ($(BOARD_AVB_ENABLE),true)
12 VERIFIED_BOOT_2 := VERIFIED_BOOT_2=1
13else
14 VERIFIED_BOOT_2 := VERIFIED_BOOT_2=0
15endif
16
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080017ifeq ($(TARGET_BUILD_VARIANT),user)
Vijay Kumar Pendoti9946e042016-09-16 17:38:51 +053018 USER_BUILD_VARIANT := USER_BUILD_VARIANT=1
19else
20 USER_BUILD_VARIANT := USER_BUILD_VARIANT=0
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080021endif
22
Maria Yu3a174b82017-06-23 19:33:26 +080023# For most platform, abl needed always be built
24# in aarch64 arthitecture to run.
25# Specify BOOTLOADER_ARCH if needed to built with
26# other ARCHs.
27ifeq ($(BOOTLOADER_ARCH),)
28 BOOTLOADER_ARCH := AARCH64
29endif
30TARGET_ARCHITECTURE := $(BOOTLOADER_ARCH)
31
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080032# ABL ELF output
33TARGET_ABL := $(PRODUCT_OUT)/abl.elf
Channagoud Kadabi9dff4e22016-02-10 11:19:49 -080034TARGET_EMMC_BOOTLOADER := $(TARGET_ABL)
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080035ABL_OUT := $(TARGET_OUT_INTERMEDIATES)/ABL_OBJ
36
37abl_clean:
38 $(hide) rm -f $(TARGET_ABL)
39
40$(ABL_OUT):
41 mkdir -p $(ABL_OUT)
42
43# Top level target
44$(TARGET_ABL): abl_clean | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARGET)
Maria Yu3a174b82017-06-23 19:33:26 +080045 $(MAKE) -C bootable/bootloader/edk2 BOOTLOADER_OUT=../../../$(ABL_OUT) all $(VERIFIED_BOOT) $(VERIFIED_BOOT_2) $(USER_BUILD_VARIANT) CLANG_BIN=$(CLANG_BIN) TARGET_ARCHITECTURE=$(TARGET_ARCHITECTURE)
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080046
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080047.PHONY: abl
48
49abl: $(TARGET_ABL)