blob: c5fa6a5397f96fc6d2f01592674d2e6eae17f636 [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
Ajay Dudani91b04272011-03-09 09:49:29 -08006ifeq ($(BUILD_ID),HONEYCOMB)
7CROSS_TOOL := ../../../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
8else
David Ng90556062010-12-20 18:36:33 -08009CROSS_TOOL := ../../../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
Ajay Dudani91b04272011-03-09 09:49:29 -080010endif
David Ng90556062010-12-20 18:36:33 -080011
David Ngbe536c32009-12-07 19:16:42 -080012# Remove bootloader binary to trigger recompile when source changes
13appsbootldr_clean:
14 $(hide) rm -f $(TARGET_BOOTLOADER)
Ajay Dudani7d131cc2009-12-09 01:06:21 -080015 $(hide) rm -rf $(BOOTLOADER_OUT)
David Ngbe536c32009-12-07 19:16:42 -080016
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -080017$(BOOTLOADER_OUT):
18 mkdir -p $(BOOTLOADER_OUT)
19
David Ng025c1d92009-12-09 23:46:00 -080020
David Ng90556062010-12-20 18:36:33 -080021TARGET_EMMC := 0
David Ng025c1d92009-12-09 23:46:00 -080022ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
David Ng90556062010-12-20 18:36:33 -080023 TARGET_EMMC := 1
24endif
25ifeq ($(TARGET_USERIMAGES_USE_EXT3),true)
26 TARGET_EMMC := 1
27endif
28ifeq ($(TARGET_USERIMAGES_USE_EXT4),true)
29 TARGET_EMMC := 1
30endif
31
32
33ifeq ($(TARGET_EMMC),1)
Ajay Dudaniafc2cf52010-05-25 20:35:09 -070034TARGET_BOOTLOADER_EMMC := $(PRODUCT_OUT)/EMMCBOOT.MBN
David Ng025c1d92009-12-09 23:46:00 -080035BOOTLOADER_EMMC_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/BOOTLOADER_EMMC_OBJ
36
37emmc_appsbootldr_clean:
38 $(hide) rm -f $(TARGET_BOOTLOADER_EMMC)
39 $(hide) rm -rf $(BOOTLOADER_EMMC_OUT)
40
41$(BOOTLOADER_EMMC_OUT):
42 mkdir -p $(BOOTLOADER_EMMC_OUT)
43
David Ng17fdc972009-12-10 11:01:43 -080044$(TARGET_BOOTLOADER): appsbootldr_clean emmc_appsbootldr_clean $(BOOTLOADER_OUT) $(BOOTLOADER_EMMC_OUT)
David Ng90556062010-12-20 18:36:33 -080045 $(MAKE) -C bootable/bootloader/lk TOOLCHAIN_PREFIX=$(CROSS_TOOL) BOOTLOADER_OUT=../../../$(BOOTLOADER_OUT) $(TARGET_PRODUCT)
46 $(MAKE) -C bootable/bootloader/lk TOOLCHAIN_PREFIX=$(CROSS_TOOL) BOOTLOADER_OUT=../../../$(BOOTLOADER_EMMC_OUT) $(TARGET_PRODUCT) EMMC_BOOT=1
David Ng025c1d92009-12-09 23:46:00 -080047
48else
49
David Ng17fdc972009-12-10 11:01:43 -080050$(TARGET_BOOTLOADER): appsbootldr_clean $(BOOTLOADER_OUT)
David Ng90556062010-12-20 18:36:33 -080051 $(MAKE) -C bootable/bootloader/lk TOOLCHAIN_PREFIX=$(CROSS_TOOL) BOOTLOADER_OUT=../../../$(BOOTLOADER_OUT) $(TARGET_PRODUCT)
Chandan Uddarajua9b07bb2009-11-21 12:22:02 -080052
David Ng025c1d92009-12-09 23:46:00 -080053endif
Ajay Dudani168f6cb2009-12-07 19:04:02 -080054
55#build nandwrite as a part of Android Build
56TARGET_NANDWRITE := $(PRODUCT_OUT)/obj/nandwrite/build-$(TARGET_PRODUCT)_nandwrite/lk
57NANDWRITE_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/nandwrite
58
David Ng17fdc972009-12-10 11:01:43 -080059nandwrite_clean:
60 $(hide) rm -f $(TARGET_NANDWRITE)
61 $(hide) rm -rf $(NANDWRITE_OUT)
Ajay Dudani168f6cb2009-12-07 19:04:02 -080062
David Ng17fdc972009-12-10 11:01:43 -080063$(NANDWRITE_OUT):
64 mkdir -p $(NANDWRITE_OUT)
65
66$(TARGET_NANDWRITE): nandwrite_clean $(NANDWRITE_OUT)
Ajay Dudani168f6cb2009-12-07 19:04:02 -080067 @echo $(TARGET_PRODUCT)_nandwrite
David Ng90556062010-12-20 18:36:33 -080068 $(MAKE) -C bootable/bootloader/lk TOOLCHAIN_PREFIX=$(CROSS_TOOL) BOOTLOADER_OUT=../../../$(NANDWRITE_OUT) $(TARGET_PRODUCT)_nandwrite BUILD_NANDWRITE=1
Ajay Dudani168f6cb2009-12-07 19:04:02 -080069