-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (40 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PROJECT=calculator
LD65_FLAGS=
CA65_FLAGS=
EMULATOR=/mnt/c/NESDev/Mesen.exe
VERSION := $(shell git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD)
TARGET=${PROJECT}.nes
.PHONY: debug run usage release FORCE
default: ${TARGET}
${TARGET}: src/header.o src/main.o src/reset.o src/irq.o src/nmi.o \
src/temps.o \
src/readjoy.o \
src/rand.o src/unrle.o src/vram-buffer.o \
src/graphics.o \
src/calculator.o \
src/math.o \
assets/metasprites.o
ld65 $^ -t nes -m map.txt -o ${TARGET} ${LD65_FLAGS}
debug: LD65_FLAGS += --dbgfile ${PROJECT}.dbg
debug: CA65_FLAGS += -g -DDEBUG=1
debug: ${TARGET}
src/graphics.o: src/graphics.s src/*.inc \
assets/*.pal \
assets/chr/*.chr \
assets/nametables/*.rle
ca65 $< ${CA65_FLAGS}
src/calculator.o: src/calculator.s src/*.inc \
assets/nametables/*.rle
ca65 $< ${CA65_FLAGS}
%.o: %.s src/*.inc
ca65 $< ${CA65_FLAGS}
clean:
rm src/*.o assets/*.o src/*/*.o *.nes *.dbg map.txt -f
run: debug
${EMULATOR} ${TARGET}
usage: tools/ld65-map.json
tools/ld65-map.json: map.txt tools/ld65-map.rb
ruby tools/ld65-map.rb map.txt 2 1 tools/ld65-map.json
release: ${TARGET}
cp ${TARGET} ${PROJECT}-${VERSION}.nes
FORCE: