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 | |
Dominic Binks | 96c50a5 | 2009-12-23 15:54:25 -0800 | [diff] [blame] | 3 | TARGET_BOOTLOADER := $(PRODUCT_OUT)/appsboot.mbn |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 4 | BOOTLOADER_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/BOOTLOADER_OBJ |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 5 | |
David Ng | be536c3 | 2009-12-07 19:16:42 -0800 | [diff] [blame] | 6 | # Remove bootloader binary to trigger recompile when source changes |
| 7 | appsbootldr_clean: |
| 8 | $(hide) rm -f $(TARGET_BOOTLOADER) |
Ajay Dudani | 7d131cc | 2009-12-09 01:06:21 -0800 | [diff] [blame] | 9 | $(hide) rm -rf $(BOOTLOADER_OUT) |
David Ng | be536c3 | 2009-12-07 19:16:42 -0800 | [diff] [blame] | 10 | |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 11 | $(BOOTLOADER_OUT): |
| 12 | mkdir -p $(BOOTLOADER_OUT) |
| 13 | |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 14 | |
| 15 | ifeq ($(TARGET_USERIMAGES_USE_EXT2),true) |
Ajay Dudani | afc2cf5 | 2010-05-25 20:35:09 -0700 | [diff] [blame] | 16 | TARGET_BOOTLOADER_EMMC := $(PRODUCT_OUT)/EMMCBOOT.MBN |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 17 | BOOTLOADER_EMMC_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/BOOTLOADER_EMMC_OBJ |
| 18 | |
| 19 | emmc_appsbootldr_clean: |
| 20 | $(hide) rm -f $(TARGET_BOOTLOADER_EMMC) |
| 21 | $(hide) rm -rf $(BOOTLOADER_EMMC_OUT) |
| 22 | |
| 23 | $(BOOTLOADER_EMMC_OUT): |
| 24 | mkdir -p $(BOOTLOADER_EMMC_OUT) |
| 25 | |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 26 | $(TARGET_BOOTLOADER): appsbootldr_clean emmc_appsbootldr_clean $(BOOTLOADER_OUT) $(BOOTLOADER_EMMC_OUT) |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 27 | $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(BOOTLOADER_OUT) $(TARGET_PRODUCT) |
| 28 | $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(BOOTLOADER_EMMC_OUT) $(TARGET_PRODUCT) EMMC_BOOT=1 |
| 29 | |
| 30 | else |
| 31 | |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 32 | $(TARGET_BOOTLOADER): appsbootldr_clean $(BOOTLOADER_OUT) |
Ajay Dudani | a66de4f | 2009-11-22 08:57:39 -0800 | [diff] [blame] | 33 | $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(BOOTLOADER_OUT) $(TARGET_PRODUCT) |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 34 | |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 35 | endif |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 36 | |
| 37 | #build nandwrite as a part of Android Build |
| 38 | TARGET_NANDWRITE := $(PRODUCT_OUT)/obj/nandwrite/build-$(TARGET_PRODUCT)_nandwrite/lk |
| 39 | NANDWRITE_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/nandwrite |
| 40 | |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 41 | nandwrite_clean: |
| 42 | $(hide) rm -f $(TARGET_NANDWRITE) |
| 43 | $(hide) rm -rf $(NANDWRITE_OUT) |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 44 | |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 45 | $(NANDWRITE_OUT): |
| 46 | mkdir -p $(NANDWRITE_OUT) |
| 47 | |
| 48 | $(TARGET_NANDWRITE): nandwrite_clean $(NANDWRITE_OUT) |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 49 | @echo $(TARGET_PRODUCT)_nandwrite |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 50 | $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(NANDWRITE_OUT) $(TARGET_PRODUCT)_nandwrite BUILD_NANDWRITE=1 |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 51 | |