2009-05-28 18:27:08 +00:00
|
|
|
CC=gcc
|
2011-12-02 18:31:36 +00:00
|
|
|
CROSS_PREFIX?=arm-elf-eabi
|
2009-05-28 18:27:08 +00:00
|
|
|
# Edit the following variables (plus copy/paste another set of rules) when
|
|
|
|
# adding a new target. mkamsboot.c also needs to be edited to refer to these
|
|
|
|
# new images.
|
|
|
|
|
2011-09-05 18:14:29 +00:00
|
|
|
BOOTOBJS = nrv2e_d8.o dualboot_clip.o dualboot_e200v2.o dualboot_c200v2.o dualboot_m200v4.o dualboot_fuze.o dualboot_clipv2.o dualboot_clipplus.o dualboot_fuzev2.o dualboot_clipzip.o
|
|
|
|
BOOTBINS = nrv2e_d8.arm-bin dualboot_clip.arm-bin dualboot_e200v2.arm-bin dualboot_c200v2.arm-bin dualboot_m200v4.arm-bin dualboot_fuze.arm-bin dualboot_clipv2.arm-bin dualboot_clipplus.arm-bin dualboot_fuzev2.arm-bin dualboot_clipzip.arm-bin
|
2009-05-28 18:27:08 +00:00
|
|
|
|
2010-02-17 14:37:06 +00:00
|
|
|
all: ../dualboot.h ../dualboot.c
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
# Dualboot bootloaders
|
|
|
|
|
|
|
|
dualboot_clip.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_CLIP -c -o dualboot_clip.o dualboot.S
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
dualboot_fuze.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_FUZE -c -o dualboot_fuze.o dualboot.S
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
dualboot_e200v2.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_E200V2 -c -o dualboot_e200v2.o dualboot.S
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
dualboot_m200v4.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_M200V4 -c -o dualboot_m200v4.o dualboot.S
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
dualboot_c200v2.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_C200V2 -c -o dualboot_c200v2.o dualboot.S
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
dualboot_clipv2.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_CLIPV2 -c -o dualboot_clipv2.o dualboot.S
|
2009-05-28 18:27:08 +00:00
|
|
|
|
2010-01-13 03:05:29 +00:00
|
|
|
dualboot_clipplus.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_CLIPPLUS -c -o dualboot_clipplus.o dualboot.S
|
2010-01-13 03:05:29 +00:00
|
|
|
|
2010-02-26 13:55:17 +00:00
|
|
|
dualboot_fuzev2.o: dualboot.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_FUZEV2 -c -o dualboot_fuzev2.o dualboot.S
|
2010-02-26 13:55:17 +00:00
|
|
|
|
2011-09-05 18:14:29 +00:00
|
|
|
dualboot_clipzip.o: dualboot.S
|
|
|
|
$(CROSS_PREFIX)-$(CC) -DSANSA_CLIPZIP -c -o dualboot_clipzip.o dualboot.S
|
|
|
|
|
2009-05-28 18:27:08 +00:00
|
|
|
# Rules for the ucl unpack function
|
|
|
|
nrv2e_d8.o: nrv2e_d8.S
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-$(CC) -DPURE_THUMB -c -o nrv2e_d8.o nrv2e_d8.S
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
# Rules for the ARM code embedded in mkamsboot - assemble, link, then extract
|
|
|
|
# the binary code and finally convert to .h for building in mkamsboot
|
|
|
|
|
2010-03-08 17:49:06 +00:00
|
|
|
%.arm-elf: %.o
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-ld -e 0 -Ttext=0 -o $@ $<
|
2009-05-28 18:27:08 +00:00
|
|
|
|
2010-03-08 17:49:06 +00:00
|
|
|
%.arm-bin: %.arm-elf
|
2010-03-08 16:05:11 +00:00
|
|
|
$(CROSS_PREFIX)-objcopy -O binary $< $@
|
2009-05-28 18:27:08 +00:00
|
|
|
|
2010-02-17 14:37:06 +00:00
|
|
|
../dualboot.c ../dualboot.h: $(BOOTBINS) bin2c
|
|
|
|
./bin2c ../dualboot $(BOOTBINS)
|
2009-05-28 18:27:08 +00:00
|
|
|
|
|
|
|
bin2c: bin2c.c
|
|
|
|
$(CC) -o bin2c bin2c.c
|
|
|
|
|
|
|
|
clean:
|
2010-02-17 14:37:06 +00:00
|
|
|
rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS)
|