summaryrefslogtreecommitdiffstats
path: root/rbutil/mkimxboot/dualboot/Makefile
blob: fa5f341b6d953ea6dbc2961ea84a35f2c04a75c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CC=gcc
CROSS_PREFIX=arm-elf-eabi
# Edit the following variables (plus copy/paste another set of rules) when
# adding a new target.  mkimxboot.c also needs to be edited to refer to these
# new images.

BOOTOBJS = dualboot_fuzeplus.o
BOOTBINS = dualboot_fuzeplus.arm-bin

all: ../dualboot.h ../dualboot.c

# Dualboot bootloaders

dualboot_fuzeplus.o: dualboot.S
	$(CROSS_PREFIX)-$(CC) -mcpu=arm926ej-s -DSANSA_FUZEPLUS -c -o dualboot_fuzeplus.o dualboot.S

# Rules for the ARM code embedded in mkamsboot - assemble, link, then extract
# the binary code and finally convert to .h for building in mkamsboot

%.arm-elf: %.o
	$(CROSS_PREFIX)-ld -Tdualboot.lds -o $@ $<

%.arm-bin: %.arm-elf
	$(CROSS_PREFIX)-objcopy -O binary $< $@

../dualboot.c ../dualboot.h: $(BOOTBINS) bin2c
	./bin2c ../dualboot $(BOOTBINS)

bin2c: bin2c.c
	$(CC) -o bin2c bin2c.c

clean:
	rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS)