Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 1 | #Android makefile to build lk bootloader as a part of Android Build |
| 2 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 3 | # Set flags if we need to include security libs |
Shashank Mittal | cd98d47 | 2011-08-02 14:29:24 -0700 | [diff] [blame] | 4 | ifeq ($(TARGET_BOOTIMG_SIGNED),true) |
| 5 | SIGNED_KERNEL := SIGNED_KERNEL=1 |
| 6 | else |
| 7 | SIGNED_KERNEL := SIGNED_KERNEL=0 |
| 8 | endif |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 9 | |
wangxl | 1ddbd09 | 2015-02-03 20:31:24 +0800 | [diff] [blame] | 10 | ifneq ($(strip $(TARGET_BOOTLOADER_PLATFORM_OVERRIDE)),) |
| 11 | BOOTLOADER_PLATFORM := $(TARGET_BOOTLOADER_PLATFORM_OVERRIDE) |
David Ng | 7fbe5c3 | 2012-07-18 12:07:02 -0700 | [diff] [blame] | 12 | else |
wangxl | 1ddbd09 | 2015-02-03 20:31:24 +0800 | [diff] [blame] | 13 | ifeq ($(call is-board-platform,msm8660),true) |
| 14 | BOOTLOADER_PLATFORM := msm8660_surf |
| 15 | else |
| 16 | BOOTLOADER_PLATFORM := $(TARGET_BOARD_PLATFORM) |
| 17 | endif |
David Ng | 7fbe5c3 | 2012-07-18 12:07:02 -0700 | [diff] [blame] | 18 | endif |
Channagoud Kadabi | 49c6696 | 2013-01-28 13:39:27 -0800 | [diff] [blame] | 19 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 20 | # NAND variant output |
| 21 | TARGET_NAND_BOOTLOADER := $(PRODUCT_OUT)/appsboot.mbn |
| 22 | NAND_BOOTLOADER_OUT := $(TARGET_OUT_INTERMEDIATES)/NAND_BOOTLOADER_OBJ |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 23 | |
Channagoud Kadabi | c52dc18 | 2011-12-14 00:08:48 +0530 | [diff] [blame] | 24 | # Remove bootloader binary to trigger recompile when source changes |
| 25 | appsbootldr_clean: |
| 26 | $(hide) rm -f $(TARGET_NAND_BOOTLOADER) |
| 27 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 28 | $(NAND_BOOTLOADER_OUT): |
| 29 | mkdir -p $(NAND_BOOTLOADER_OUT) |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 30 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 31 | # eMMC variant output |
| 32 | TARGET_EMMC_BOOTLOADER := $(PRODUCT_OUT)/emmc_appsboot.mbn |
| 33 | EMMC_BOOTLOADER_OUT := $(TARGET_OUT_INTERMEDIATES)/EMMC_BOOTLOADER_OBJ |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 34 | |
Channagoud Kadabi | c52dc18 | 2011-12-14 00:08:48 +0530 | [diff] [blame] | 35 | emmc_appsbootldr_clean: |
| 36 | $(hide) rm -f $(TARGET_EMMC_BOOTLOADER) |
| 37 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 38 | $(EMMC_BOOTLOADER_OUT): |
| 39 | mkdir -p $(EMMC_BOOTLOADER_OUT) |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 40 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 41 | # Top level for NAND variant targets |
Channagoud Kadabi | c52dc18 | 2011-12-14 00:08:48 +0530 | [diff] [blame] | 42 | $(TARGET_NAND_BOOTLOADER): appsbootldr_clean | $(NAND_BOOTLOADER_OUT) |
David Ng | 7fbe5c3 | 2012-07-18 12:07:02 -0700 | [diff] [blame] | 43 | $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(NAND_BOOTLOADER_OUT) $(BOOTLOADER_PLATFORM) $(SIGNED_KERNEL) |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 44 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 45 | # Top level for eMMC variant targets |
Channagoud Kadabi | c52dc18 | 2011-12-14 00:08:48 +0530 | [diff] [blame] | 46 | $(TARGET_EMMC_BOOTLOADER): emmc_appsbootldr_clean | $(EMMC_BOOTLOADER_OUT) |
David Ng | 7fbe5c3 | 2012-07-18 12:07:02 -0700 | [diff] [blame] | 47 | $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(EMMC_BOOTLOADER_OUT) $(BOOTLOADER_PLATFORM) EMMC_BOOT=1 $(SIGNED_KERNEL) |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 48 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 49 | # Keep build NAND & eMMC as default for targets still using TARGET_BOOTLOADER |
| 50 | TARGET_BOOTLOADER := $(PRODUCT_OUT)/EMMCBOOT.MBN |
| 51 | $(TARGET_BOOTLOADER): $(NAND_BOOTLOADER_OUT) $(EMMC_BOOTLOADER_OUT) | $(TARGET_NAND_BOOTLOADER) $(TARGET_EMMC_BOOTLOADER) |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 52 | |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 53 | # |
| 54 | # Build nandwrite as a part of Android Build for NAND configurations |
| 55 | # |
David Ng | 7fbe5c3 | 2012-07-18 12:07:02 -0700 | [diff] [blame] | 56 | TARGET_NANDWRITE := $(PRODUCT_OUT)/obj/nandwrite/build-$(BOOTLOADER_PLATFORM)_nandwrite/lk |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 57 | NANDWRITE_OUT := $(TARGET_OUT_INTERMEDIATES)/nandwrite |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 58 | |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 59 | nandwrite_clean: |
| 60 | $(hide) rm -f $(TARGET_NANDWRITE) |
| 61 | $(hide) rm -rf $(NANDWRITE_OUT) |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 62 | |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 63 | $(NANDWRITE_OUT): |
| 64 | mkdir -p $(NANDWRITE_OUT) |
| 65 | |
Anshul Gupta | 0fd98fd | 2011-10-20 20:48:55 +0530 | [diff] [blame] | 66 | $(TARGET_NANDWRITE): nandwrite_clean | $(NANDWRITE_OUT) |
David Ng | 7fbe5c3 | 2012-07-18 12:07:02 -0700 | [diff] [blame] | 67 | @echo $(BOOTLOADER_PLATFORM)_nandwrite |
| 68 | $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(NANDWRITE_OUT) $(BOOTLOADER_PLATFORM)_nandwrite BUILD_NANDWRITE=1 |