--- a/Makefile +++ b/Makefile @@ -1,9 +1,6 @@ C2IEC=c99 TESTS=$(patsubst %.c, %.test, $(wildcard test/*.c)) TEST_LOGS=$(patsubst %.c, %.test.log, $(wildcard test/*.c)) - -check: - echo ${TEST_LOGS} all: c99 @@ -23,15 +20,23 @@ for i in ${TEST_LOGS}; do \ cp $$i $$(dirname $$i)/$$(basename $$i .log).expected; \ done +clean: + rm -f ${C2IEC} + rm -f ${TEST_LOGS} .PHONY: test test: ${TESTS} %.test: %.test.log - diff $< $*.test.expected + @echo "========================================" + @echo "checking output of test $*" + @diff $< $*.test.expected %.test.log: %.test.txt - cat $< | tee $@ + @echo "========================================" + @echo "output of test $*" + @echo "========================================" + @cat $< | tee $@ %.test.txt: %.c ${C2IEC} ./${C2IEC} < $< > $@