blob: 13316ac0793645311e14a556ee511f4bdeea1976 [file] [log] [blame]
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -08001#Android makefile to build lk bootloader as a part of Android Build
2
Dominic Binks96c50a52009-12-23 15:54:25 -08003TARGET_BOOTLOADER := $(PRODUCT_OUT)/appsboot.mbn
Ajay Dudani168f6cb2009-12-07 19:04:02 -08004BOOTLOADER_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/BOOTLOADER_OBJ
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -08005
David Ngbe536c32009-12-07 19:16:42 -08006# Remove bootloader binary to trigger recompile when source changes
7appsbootldr_clean:
8 $(hide) rm -f $(TARGET_BOOTLOADER)
Ajay Dudani7d131cc2009-12-09 01:06:21 -08009 $(hide) rm -rf $(BOOTLOADER_OUT)
David Ngbe536c32009-12-07 19:16:42 -080010
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -080011$(BOOTLOADER_OUT):
12 mkdir -p $(BOOTLOADER_OUT)
13
David Ng025c1d92009-12-09 23:46:00 -080014
15ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
Ajay Dudaniafc2cf52010-05-25 20:35:09 -070016TARGET_BOOTLOADER_EMMC := $(PRODUCT_OUT)/EMMCBOOT.MBN
David Ng025c1d92009-12-09 23:46:00 -080017BOOTLOADER_EMMC_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/BOOTLOADER_EMMC_OBJ
18
19emmc_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 Ng17fdc972009-12-10 11:01:43 -080026$(TARGET_BOOTLOADER): appsbootldr_clean emmc_appsbootldr_clean $(BOOTLOADER_OUT) $(BOOTLOADER_EMMC_OUT)
David Ng025c1d92009-12-09 23:46:00 -080027 $(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
30else
31
David Ng17fdc972009-12-10 11:01:43 -080032$(TARGET_BOOTLOADER): appsbootldr_clean $(BOOTLOADER_OUT)
Ajay Dudania66de4f2009-11-22 08:57:39 -080033 $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(BOOTLOADER_OUT) $(TARGET_PRODUCT)
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -080034
David Ng025c1d92009-12-09 23:46:00 -080035endif
Ajay Dudani168f6cb2009-12-07 19:04:02 -080036
37#build nandwrite as a part of Android Build
38TARGET_NANDWRITE := $(PRODUCT_OUT)/obj/nandwrite/build-$(TARGET_PRODUCT)_nandwrite/lk
39NANDWRITE_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/nandwrite
40
David Ng17fdc972009-12-10 11:01:43 -080041nandwrite_clean:
42 $(hide) rm -f $(TARGET_NANDWRITE)
43 $(hide) rm -rf $(NANDWRITE_OUT)
Ajay Dudani168f6cb2009-12-07 19:04:02 -080044
David Ng17fdc972009-12-10 11:01:43 -080045$(NANDWRITE_OUT):
46 mkdir -p $(NANDWRITE_OUT)
47
48$(TARGET_NANDWRITE): nandwrite_clean $(NANDWRITE_OUT)
Ajay Dudani168f6cb2009-12-07 19:04:02 -080049 @echo $(TARGET_PRODUCT)_nandwrite
David Ng17fdc972009-12-10 11:01:43 -080050 $(MAKE) -C bootable/bootloader/lk BOOTLOADER_OUT=../../../$(NANDWRITE_OUT) $(TARGET_PRODUCT)_nandwrite BUILD_NANDWRITE=1
Ajay Dudani168f6cb2009-12-07 19:04:02 -080051