4 INCLUDES:=$(wildcard include/*.h) include/version.h include/charset_umlauts.h
5 GV:=$(shell git describe --tags --always)
6 CFLAGS= -I include -t c128 -g
8 .PHONY: include/version.h include/charset_umlauts.h clean dist-clean format
12 build/%.o: src/%.c ${INCLUDES}
13 ${CC} ${CFLAGS} -O $< -o build/$(addsuffix .s,$(shell basename $< .c))
14 ${AS} ${CFLAGS} build/$(addsuffix .s,$(shell basename $< .c)) -o $@
17 ${AS} ${CFLAGS} $< -o $@
21 echo "#define GV \"${GV}\"" > $@
23 include/charset_umlauts.h:
24 ./util/mkfont assets/umlauts.pbm chars_umlauts > $@
26 kasse: build/config.o build/kasse.o build/general.o build/credit_manager.o build/c128time.o build/print.o build/vdc_patch_charset.o build/vdc_util.o
27 ${LD} -Ln $@.lbl -t c128 $^ -o $@
29 itemz: build/config.o build/itemz.o build/general.o build/credit_manager.o build/c128time.o build/print.o
30 ${LD} -Ln $@.lbl -t c128 $^ -o $@
32 cat: build/general.o build/cat.o
33 ${LD} -Ln $@.lbl -t c128 $^ -o $@
35 charmap: build/print_charmap.o build/vdc_util.o build/vdc_patch_charset.o
36 ${LD} -Ln $@.lbl -t c128 $^ -o $@
38 ascii: build/print_ascii.o
39 ${LD} -Ln $@.lbl -t c128 $^ -o $@
42 c1541 -format "${GV}",KA d64 kasse.d64
43 c1541 -attach kasse.d64 -write kasse
44 c1541 -attach kasse.d64 -write itemz
45 [ -e state ] && c1541 -attach kasse.d64 -write state || exit 0
46 [ -e items ] && c1541 -attach kasse.d64 -write items || exit 0
48 test: build/config.o test/test.o build/general.o
49 cl65 -t c128 $^ -o build/test
52 c1541 -format "test",TE d64 test.d64
53 c1541 -attach test.d64 -write test || exit 0
54 c1541 -attach test.d64 -write state || exit 0
55 c1541 -attach test.d64 -write items || exit 0
58 rm -rf build/*.o build/*.s test/*.o test/*.s
61 rm -f kasse kasse.lbl itemz itemz.lbl cat cat.lbl kasse.d64
64 clang-format-3.9 -i **/*.[ch]