aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-06 23:03:06 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-06 23:03:06 +0100
commit91312efb1490e899f8800c965865c8095f31f350 (patch)
tree39490ddee9bcdcfc43c5e88db23b220629059b01
parent7c36d8fa4898bed74fb70d28907964f302938506 (diff)
downloadtermgl-91312efb1490e899f8800c965865c8095f31f350.tar.gz
Updated makefile to be able to switch testprograms easily
-rw-r--r--Makefile9
1 files 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