aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-01-05 23:54:01 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-05 23:54:01 +0100
commit201a024b67c44477225a94c6e0ce99df5c8c8134 (patch)
treed87ad283684bb7c9f44617811ad94e3c2b140d01
parent2e94b4a011133d350e8ebe02c954a36fc40b9ae7 (diff)
loader: Add missing Makefile
-rw-r--r--loader/Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/loader/Makefile b/loader/Makefile
new file mode 100644
index 0000000..c627df7
--- /dev/null
+++ b/loader/Makefile
@@ -0,0 +1,36 @@
+CC=arm-elf-gcc
+LD=arm-elf-ld
+AR=arm-elf-ar
+AS=arm-elf-as
+OBJCOPY=arm-elf-objcopy
+OBJDUMP=arm-elf-objdump
+
+CFLAGS=-nostartfiles -nostdlib -nodefaultlibs -g -O2
+LDFLAGS=-Tloader.lds
+
+all: loader128.bin loader256.bin
+
+headers: loader128.bin loader256.bin
+ gcc -o bin2c bin2c.c
+ ./bin2c loader128_data < loader128.bin > ../loader128_data.h
+ ./bin2c loader256_data < loader256.bin > ../loader256_data.h
+
+loader128.elf: crt0.o loader128.o
+ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^
+
+loader256.elf: crt0.o loader256.o
+ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^
+
+
+loader128.o: loader.c
+ ${CC} ${CFLAGS} -DPAGE_SIZE=128 -c -o $@ $^
+
+loader256.o: loader.c
+ ${CC} ${CFLAGS} -DPAGE_SIZE=256 -c -o $@ $^
+
+%.bin: %.elf
+ ${OBJCOPY} -O binary $^ $@
+
+clean:
+ rm -f loader128.o loader256.o loader128.elf loader256.elf \
+ loader128.bin loader256.bin crt0.o bin2c bin2c.exe \ No newline at end of file