blob: aedda701da1a41f5d7b0b34a3babc6b12913fe13 [file] [log] [blame]
Kinson Chik18e36332011-08-15 10:07:28 -07001#Makefile to generate appsboot.mbn
2
3ifeq ($(BOOTLOADER_OUT),.)
4APPSBOOTHEADER_DIR := $(BUILDDIR)
5else
Ajay Dudani7e5a6302011-11-24 12:23:49 -08006APPSBOOTHEADER_DIR := $(BOOTLOADER_OUT)/../..
Kinson Chik18e36332011-08-15 10:07:28 -07007endif
8
9SRC_DIR := target/$(TARGET)/tools
10COMPILER := gcc
11
12ifeq ($(EMMC_BOOT), 1)
13 APPSBOOTHDR_FILES := EMMCBOOT.MBN
14else
15 ifeq ($(BUILD_NANDWRITE), 1)
16 APPSBOOTHDR_FILES :=
17 else
18 APPSBOOTHDR_FILES := appsboot.mbn
19 endif
20endif
21
22APPSBOOTHEADER: $(APPSBOOTHDR_FILES)
23
24
25appsboot.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
30appsboothd.mbn: mkheader $(OUTBIN)
31 $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboothd.mbn
32
33EMMCBOOT.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
39emmc_appsboothd.mbn: mkheader $(OUTBIN)
40 $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn
41
42mkheader: $(SRC_DIR)/mkheader.c
43 ${COMPILER} -DMEMBASE=$(MEMBASE) $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader