Newer
Older
# This Makefile made available to his students by
# Prof. Ronald Moore
# https://fbi.h-da.de/personen/ronald-moore/
# mailto:ronald.moore@h-da.de
# with no warranties whatsoever
PROGS := interpreter
TESTFILES := testInput.txt testOutput.txt
# Uncomment only one of the next two lines (choose your c++ compiler)
# CC=g++
CC := clang++
## Add your own CFLAGS if you find them necessary... such as -O3 or so...
CFLAGS :=
## More preliminaries
# See https://www.gnu.org/software/make/manual/html_node/Special-Targets.html
# In this makefile, we want to keep going even if we find errors
.IGNORE :
# Tell make that the following "targets" are "phony"
# Cf. https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
## Now, the targets -- the things that will get made!
all: $(PROGS)
$(PROGS): %: %.cpp
$(CC) -g $< $(CFLAGS) -o $@
clean:
$(RM) -v *~ *.o $(PROGS) tmp.txt
test: $(PROGS) $(TESTFILES)
# "Running interpreter in test mode\n"
-./interpreter testInput.txt 2>&1 >tmp.txt
# "Checking output -- no news is good news!\n"
diff testOutput.txt tmp.txt
-rm tmp.txt