]> git.sur5r.net Git - c128-kasse/blobdiff - Makefile
calculate income when loading state file
[c128-kasse] / Makefile
index e9d2d8a2b0891e47caa7f23a66145aafd2faf246..b44b3597a3555f148c4baac201ce1de34ed07112 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,29 @@
-INCLUDES:=$(wildcard include/*.h)
+CC=cc65
+AS=ca65
+LD=cl65
+INCLUDES:=$(wildcard include/*.h) include/version.h
+GV:=$(shell git describe --tags --always)
+CFLAGS= -I include -t c128
 
-src/%.o: src/%.c ${INCLUDES}
-       cc65 -O -I include -t c128 $<
-       ca65 -I include -t c128 src/$$(basename $< .c).s
+.PHONY: include/version.h clean dist-clean
 
-test/%.o: test/%.c
-       cc65 -O -I include -t c128 $<
-       ca65 -I include -t c128 test/$$(basename $< .c).s
+all: kasse itemz
 
-kasse: src/config.o src/kasse.o src/general.o src/credit_manager.o src/c128time.o
-       cl65 -t c128 src/c128time.o src/config.o src/kasse.o src/general.o src/credit_manager.o -o kasse
+%.o: %.c ${INCLUDES}
+       ${CC} ${CFLAGS} -O $<
+       ${AS} ${CFLAGS} $(addsuffix .s,$(basename $< ))
 
-itemz: src/config.o src/itemz.o src/general.o src/credit_manager.o
-       cl65 -t c128 src/config.o src/itemz.o src/general.o src/credit_manager.o -o itemz
+include/version.h:
+       echo "#define GV \"${GV}\"" > $@
 
-cat: src/general.o src/cat.o
-       cl65 -t c128 src/general.o src/cat.o -o cat
+kasse: src/config.o src/kasse.o src/general.o src/credit_manager.o src/c128time.o src/print.o
+       ${LD} -t c128 $^ -o $@
 
-all: kasse itemz
+itemz: src/config.o src/itemz.o src/general.o src/credit_manager.o src/c128time.o src/print.o
+       ${LD} -t c128 $^ -o $@
+
+cat: src/general.o src/cat.o
+       ${LD} -t c128 $^ -o $@
 
 package: all
        cp images/kasse.d64 .
@@ -43,6 +49,6 @@ test-package: test
 
 clean:
        rm -rf src/*.o src/*.s test/*.o test/*.s
-       
+
 dist-clean: clean
        rm kasse itemz kasse.d64