2011-11-06 19:44:03 +00:00
|
|
|
CC=gcc
|
2013-07-07 15:34:04 +00:00
|
|
|
LD=ld
|
|
|
|
OC=objcopy
|
2016-05-02 20:27:24 +00:00
|
|
|
PREFIX?=arm-elf-eabi-
|
2016-09-26 20:22:21 +00:00
|
|
|
IMX233_PATH=../../../firmware/target/arm/imx233
|
|
|
|
CFLAGS=-mcpu=arm926ej-s -std=gnu99 -I. -I$(IMX233_PATH) -nostdlib -ffreestanding -fomit-frame-pointer -O
|
2013-07-07 15:34:04 +00:00
|
|
|
# Edit the following variables when adding a new target.
|
|
|
|
# mkimxboot.c also needs to be edited to refer to these
|
|
|
|
# To add a new target x you need to:
|
|
|
|
# 1) add x to the list in TARGETS
|
|
|
|
# 2) create a variable named OPT_x of the form:
|
|
|
|
# OPT_x=target specific defines
|
2014-01-05 14:20:41 +00:00
|
|
|
TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 zenxfistyle
|
2013-07-07 15:34:04 +00:00
|
|
|
OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780
|
|
|
|
OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780
|
|
|
|
OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780
|
2013-09-25 12:30:35 +00:00
|
|
|
OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780
|
|
|
|
OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780
|
2014-01-05 14:20:41 +00:00
|
|
|
OPT_zenxfistyle=-DCREATIVE_ZENXFISTYLE -DIMX233_SUBTARGET=3780
|
2013-07-07 15:34:04 +00:00
|
|
|
|
|
|
|
BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS))
|
|
|
|
BOOTBINS=$(patsubst %, dualboot_%.arm-bin, $(TARGETS))
|
2013-09-26 18:14:09 +00:00
|
|
|
BOOTELFS=$(patsubst %, dualboot_%.arm-elf, $(TARGETS))
|
2011-11-06 19:44:03 +00:00
|
|
|
|
2013-09-26 18:14:09 +00:00
|
|
|
all: ../dualboot.h ../dualboot.c $(BOOTELFS)
|
2011-11-06 19:44:03 +00:00
|
|
|
|
|
|
|
# Dualboot bootloaders
|
|
|
|
|
2013-07-07 15:34:04 +00:00
|
|
|
dualboot_%.o: dualboot.c
|
2016-05-02 20:27:24 +00:00
|
|
|
$(PREFIX)$(CC) $(CFLAGS) $(OPT_$(@:dualboot_%.o=%)) -c -o $@ $^
|
2012-05-19 11:55:33 +00:00
|
|
|
|
2013-07-07 15:34:04 +00:00
|
|
|
dualboot_%.arm-elf: dualboot_%.o
|
2016-05-02 20:27:24 +00:00
|
|
|
$(PREFIX)$(LD) $(LDFLAGS) -Tdualboot.lds -o $@ $<
|
2012-05-19 11:55:33 +00:00
|
|
|
|
2011-11-06 19:44:03 +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
|
|
|
|
|
|
|
|
%.arm-bin: %.arm-elf
|
2016-05-02 20:27:24 +00:00
|
|
|
$(PREFIX)$(OC) -O binary $< $@
|
2011-11-06 19:44:03 +00:00
|
|
|
|
|
|
|
../dualboot.c ../dualboot.h: $(BOOTBINS) bin2c
|
|
|
|
./bin2c ../dualboot $(BOOTBINS)
|
|
|
|
|
|
|
|
bin2c: bin2c.c
|
|
|
|
$(CC) -o bin2c bin2c.c
|
|
|
|
|
|
|
|
clean:
|
2013-09-26 18:14:09 +00:00
|
|
|
rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS) $(BOOTELFS)
|