From 1bcc24f34f180573bac22f8b2db8978ac52e6b45 Mon Sep 17 00:00:00 2001 From: Ian Piumarta Date: Tue, 6 Jul 2021 16:02:57 +0900 Subject: [PATCH] Makefile has target "test". Add reference output for test. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d649f29..b742c44 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,10 @@ MAIN = ccmeta all : $(MAIN) +test : all .FORCE + ./$(MAIN) < $(MAIN)-test.txt > $(MAIN)-test.out + diff $(MAIN)-test.ref $(MAIN)-test.out + $(MAIN) : $(MAIN).c object.c buffer.h $(CC) $(CFLAGS) -o $@ $@.c $(LDLIBS) @@ -15,7 +19,7 @@ $(MAIN) : $(MAIN).c object.c buffer.h mv $@.new $@ tidy : .FORCE - rm -f *~ + rm -f *~ $(MAIN)-test.out clean : .FORCE rm -f $(MAIN) $(MAIN).c