blob: 6836163bed97762004689200893c7f3ccf9710cd [file] [log] [blame]
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -08001#Android makefile to build lk bootloader as a part of Android Build
2
Ajay Dudani7e5a6302011-11-24 12:23:49 -08003# Set flags if we need to include security libs
Shashank Mittalcd98d472011-08-02 14:29:24 -07004ifeq ($(TARGET_BOOTIMG_SIGNED),true)
5 SIGNED_KERNEL := SIGNED_KERNEL=1
6else
7 SIGNED_KERNEL := SIGNED_KERNEL=0
8endif
David Ng90556062010-12-20 18:36:33 -08009
Channagoud Kadabi49c66962013-01-28 13:39:27 -080010ifeq ($(call is-board-platform,msm8660),true)
11 BOOTLOADER_PLATFORM := msm8660_surf
David Ng7fbe5c32012-07-18 12:07:02 -070012else
Channagoud Kadabi49c66962013-01-28 13:39:27 -080013 BOOTLOADER_PLATFORM := $(TARGET_BOARD_PLATFORM)
David Ng7fbe5c32012-07-18 12:07:02 -070014endif
Channagoud Kadabi49c66962013-01-28 13:39:27 -080015
Ajay Dudani7e5a6302011-11-24 12:23:49 -080016# NAND variant output
17TARGET_NAND_BOOTLOADER := $(PRODUCT_OUT)/appsboot.mbn
18NAND_BOOTLOADER_OUT := $(TARGET_OUT_INTERMEDIATES)/NAND_BOOTLOADER_OBJ
David Ng025c1d92009-12-09 23:46:00 -080019
Channagoud Kadabic52dc182011-12-14 00:08:48 +053020# Remove bootloader binary to trigger recompile when source changes
21appsbootldr_clean:
22 $(hide) rm -f $(TARGET_NAND_BOOTLOADER)
23
Ajay Dudani7e5a6302011-11-24 12:23:49 -080024$(NAND_BOOTLOADER_OUT):
25 mkdir -p $(NAND_BOOTLOADER_OUT)
David Ng025c1d92009-12-09 23:46:00 -080026
Ajay Dudani7e5a6302011-11-24 12:23:49 -080027# eMMC variant output
28TARGET_EMMC_BOOTLOADER := $(PRODUCT_OUT)/emmc_appsboot.mbn
29EMMC_BOOTLOADER_OUT := $(TARGET_OUT_INTERMEDIATES)/EMMC_BOOTLOADER_OBJ
David Ng025c1d92009-12-09 23:46:00 -080030
Channagoud Kadabic52dc182011-12-14 00:08:48 +053031emmc_appsbootldr_clean:
32 $(hide) rm -f $(TARGET_EMMC_BOOTLOADER)
33
Ajay Dudani7e5a6302011-11-24 12:23:49 -080034$(EMMC_BOOTLOADER_OUT):
35 mkdir -p $(EMMC_BOOTLOADER_OUT)
David Ng025c1d92009-12-09 23:46:00 -080036
Ajay Dudani7e5a6302011-11-24 12:23:49 -080037# Top level for NAND variant targets
Channagoud Kadabic52dc182011-12-14 00:08:48 +053038$(TARGET_NAND_BOOTLOADER): appsbootldr_clean | $(NAND_BOOTLOADER_OUT)
David Ng7fbe5c32012-07-18 12:07:02 -070039 $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(NAND_BOOTLOADER_OUT) $(BOOTLOADER_PLATFORM) $(SIGNED_KERNEL)
David Ng025c1d92009-12-09 23:46:00 -080040
Ajay Dudani7e5a6302011-11-24 12:23:49 -080041# Top level for eMMC variant targets
Channagoud Kadabic52dc182011-12-14 00:08:48 +053042$(TARGET_EMMC_BOOTLOADER): emmc_appsbootldr_clean | $(EMMC_BOOTLOADER_OUT)
David Ng7fbe5c32012-07-18 12:07:02 -070043 $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(EMMC_BOOTLOADER_OUT) $(BOOTLOADER_PLATFORM) EMMC_BOOT=1 $(SIGNED_KERNEL)
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -080044
Ajay Dudani7e5a6302011-11-24 12:23:49 -080045# Keep build NAND & eMMC as default for targets still using TARGET_BOOTLOADER
46TARGET_BOOTLOADER := $(PRODUCT_OUT)/EMMCBOOT.MBN
47$(TARGET_BOOTLOADER): $(NAND_BOOTLOADER_OUT) $(EMMC_BOOTLOADER_OUT) | $(TARGET_NAND_BOOTLOADER) $(TARGET_EMMC_BOOTLOADER)
Ajay Dudani168f6cb2009-12-07 19:04:02 -080048
Ajay Dudani7e5a6302011-11-24 12:23:49 -080049#
50# Build nandwrite as a part of Android Build for NAND configurations
51#
David Ng7fbe5c32012-07-18 12:07:02 -070052TARGET_NANDWRITE := $(PRODUCT_OUT)/obj/nandwrite/build-$(BOOTLOADER_PLATFORM)_nandwrite/lk
Ajay Dudani7e5a6302011-11-24 12:23:49 -080053NANDWRITE_OUT := $(TARGET_OUT_INTERMEDIATES)/nandwrite
Ajay Dudani168f6cb2009-12-07 19:04:02 -080054
David Ng17fdc972009-12-10 11:01:43 -080055nandwrite_clean:
56 $(hide) rm -f $(TARGET_NANDWRITE)
57 $(hide) rm -rf $(NANDWRITE_OUT)
Ajay Dudani168f6cb2009-12-07 19:04:02 -080058
David Ng17fdc972009-12-10 11:01:43 -080059$(NANDWRITE_OUT):
60 mkdir -p $(NANDWRITE_OUT)
61
Anshul Gupta0fd98fd2011-10-20 20:48:55 +053062$(TARGET_NANDWRITE): nandwrite_clean | $(NANDWRITE_OUT)
David Ng7fbe5c32012-07-18 12:07:02 -070063 @echo $(BOOTLOADER_PLATFORM)_nandwrite
64 $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(NANDWRITE_OUT) $(BOOTLOADER_PLATFORM)_nandwrite BUILD_NANDWRITE=1