blob: 99656fa8a8bea9c29fe179d7e5d19d28b183834b [file] [log] [blame]
Sridhar Parasuramfedf9ac2015-11-03 16:20:50 -08001#Android makefile to build lk bootloader as a part of Android Build
2
3CLANG_BIN := $(ANDROID_BUILD_TOP)/$(LLVM_PREBUILTS_PATH)/
4
5# Set flags if we need to include security libs
6ifeq ($(TARGET_BOOTIMG_SIGNED),true)
7 SIGNED_KERNEL := SIGNED_KERNEL=1
8else
9 SIGNED_KERNEL := SIGNED_KERNEL=0
10endif
11
12ifeq ($(BOOTLOADER_PLATFORM),)
13 BOOTLOADER_PLATFORM := $(TARGET_BOARD_PLATFORM)
14endif
15
16ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true)
17 VERIFIED_BOOT := VERIFIED_BOOT=1
18else
19 VERIFIED_BOOT := VERIFIED_BOOT=0
20endif
21
22ifneq ($(TARGET_BUILD_VARIANT),user)
23 DEVICE_STATUS := DEFAULT_UNLOCK=true
24endif
25
26ifeq ($(TARGET_BUILD_VARIANT),user)
27 BUILD_VARIANT := USER_BUILD_VARIANT=true
28endif
29
30# ABL ELF output
31TARGET_ABL := $(PRODUCT_OUT)/abl.elf
32ABL_OUT := $(TARGET_OUT_INTERMEDIATES)/ABL_OBJ
33
34abl_clean:
35 $(hide) rm -f $(TARGET_ABL)
36
37$(ABL_OUT):
38 mkdir -p $(ABL_OUT)
39
40# Top level target
41$(TARGET_ABL): abl_clean | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARGET)
42 $(MAKE) -C bootable/bootloader/edk2 BOOTLOADER_OUT=../../../$(ABL_OUT) all $(SIGNED_KERNEL) $(VERIFIED_BOOT) $(DEVICE_STATUS) $(BUILD_VARIANT) CLANG_BIN=$(CLANG_BIN)
43
44# Keep build default for targets still using TARGET_BOOTLOADER
45#TARGET_BOOTLOADER := $(PRODUCT_OUT)/EMMCBOOT.MBN
46
47TARGET_EMMC_BOOTLOADER := $(PRODUCT_OUT)/abl.elf
48$(TARGET_EMMC_BOOTLOADER): $(ABL_OUT) | $(TARGET_ABL)
49
50.PHONY: abl
51
52abl: $(TARGET_ABL)