nds_test2
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Makefile Sun Jan 28 20:05:26 2018 +0200 1.3 @@ -0,0 +1,45 @@ 1.4 +csrc = $(wildcard src/*.c) 1.5 +ssrc = src/startup/arm9entry.s $(wildcard src/*.s) 1.6 +Ssrc = $(wildcard src/startup/*.S) $(wildcard src/*.S) 1.7 +obj = $(csrc:.c=.o) $(ssrc:.s=.o) $(Ssrc:.S=.o) 1.8 + 1.9 +csrc-arm7 = $(wildcard src/arm7/*.c) 1.10 +ssrc-arm7 = src/startup/arm7entry.s $(wildcard src/arm7/*.s) 1.11 +obj-arm7 = $(csrc-arm7:.c=.o) $(ssrc-arm7:.s=.o) 1.12 + 1.13 +name = test2 1.14 +bin = $(name).nds 1.15 + 1.16 +ARCH = arm-none-eabi- 1.17 +CPP = $(ARCH)cpp 1.18 +CC = $(ARCH)gcc 1.19 +AS = $(ARCH)as 1.20 +OBJCOPY = $(ARCH)objcopy 1.21 + 1.22 +EMU = desmume-cli 1.23 + 1.24 +opt = -O3 -fomit-frame-pointer -mcpu=arm946e-s -mtune=arm946e-s 1.25 +dbg = -g 1.26 + 1.27 +CFLAGS = -mthumb $(opt) $(dbg) 1.28 +LDFLAGS = -nostartfiles -Wl,--gc-sections -lm 1.29 + 1.30 +$(bin): arm9.elf arm7.elf data/icon.bmp 1.31 + ndstool -c $@ -9 arm9.elf -7 arm7.elf -b data/icon.bmp "$(name);mindlapse" 1.32 + 1.33 +arm9.elf: $(obj) 1.34 + $(CC) -o $@ $(obj) -Wl,-T,ds_arm9.mem -Wl,-T,ds_arm9.ld $(LDFLAGS) 1.35 + 1.36 +arm7.elf: $(obj-arm7) 1.37 + $(CC) -o $@ $(obj-arm7) -Wl,-T,ds_arm7.ld $(LDFLAGS) 1.38 + 1.39 +.PHONY: clean 1.40 +clean: 1.41 + rm -f $(obj) $(obj-arm7) $(bin) arm9.elf arm7.elf $(dep) 1.42 + 1.43 +.PHONY: simrun 1.44 +simrun: $(bin) 1.45 + $(EMU) $(EMUFLAGS) $(bin) 1.46 + 1.47 +data/icon.bmp: data/icon.bmp.base64 1.48 + base64 -d $< >$@