nds_test2

annotate 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
rev   line source
nuclear@0 1 csrc = $(wildcard src/*.c)
nuclear@0 2 ssrc = src/startup/arm9entry.s $(wildcard src/*.s)
nuclear@0 3 Ssrc = $(wildcard src/startup/*.S) $(wildcard src/*.S)
nuclear@0 4 obj = $(csrc:.c=.o) $(ssrc:.s=.o) $(Ssrc:.S=.o)
nuclear@0 5
nuclear@0 6 csrc-arm7 = $(wildcard src/arm7/*.c)
nuclear@0 7 ssrc-arm7 = src/startup/arm7entry.s $(wildcard src/arm7/*.s)
nuclear@0 8 obj-arm7 = $(csrc-arm7:.c=.o) $(ssrc-arm7:.s=.o)
nuclear@0 9
nuclear@0 10 name = test2
nuclear@0 11 bin = $(name).nds
nuclear@0 12
nuclear@0 13 ARCH = arm-none-eabi-
nuclear@0 14 CPP = $(ARCH)cpp
nuclear@0 15 CC = $(ARCH)gcc
nuclear@0 16 AS = $(ARCH)as
nuclear@0 17 OBJCOPY = $(ARCH)objcopy
nuclear@0 18
nuclear@0 19 EMU = desmume-cli
nuclear@0 20
nuclear@0 21 opt = -O3 -fomit-frame-pointer -mcpu=arm946e-s -mtune=arm946e-s
nuclear@0 22 dbg = -g
nuclear@0 23
nuclear@0 24 CFLAGS = -mthumb $(opt) $(dbg)
nuclear@0 25 LDFLAGS = -nostartfiles -Wl,--gc-sections -lm
nuclear@0 26
nuclear@0 27 $(bin): arm9.elf arm7.elf data/icon.bmp
nuclear@0 28 ndstool -c $@ -9 arm9.elf -7 arm7.elf -b data/icon.bmp "$(name);mindlapse"
nuclear@0 29
nuclear@0 30 arm9.elf: $(obj)
nuclear@0 31 $(CC) -o $@ $(obj) -Wl,-T,ds_arm9.mem -Wl,-T,ds_arm9.ld $(LDFLAGS)
nuclear@0 32
nuclear@0 33 arm7.elf: $(obj-arm7)
nuclear@0 34 $(CC) -o $@ $(obj-arm7) -Wl,-T,ds_arm7.ld $(LDFLAGS)
nuclear@0 35
nuclear@0 36 .PHONY: clean
nuclear@0 37 clean:
nuclear@0 38 rm -f $(obj) $(obj-arm7) $(bin) arm9.elf arm7.elf $(dep)
nuclear@0 39
nuclear@0 40 .PHONY: simrun
nuclear@0 41 simrun: $(bin)
nuclear@0 42 $(EMU) $(EMUFLAGS) $(bin)
nuclear@0 43
nuclear@0 44 data/icon.bmp: data/icon.bmp.base64
nuclear@0 45 base64 -d $< >$@