]> git.sur5r.net Git - c128-kasse/commitdiff
test: fix to be able to build a stub version of it again
authorMaik Fischer <maikf@qu.cx>
Sun, 29 Oct 2017 14:11:21 +0000 (15:11 +0100)
committerMaik Fischer <maikf@qu.cx>
Mon, 30 Oct 2017 10:11:55 +0000 (11:11 +0100)
.gitignore
Makefile
test/test.c

index ff2e07471b788965f7ea0c48ab733a20d60265b2..c5eb3a49595b962c123f54cb3b9bb6d065105828 100644 (file)
@@ -15,3 +15,4 @@ charmap
 ascii
 *.lbl
 TAGS
+test/test
index 47bb787121043e0134e0bd4c7379c1de71d871fb..8322b5cf033d7e6be343c7dfe423d9e598f30a7a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,13 @@ build/%.o: src/%.c ${INCLUDES}
 build/%.o: src/%.s
        ${AS} ${CFLAGS} $< -o $@
 
+build/%.o: test/%.c ${INCLUDES}
+       ${CC} ${CFLAGS} -O $< -o build/$(addsuffix .s,$(shell basename $< .c))
+       ${AS} ${CFLAGS} build/$(addsuffix .s,$(shell basename $< .c)) -o $@
+
+build/%.o: test/%.s
+       ${AS} ${CFLAGS} $< -o $@
+
 include/version.h:
        mkdir -p build
        echo "#define GV \"${GV}\"" > $@
@@ -45,17 +52,17 @@ package: all
        [ -e state ] && c1541 -attach kasse.d71 -write state || exit 0
        [ -e items ] && c1541 -attach kasse.d71 -write items || exit 0
 
-test: build/config.o test/test.o build/general.o
-       cl65 -t c128 $^ -o build/test
+test: build/config.o build/test.o build/general.o build/print.o build/globals.o
+       ${LD} -Ln $@.lbl -t c128 $^ -o test/$@
 
 test-package: test
        c1541 -format "test",TE d71 test.d71
-       c1541 -attach test.d71 -write test || exit 0
+       c1541 -attach test.d71 -write test/test || exit 0
        c1541 -attach test.d71 -write state || exit 0
        c1541 -attach test.d71 -write items || exit 0
 
 clean:
-       rm -rf build/*.o build/*.s test/*.o test/*.s
+       rm -rf build/*.o build/*.s test/test
 
 dist-clean: clean
        rm -f kasse kasse.lbl itemz itemz.lbl cat cat.lbl kasse.d71
index 9632181e3c5ac8d287a23d3121c709d339b1cf20..b4501a0110e8b9fb492fe2f31adc9c04c9d2f635 100644 (file)
@@ -8,7 +8,10 @@
 #include "kasse.h"
 #include "credit_manager.h"
 
+#warning "please fix me, load_state() isn't available anymore"
 int main() {
+  /* clang-format off */
+/*
   BYTE i = 0;
   char euro[10];
   load_items();
@@ -32,4 +35,6 @@ int main() {
   cprintf("strlen(%s)==%d\n", status.status[1].item_name,
           strlen(status.status[1].item_name));
   cprintf("%d %d %d\n", status.status[1].item_name[0], '\r', '\n');
+*/
+  return -1;
 }