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 $@
19 build/%.o: test/%.c ${INCLUDES}
20 ${CC} ${CFLAGS} -O $< -o build/$(addsuffix .s,$(shell basename $< .c))
21 ${AS} ${CFLAGS} build/$(addsuffix .s,$(shell basename $< .c)) -o $@
24 ${AS} ${CFLAGS} $< -o $@
28 echo "#define GV \"${GV}\"" > $@
30 include/charset_umlauts.h:
31 ./util/mkfont assets/umlauts.pbm chars_umlauts > $@
33 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 build/globals.o
34 ${LD} -Ln $@.lbl -t c128 $^ -o $@
36 itemz: build/config.o build/itemz.o build/general.o build/credit_manager.o build/c128time.o build/print.o build/globals.o
37 ${LD} -Ln $@.lbl -t c128 $^ -o $@
39 cat: build/general.o build/cat.o
40 ${LD} -Ln $@.lbl -t c128 $^ -o $@
42 charmap: build/print_charmap.o build/vdc_util.o build/vdc_patch_charset.o
43 ${LD} -Ln $@.lbl -t c128 $^ -o $@
45 ascii: build/print_ascii.o
46 ${LD} -Ln $@.lbl -t c128 $^ -o $@
49 c1541 -format "${GV}",KA d71 kasse.d71
50 c1541 -attach kasse.d71 -write kasse
51 c1541 -attach kasse.d71 -write itemz
52 [ -e state ] && c1541 -attach kasse.d71 -write state || exit 0
53 [ -e items ] && c1541 -attach kasse.d71 -write items || exit 0
55 test: build/config.o build/test.o build/general.o build/print.o build/globals.o
56 ${LD} -Ln $@.lbl -t c128 $^ -o test/$@
59 c1541 -format "test",TE d71 test.d71
60 c1541 -attach test.d71 -write test/test || exit 0
61 c1541 -attach test.d71 -write state || exit 0
62 c1541 -attach test.d71 -write items || exit 0
65 rm -rf build/*.o build/*.s test/test
68 rm -f kasse kasse.lbl itemz itemz.lbl cat cat.lbl kasse.d71
71 clang-format-3.9 -i **/*.[ch]