Sridhar Parasuram | fedf9ac | 2015-11-03 16:20:50 -0800 | [diff] [blame^] | 1 | #Android makefile to build lk bootloader as a part of Android Build |
| 2 | |
| 3 | CLANG_BIN := $(ANDROID_BUILD_TOP)/$(LLVM_PREBUILTS_PATH)/ |
| 4 | |
| 5 | # Set flags if we need to include security libs |
| 6 | ifeq ($(TARGET_BOOTIMG_SIGNED),true) |
| 7 | SIGNED_KERNEL := SIGNED_KERNEL=1 |
| 8 | else |
| 9 | SIGNED_KERNEL := SIGNED_KERNEL=0 |
| 10 | endif |
| 11 | |
| 12 | ifeq ($(BOOTLOADER_PLATFORM),) |
| 13 | BOOTLOADER_PLATFORM := $(TARGET_BOARD_PLATFORM) |
| 14 | endif |
| 15 | |
| 16 | ifeq ($(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VERITY),true) |
| 17 | VERIFIED_BOOT := VERIFIED_BOOT=1 |
| 18 | else |
| 19 | VERIFIED_BOOT := VERIFIED_BOOT=0 |
| 20 | endif |
| 21 | |
| 22 | ifneq ($(TARGET_BUILD_VARIANT),user) |
| 23 | DEVICE_STATUS := DEFAULT_UNLOCK=true |
| 24 | endif |
| 25 | |
| 26 | ifeq ($(TARGET_BUILD_VARIANT),user) |
| 27 | BUILD_VARIANT := USER_BUILD_VARIANT=true |
| 28 | endif |
| 29 | |
| 30 | # ABL ELF output |
| 31 | TARGET_ABL := $(PRODUCT_OUT)/abl.elf |
| 32 | ABL_OUT := $(TARGET_OUT_INTERMEDIATES)/ABL_OBJ |
| 33 | |
| 34 | abl_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 | |
| 47 | TARGET_EMMC_BOOTLOADER := $(PRODUCT_OUT)/abl.elf |
| 48 | $(TARGET_EMMC_BOOTLOADER): $(ABL_OUT) | $(TARGET_ABL) |
| 49 | |
| 50 | .PHONY: abl |
| 51 | |
| 52 | abl: $(TARGET_ABL) |