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: 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 include/version.h: .git/index
30 echo "#define GV \"${GV}\"" > $@
32 include/charset_umlauts.h: assets/umlauts.pbm
33 ./util/mkfont assets/umlauts.pbm chars_umlauts > $@
35 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 build/bcd2dec.o
36 ${LD} -Ln $@.lbl -t c128 $^ -o $@
38 itemz: build/config.o build/itemz.o build/general.o build/credit_manager.o build/c128time.o build/print.o build/globals.o build/bcd2dec.o build/vdc_util.o
39 ${LD} -Ln $@.lbl -t c128 $^ -o $@
41 cat: build/general.o build/cat.o build/config.o build/print.o build/globals.o
42 ${LD} -Ln $@.lbl -t c128 $^ -o $@
44 charmap: build/print_charmap.o build/vdc_util.o build/vdc_patch_charset.o
45 ${LD} -Ln $@.lbl -t c128 $^ -o $@
47 ascii: build/print_ascii.o
48 ${LD} -Ln $@.lbl -t c128 $^ -o $@
51 c1541 -format "${GV}",KA d71 kasse.d71
52 c1541 -attach kasse.d71 -write kasse
53 c1541 -attach kasse.d71 -write itemz
54 [ -e state ] && c1541 -attach kasse.d71 -write state || exit 0
55 [ -e items ] && c1541 -attach kasse.d71 -write items || exit 0
57 test: build/config.o build/test.o build/general.o build/print.o build/globals.o
58 ${LD} -Ln $@.lbl -t c128 $^ -o test/$@
61 c1541 -format "test",TE d71 test.d71
62 c1541 -attach test.d71 -write test/test || exit 0
63 c1541 -attach test.d71 -write state || exit 0
64 c1541 -attach test.d71 -write items || exit 0
67 rm -rf build/*.o build/*.s test/test
70 rm -f kasse kasse.lbl itemz itemz.lbl cat cat.lbl kasse.d71
73 clang-format-3.9 -i **/*.[ch]
76 x128 -config vicerc -autostart kasse.d71 +go64 -80col