diff options
Diffstat (limited to 'utils/mkimxboot/dualboot/Makefile')
-rw-r--r-- | utils/mkimxboot/dualboot/Makefile | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/utils/mkimxboot/dualboot/Makefile b/utils/mkimxboot/dualboot/Makefile new file mode 100644 index 0000000000..b80233226a --- /dev/null +++ b/utils/mkimxboot/dualboot/Makefile | |||
@@ -0,0 +1,48 @@ | |||
1 | CC=gcc | ||
2 | LD=ld | ||
3 | OC=objcopy | ||
4 | PREFIX?=arm-elf-eabi- | ||
5 | IMX233_PATH=../../../firmware/target/arm/imx233 | ||
6 | CFLAGS=-mcpu=arm926ej-s -std=gnu99 -I. -I$(IMX233_PATH) -nostdlib -ffreestanding -fomit-frame-pointer -O | ||
7 | # Edit the following variables when adding a new target. | ||
8 | # mkimxboot.c also needs to be edited to refer to these | ||
9 | # To add a new target x you need to: | ||
10 | # 1) add x to the list in TARGETS | ||
11 | # 2) create a variable named OPT_x of the form: | ||
12 | # OPT_x=target specific defines | ||
13 | TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 zenxfistyle | ||
14 | OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780 | ||
15 | OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780 | ||
16 | OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780 | ||
17 | OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780 | ||
18 | OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780 | ||
19 | OPT_zenxfistyle=-DCREATIVE_ZENXFISTYLE -DIMX233_SUBTARGET=3780 | ||
20 | |||
21 | BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) | ||
22 | BOOTBINS=$(patsubst %, dualboot_%.arm-bin, $(TARGETS)) | ||
23 | BOOTELFS=$(patsubst %, dualboot_%.arm-elf, $(TARGETS)) | ||
24 | |||
25 | all: ../dualboot.h ../dualboot.c $(BOOTELFS) | ||
26 | |||
27 | # Dualboot bootloaders | ||
28 | |||
29 | dualboot_%.o: dualboot.c | ||
30 | $(PREFIX)$(CC) $(CFLAGS) $(OPT_$(@:dualboot_%.o=%)) -c -o $@ $^ | ||
31 | |||
32 | dualboot_%.arm-elf: dualboot_%.o | ||
33 | $(PREFIX)$(LD) $(LDFLAGS) -Tdualboot.lds -o $@ $< | ||
34 | |||
35 | # Rules for the ARM code embedded in mkamsboot - assemble, link, then extract | ||
36 | # the binary code and finally convert to .h for building in mkamsboot | ||
37 | |||
38 | %.arm-bin: %.arm-elf | ||
39 | $(PREFIX)$(OC) -O binary $< $@ | ||
40 | |||
41 | ../dualboot.c ../dualboot.h: $(BOOTBINS) bin2c | ||
42 | ./bin2c ../dualboot $(BOOTBINS) | ||
43 | |||
44 | bin2c: bin2c.c | ||
45 | $(CC) -o bin2c bin2c.c | ||
46 | |||
47 | clean: | ||
48 | rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS) $(BOOTELFS) | ||