]> git.sur5r.net Git - c128-kasse/blob - Makefile
makefile: use 'all' target by default
[c128-kasse] / Makefile
1 CC=cc65
2 AS=ca65
3 LD=cl65
4 INCLUDES:=$(wildcard include/*.h)
5 GV:=$(shell git describe --tags --always)
6
7 CFLAGS += -DGV=\"${GV}\"
8
9 %.o: %.c ${INCLUDES}
10         ${CC} ${CFLAGS} -O -I include -t c128 $< -o /dev/stdout | ${AS} -I include -t c128 /dev/stdin -o $@
11 all: kasse itemz
12
13 kasse: src/config.o src/kasse.o src/general.o src/credit_manager.o src/c128time.o src/print.o
14         ${LD} -t c128 $^ -o $@
15
16 itemz: src/config.o src/itemz.o src/general.o src/credit_manager.o src/c128time.o src/print.o
17         ${LD} -t c128 $^ -o $@
18
19 cat: src/general.o src/cat.o
20         ${LD} -t c128 $^ -o $@
21
22 package: all
23         cp images/kasse.d64 .
24         c1541 -attach kasse.d64 -delete state || exit 0 
25         c1541 -attach kasse.d64 -delete items || exit 0
26         c1541 -attach kasse.d64 -delete kasse || exit 0
27         c1541 -attach kasse.d64 -delete itemz || exit 0
28         c1541 -attach kasse.d64 -write kasse || exit 0
29         c1541 -attach kasse.d64 -write itemz || exit 0
30 #       c1541 -attach kasse.d64 -write state || exit 0 
31 #       c1541 -attach kasse.d64 -write items || exit 0
32
33 test: src/config.o test/test.o src/general.o
34         cl65 -t c128 src/config.o test/test.o src/general.o -o test
35
36 test-package: test
37         c1541 -attach test.d64 -delete state || exit 0 
38         c1541 -attach test.d64 -delete items || exit 0
39         c1541 -attach test.d64 -delete test || exit 0
40         c1541 -attach test.d64 -write test || exit 0
41         c1541 -attach test.d64 -write state || exit 0 
42         c1541 -attach test.d64 -write items || exit 0
43
44 clean:
45         rm -rf src/*.o src/*.s test/*.o test/*.s
46         
47 dist-clean: clean
48         rm kasse itemz kasse.d64