nds_test2

view Makefile @ 0:abcaf667f2bd

initial commit (3d + 2d)
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 28 Jan 2018 20:05:26 +0200
parents
children
line source
1 csrc = $(wildcard src/*.c)
2 ssrc = src/startup/arm9entry.s $(wildcard src/*.s)
3 Ssrc = $(wildcard src/startup/*.S) $(wildcard src/*.S)
4 obj = $(csrc:.c=.o) $(ssrc:.s=.o) $(Ssrc:.S=.o)
6 csrc-arm7 = $(wildcard src/arm7/*.c)
7 ssrc-arm7 = src/startup/arm7entry.s $(wildcard src/arm7/*.s)
8 obj-arm7 = $(csrc-arm7:.c=.o) $(ssrc-arm7:.s=.o)
10 name = test2
11 bin = $(name).nds
13 ARCH = arm-none-eabi-
14 CPP = $(ARCH)cpp
15 CC = $(ARCH)gcc
16 AS = $(ARCH)as
17 OBJCOPY = $(ARCH)objcopy
19 EMU = desmume-cli
21 opt = -O3 -fomit-frame-pointer -mcpu=arm946e-s -mtune=arm946e-s
22 dbg = -g
24 CFLAGS = -mthumb $(opt) $(dbg)
25 LDFLAGS = -nostartfiles -Wl,--gc-sections -lm
27 $(bin): arm9.elf arm7.elf data/icon.bmp
28 ndstool -c $@ -9 arm9.elf -7 arm7.elf -b data/icon.bmp "$(name);mindlapse"
30 arm9.elf: $(obj)
31 $(CC) -o $@ $(obj) -Wl,-T,ds_arm9.mem -Wl,-T,ds_arm9.ld $(LDFLAGS)
33 arm7.elf: $(obj-arm7)
34 $(CC) -o $@ $(obj-arm7) -Wl,-T,ds_arm7.ld $(LDFLAGS)
36 .PHONY: clean
37 clean:
38 rm -f $(obj) $(obj-arm7) $(bin) arm9.elf arm7.elf $(dep)
40 .PHONY: simrun
41 simrun: $(bin)
42 $(EMU) $(EMUFLAGS) $(bin)
44 data/icon.bmp: data/icon.bmp.base64
45 base64 -d $< >$@