From 91312efb1490e899f8800c965865c8095f31f350 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Wed, 6 Mar 2019 23:03:06 +0100 Subject: Updated makefile to be able to switch testprograms easily --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7e739c9..c948060 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ LDFLAGS = SONAME = engine BUILDDIR = build SOURCEDIR = src +TESTSOURCE = test #VERSION VERSION = 0 PATCHLEVEL = 4 @@ -41,14 +42,14 @@ all: clean build .PHONY: clean clean: - rm -df $(OBJ) test.o src/version.h + rm -df $(OBJ) $(TESTSOURCE).o src/version.h rm -Rdf $(BUILDDIR)/lib $(BUILDDIR)/inc $(BUILDDIR)/test doc/ run: gentest ./$(BUILDDIR)/test/test memleak: gentest - valgrind "./$(BUILDDIR)/test/test" + valgrind -v --track-origins=yes "./$(BUILDDIR)/test/test" genversion: @echo Building Version @@ -62,9 +63,9 @@ genversion: @echo "#define BUILDER \"`git config user.name`\"" >> $(SOURCEDIR)/version.h @echo "#define BUILDERMAIL \"`git config user.email`\"" >> $(SOURCEDIR)/version.h -gentest: build test.o +gentest: build $(TESTSOURCE).o mkdir -p $(BUILDDIR)/test - $(CC) $(DEBUGFLAGS) -o $(BUILDDIR)/test/test test.o $(OBJ) $(LDFLAGS) + $(CC) $(DEBUGFLAGS) -o $(BUILDDIR)/test/test $(TESTSOURCE).o $(OBJ) $(LDFLAGS) test: gentest ./$(BUILDDIR)/test/test test -- cgit v1.2.3