diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2021-12-15 21:04:28 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2021-12-24 18:05:53 +0100 |
commit | c876d3bbefe0dc00c27ca0c12d29da5874946962 (patch) | |
tree | 69f468a185a369b01998314bc3ecc19b70f4fcaa /utils/mkzenboot/dualboot/Makefile | |
parent | 6c6f0757d7a902feb293be165d1490c42bc8e7ad (diff) | |
download | rockbox-c876d3bbefe0dc00c27ca0c12d29da5874946962.tar.gz rockbox-c876d3bbefe0dc00c27ca0c12d29da5874946962.zip |
rbutil: Merge rbutil with utils folder.
rbutil uses several components from the utils folder, and can be
considered part of utils too. Having it in a separate folder is an
arbitrary split that doesn't help anymore these days, so merge them.
This also allows other utils to easily use libtools.make without the
need to navigate to a different folder.
Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21
Diffstat (limited to 'utils/mkzenboot/dualboot/Makefile')
-rw-r--r-- | utils/mkzenboot/dualboot/Makefile | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/utils/mkzenboot/dualboot/Makefile b/utils/mkzenboot/dualboot/Makefile new file mode 100644 index 0000000000..752cc3ca28 --- /dev/null +++ b/utils/mkzenboot/dualboot/Makefile | |||
@@ -0,0 +1,51 @@ | |||
1 | CC=gcc | ||
2 | LD=ld | ||
3 | OC=objcopy | ||
4 | CROSS_PREFIX=arm-elf-eabi- | ||
5 | REGS_PATH=../../../firmware/target/arm/imx233/regs | ||
6 | CFLAGS=-mcpu=arm926ej-s -std=gnu99 -I. -I$(REGS_PATH) -nostdlib -ffreestanding -fomit-frame-pointer -O | ||
7 | LDFLAGS= | ||
8 | # Edit the following variables when adding a new target. | ||
9 | # mkimxboot.c also needs to be edited to refer to these | ||
10 | # To add a new target x you need to: | ||
11 | # 1) add x to the list in TARGETS | ||
12 | # 2) create a variable named OPT_x of the form: | ||
13 | # OPT_x=target specific defines | ||
14 | TARGETS=zenmozaic zenxfi zen zenv | ||
15 | OPT_zenmozaic=-DCREATIVE_ZENMOZAIC -DIMX233_SUBTARGET=3700 | ||
16 | OPT_zenxfi=-DCREATIVE_ZENXFI -DIMX233_SUBTARGET=3700 | ||
17 | OPT_zen=-DCREATIVE_ZEN -DIMX233_SUBTARGET=3700 | ||
18 | OPT_zenv=-DCREATIVE_ZENV -DIMX233_SUBTARGET=3600 | ||
19 | |||
20 | BOOTLDS=$(patsubst %, dualboot_%.lds, $(TARGETS)) | ||
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 | $(CROSS_PREFIX)$(CC) $(CFLAGS) $(OPT_$(@:dualboot_%.o=%)) -c -o $@ $^ | ||
31 | |||
32 | dualboot_%.lds: dualboot.lds | ||
33 | $(CROSS_PREFIX)$(CC) $(CFLAGS) $(OPT_$(@:dualboot_%.lds=%)) -E -x c - < $< | sed '/#/d' > $@ | ||
34 | |||
35 | dualboot_%.arm-elf: dualboot_%.o dualboot_%.lds | ||
36 | $(CROSS_PREFIX)$(LD) $(LDFLAGS) -T$(@:dualboot_%.arm-elf=dualboot_%.lds) -o $@ $< | ||
37 | |||
38 | # Rules for the ARM code embedded in mkamsboot - assemble, link, then extract | ||
39 | # the binary code and finally convert to .h for building in mkamsboot | ||
40 | |||
41 | %.arm-bin: %.arm-elf | ||
42 | $(CROSS_PREFIX)$(OC) -O binary $< $@ | ||
43 | |||
44 | ../dualboot.c ../dualboot.h: $(BOOTBINS) bin2c | ||
45 | ./bin2c ../dualboot $(BOOTBINS) | ||
46 | |||
47 | bin2c: bin2c.c | ||
48 | $(CC) -o bin2c bin2c.c | ||
49 | |||
50 | clean: | ||
51 | rm -f *~ bin2c $(BOOTBINS) $(BOOTOBJS) $(BOOTELFS) $(BOOTLDS) | ||