From ceda679fd93cb7aac38ec04c8abf2b05f480e344 Mon Sep 17 00:00:00 2001 From: Maik Fischer Date: Sun, 29 Oct 2017 15:11:21 +0100 Subject: [PATCH] test: fix to be able to build a stub version of it again --- .gitignore | 1 + Makefile | 15 +++++++++++---- test/test.c | 5 +++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ff2e074..c5eb3a4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ charmap ascii *.lbl TAGS +test/test diff --git a/Makefile b/Makefile index 47bb787..8322b5c 100644 --- 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 diff --git a/test/test.c b/test/test.c index 9632181..b4501a0 100644 --- a/test/test.c +++ b/test/test.c @@ -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; } -- 2.39.5