blob: 225cf18a45832d3a56e30e7cb41b28de2f761c8e [file] [log] [blame]
Jeevan Shriram062058c2016-11-07 16:46:44 -08001#Android makefile to build bootloader as a part of Android Build
Maria Yuf12a3612017-06-27 11:28:16 +08002CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH)/
3ifneq ($(wildcard $(SDCLANG_PATH_2)),)
4 CLANG_BIN := $(ANDROID_BUILD_TOP)/$(SDCLANG_PATH_2)/
5endif
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -08006
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -08007ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
8 VERIFIED_BOOT := VERIFIED_BOOT=1
9else
10 VERIFIED_BOOT := VERIFIED_BOOT=0
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080011endif
12
Shivaprasad Hongal3860bbf2017-04-27 17:40:13 -070013ifeq ($(BOARD_AVB_ENABLE),true)
14 VERIFIED_BOOT_2 := VERIFIED_BOOT_2=1
15else
16 VERIFIED_BOOT_2 := VERIFIED_BOOT_2=0
17endif
18
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080019ifeq ($(TARGET_BUILD_VARIANT),user)
Vijay Kumar Pendoti9946e042016-09-16 17:38:51 +053020 USER_BUILD_VARIANT := USER_BUILD_VARIANT=1
21else
22 USER_BUILD_VARIANT := USER_BUILD_VARIANT=0
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080023endif
24
Maria Yu3a174b82017-06-23 19:33:26 +080025# 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.
29ifeq ($(BOOTLOADER_ARCH),)
30 BOOTLOADER_ARCH := AARCH64
31endif
32TARGET_ARCHITECTURE := $(BOOTLOADER_ARCH)
33
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080034# ABL ELF output
35TARGET_ABL := $(PRODUCT_OUT)/abl.elf
Channagoud Kadabi9dff4e22016-02-10 11:19:49 -080036TARGET_EMMC_BOOTLOADER := $(TARGET_ABL)
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080037ABL_OUT := $(TARGET_OUT_INTERMEDIATES)/ABL_OBJ
38
39abl_clean:
40 $(hide) rm -f $(TARGET_ABL)
41
42$(ABL_OUT):
43 mkdir -p $(ABL_OUT)
44
45# Top level target
46$(TARGET_ABL): abl_clean | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARGET)
Maria Yu3a174b82017-06-23 19:33:26 +080047 $(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 -080048
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -080049.PHONY: abl
50
51abl: $(TARGET_ABL)