Kinson Chik | 18e3633 | 2011-08-15 10:07:28 -0700 | [diff] [blame] | 1 | #Makefile to generate appsboot.mbn |
| 2 | |
| 3 | ifeq ($(BOOTLOADER_OUT),.) |
| 4 | APPSBOOTHEADER_DIR := $(BUILDDIR) |
| 5 | else |
Ajay Dudani | 7e5a630 | 2011-11-24 12:23:49 -0800 | [diff] [blame] | 6 | APPSBOOTHEADER_DIR := $(BOOTLOADER_OUT)/../.. |
Kinson Chik | 18e3633 | 2011-08-15 10:07:28 -0700 | [diff] [blame] | 7 | endif |
| 8 | |
| 9 | SRC_DIR := target/$(TARGET)/tools |
| 10 | COMPILER := gcc |
| 11 | |
| 12 | ifeq ($(EMMC_BOOT), 1) |
| 13 | APPSBOOTHDR_FILES := EMMCBOOT.MBN |
| 14 | else |
| 15 | ifeq ($(BUILD_NANDWRITE), 1) |
| 16 | APPSBOOTHDR_FILES := |
| 17 | else |
| 18 | APPSBOOTHDR_FILES := appsboot.mbn |
| 19 | endif |
| 20 | endif |
| 21 | |
| 22 | APPSBOOTHEADER: $(APPSBOOTHDR_FILES) |
| 23 | |
| 24 | |
| 25 | appsboot.mbn: appsboothd.mbn $(OUTBIN) |
| 26 | cp $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboot.raw |
| 27 | cat $(APPSBOOTHEADER_DIR)/appsboothd.mbn $(OUTBIN) > $(APPSBOOTHEADER_DIR)/appsboot.mbn |
| 28 | rm -f $(APPSBOOTHEADER_DIR)/appsboothd.mbn |
| 29 | |
| 30 | appsboothd.mbn: mkheader $(OUTBIN) |
| 31 | $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboothd.mbn |
| 32 | |
| 33 | EMMCBOOT.MBN: emmc_appsboothd.mbn $(OUTBIN) |
| 34 | cp $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboot.raw |
| 35 | cat $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn $(OUTBIN) > $(APPSBOOTHEADER_DIR)/EMMCBOOT.MBN |
| 36 | cat $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn $(OUTBIN) > $(APPSBOOTHEADER_DIR)/emmc_appsboot.mbn |
| 37 | rm -f $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn |
| 38 | |
| 39 | emmc_appsboothd.mbn: mkheader $(OUTBIN) |
| 40 | $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn |
| 41 | |
| 42 | mkheader: $(SRC_DIR)/mkheader.c |
| 43 | ${COMPILER} -DMEMBASE=$(MEMBASE) $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader |