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 | |
Ajay Dudani | 91b0427 | 2011-03-09 09:49:29 -0800 | [diff] [blame] | 6 | ifeq ($(BUILD_ID),HONEYCOMB) |
| 7 | CROSS_TOOL := ../../../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- |
| 8 | else |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 9 | CROSS_TOOL := ../../../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- |
Ajay Dudani | 91b0427 | 2011-03-09 09:49:29 -0800 | [diff] [blame] | 10 | endif |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 11 | |
David Ng | be536c3 | 2009-12-07 19:16:42 -0800 | [diff] [blame] | 12 | # Remove bootloader binary to trigger recompile when source changes |
| 13 | appsbootldr_clean: |
| 14 | $(hide) rm -f $(TARGET_BOOTLOADER) |
Ajay Dudani | 7d131cc | 2009-12-09 01:06:21 -0800 | [diff] [blame] | 15 | $(hide) rm -rf $(BOOTLOADER_OUT) |
David Ng | be536c3 | 2009-12-07 19:16:42 -0800 | [diff] [blame] | 16 | |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 17 | $(BOOTLOADER_OUT): |
| 18 | mkdir -p $(BOOTLOADER_OUT) |
| 19 | |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 20 | |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 21 | TARGET_EMMC := 0 |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 22 | ifeq ($(TARGET_USERIMAGES_USE_EXT2),true) |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 23 | TARGET_EMMC := 1 |
| 24 | endif |
| 25 | ifeq ($(TARGET_USERIMAGES_USE_EXT3),true) |
| 26 | TARGET_EMMC := 1 |
| 27 | endif |
| 28 | ifeq ($(TARGET_USERIMAGES_USE_EXT4),true) |
| 29 | TARGET_EMMC := 1 |
| 30 | endif |
| 31 | |
| 32 | |
| 33 | ifeq ($(TARGET_EMMC),1) |
Ajay Dudani | afc2cf5 | 2010-05-25 20:35:09 -0700 | [diff] [blame] | 34 | TARGET_BOOTLOADER_EMMC := $(PRODUCT_OUT)/EMMCBOOT.MBN |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 35 | BOOTLOADER_EMMC_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/BOOTLOADER_EMMC_OBJ |
| 36 | |
| 37 | emmc_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 Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 44 | $(TARGET_BOOTLOADER): appsbootldr_clean emmc_appsbootldr_clean $(BOOTLOADER_OUT) $(BOOTLOADER_EMMC_OUT) |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 45 | $(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 Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 47 | |
| 48 | else |
| 49 | |
David Ng | 17fdc97 | 2009-12-10 11:01:43 -0800 | [diff] [blame] | 50 | $(TARGET_BOOTLOADER): appsbootldr_clean $(BOOTLOADER_OUT) |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 51 | $(MAKE) -C bootable/bootloader/lk TOOLCHAIN_PREFIX=$(CROSS_TOOL) BOOTLOADER_OUT=../../../$(BOOTLOADER_OUT) $(TARGET_PRODUCT) |
Chandan Uddaraju | a9b07bb | 2009-11-21 12:22:02 -0800 | [diff] [blame] | 52 | |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 53 | endif |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 54 | |
| 55 | #build nandwrite as a part of Android Build |
| 56 | TARGET_NANDWRITE := $(PRODUCT_OUT)/obj/nandwrite/build-$(TARGET_PRODUCT)_nandwrite/lk |
| 57 | NANDWRITE_OUT := $(TOP)/$(TARGET_OUT_INTERMEDIATES)/nandwrite |
| 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 | |
| 66 | $(TARGET_NANDWRITE): nandwrite_clean $(NANDWRITE_OUT) |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 67 | @echo $(TARGET_PRODUCT)_nandwrite |
David Ng | 9055606 | 2010-12-20 18:36:33 -0800 | [diff] [blame] | 68 | $(MAKE) -C bootable/bootloader/lk TOOLCHAIN_PREFIX=$(CROSS_TOOL) BOOTLOADER_OUT=../../../$(NANDWRITE_OUT) $(TARGET_PRODUCT)_nandwrite BUILD_NANDWRITE=1 |
Ajay Dudani | 168f6cb | 2009-12-07 19:04:02 -0800 | [diff] [blame] | 69 | |