]> git.sur5r.net Git - c128-kasse/commitdiff
Restructure Makefile and create include/version.h
authorJakob Haufe <sur5r@sur5r.net>
Tue, 6 Nov 2012 00:01:42 +0000 (01:01 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 6 Nov 2012 18:16:58 +0000 (19:16 +0100)
Introduce include/version.h to contain the current version string. This
removes the need to use /dev/std{in,out} in the Makefile and will create
more useful error messages.

.gitignore
Makefile
src/credit_manager.c
src/itemz.c
src/kasse.c

index e4d5374381d940a102fada054140e5dbb8a08313..43f873b25807f753ac75be1ac2e5e5c04c7fc946 100644 (file)
@@ -6,3 +6,4 @@ kasse
 *.P00
 itemz
 *.d64
+include/version.h
index cea7061a8957f87db5a4572b3c59419317a0a6dd..b44b3597a3555f148c4baac201ce1de34ed07112 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,21 @@
 CC=cc65
 AS=ca65
 LD=cl65
-INCLUDES:=$(wildcard include/*.h)
+INCLUDES:=$(wildcard include/*.h) include/version.h
 GV:=$(shell git describe --tags --always)
+CFLAGS= -I include -t c128
 
-CFLAGS += -DGV=\"${GV}\"
+.PHONY: include/version.h clean dist-clean
 
-%.o: %.c ${INCLUDES}
-       ${CC} ${CFLAGS} -O -I include -t c128 $< -o /dev/stdout | ${AS} -I include -t c128 /dev/stdin -o $@
 all: kasse itemz
 
+%.o: %.c ${INCLUDES}
+       ${CC} ${CFLAGS} -O $<
+       ${AS} ${CFLAGS} $(addsuffix .s,$(basename $< ))
+
+include/version.h:
+       echo "#define GV \"${GV}\"" > $@
+
 kasse: src/config.o src/kasse.o src/general.o src/credit_manager.o src/c128time.o src/print.o
        ${LD} -t c128 $^ -o $@
 
@@ -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
index a76c128c69ad17d7c95571ea974647636a912107..670926dad7f713fd148264f0cf28d652f9009d8b 100644 (file)
@@ -14,6 +14,7 @@
 #include "kasse.h"
 #include "c128time.h"
 #include "print.h"
+#include "version.h"
 
 static char *filter = NULL;
 static BYTE filter_len;
index 0b43fa8fb8ecb5540ea0673353cdc367c12949bb..609c76df96c03c49268bd751c6422329f24beebf 100644 (file)
@@ -15,6 +15,7 @@
 #include "general.h"
 #include "config.h"
 #include "credit_manager.h"
+#include "version.h"
 
 static void itemz_print_screen() {
        BYTE i;
index 7e652e0814c209072d90ac42102762e6e81a3622..895c2e6147832c8b02916b664899811f914f151d 100644 (file)
@@ -17,6 +17,7 @@
 #include "credit_manager.h"
 #include "c128time.h"
 #include "print.h"
+#include "version.h"
 // drucker 4 oder 5
 // graphic 4,0,10