3 # Edit the following variables (plus copy/paste another set of rules) when
4 # adding a new target. mkamsboot.c also needs to be edited to refer to these
7 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
8 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
10 all: ..
/dualboot.h ..
/dualboot.c
12 # Dualboot bootloaders
14 dualboot_clip.o
: dualboot.S
15 $(CROSS_PREFIX
)-$(CC
) -DSANSA_CLIP
-c
-o dualboot_clip.o dualboot.S
17 dualboot_fuze.o
: dualboot.S
18 $(CROSS_PREFIX
)-$(CC
) -DSANSA_FUZE
-c
-o dualboot_fuze.o dualboot.S
20 dualboot_e200v2.o
: dualboot.S
21 $(CROSS_PREFIX
)-$(CC
) -DSANSA_E200V2
-c
-o dualboot_e200v2.o dualboot.S
23 dualboot_m200v4.o
: dualboot.S
24 $(CROSS_PREFIX
)-$(CC
) -DSANSA_M200V4
-c
-o dualboot_m200v4.o dualboot.S
26 dualboot_c200v2.o
: dualboot.S
27 $(CROSS_PREFIX
)-$(CC
) -DSANSA_C200V2
-c
-o dualboot_c200v2.o dualboot.S
29 dualboot_clipv2.o
: dualboot.S
30 $(CROSS_PREFIX
)-$(CC
) -DSANSA_CLIPV2
-c
-o dualboot_clipv2.o dualboot.S
32 dualboot_clipplus.o
: dualboot.S
33 $(CROSS_PREFIX
)-$(CC
) -DSANSA_CLIPPLUS
-c
-o dualboot_clipplus.o dualboot.S
35 dualboot_fuzev2.o
: dualboot.S
36 $(CROSS_PREFIX
)-$(CC
) -DSANSA_FUZEV2
-c
-o dualboot_fuzev2.o dualboot.S
38 # Rules for the ucl unpack function
39 nrv2e_d8.o
: nrv2e_d8.S
40 $(CROSS_PREFIX
)-$(CC
) -DPURE_THUMB
-c
-o nrv2e_d8.o nrv2e_d8.S
42 # Rules for the ARM code embedded in mkamsboot - assemble, link, then extract
43 # the binary code and finally convert to .h for building in mkamsboot
46 $(CROSS_PREFIX
)-ld -e
0 -Ttext
=0 -o
$@
$<
49 $(CROSS_PREFIX
)-objcopy
-O binary
$< $@
51 ..
/dualboot.c ..
/dualboot.h
: $(BOOTBINS
) bin2c
52 .
/bin2c ..
/dualboot
$(BOOTBINS
)
55 $(CC
) -o bin2c bin2c.c
58 rm -f
*~ bin2c
$(BOOTBINS
) $(BOOTOBJS
)