summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-07 15:17:15 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-07 15:17:15 +0100
commit7fdf648555febd21456d6e3baf4b06f131d9ec04 (patch)
tree6f1933489e7628403a23783aa70e43110bb0e0ea
parent5df6297ce9ff7ceffe0cd44cd4f05411376deaf8 (diff)
downloadtermgl-7fdf648555febd21456d6e3baf4b06f131d9ec04.tar.gz
Makfefile fixes
moved -shared to LDFLAGS, added doc to .PHONY, cleaning
-rw-r--r--Makefile24
1 files changed, 12 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 6b4aed4..8f90431 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
CC = clang
-CFLAGS = -Wall -g -std=c++11 -shared -fPIC
+CFLAGS = -Wall -g -std=c++11 -fPIC
DEBUGFLAGS = -Wall -g -std=c++11
-LDFLAGS =
+LDFLAGS = -shared
SONAME = engine
BUILDDIR = build
SOURCEDIR = src
@@ -17,8 +17,8 @@ build: dir genversion $(OBJ)
$(CC) $(CFLAGS) -o $(BUILDDIR)/lib/$(OUTPUT) $(OBJ) $(LDFLAGS) -Wl,-soname=lib$(SONAME).so.$(VERSION)
ln -sf $(OUTPUT) $(BUILDDIR)/lib/lib$(SONAME).so.$(VERSION)
ln -sf $(OUTPUT) $(BUILDDIR)/lib/lib$(SONAME).so
- cp src/c*.h $(BUILDDIR)/inc
- cp src/version.h $(BUILDDIR)/inc
+ cp $(SOURCEDIR)/c*.h $(BUILDDIR)/inc
+ cp $(SOURCEDIR)/version.h $(BUILDDIR)/inc
dir:
mkdir -p $(BUILDDIR)
@@ -39,18 +39,12 @@ dir:
all: clean build
-.PHONY: clean
+.PHONY: clean doc
clean:
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 -v --track-origins=yes "./$(BUILDDIR)/test/test"
-
genversion:
@echo Building Version
@echo "//Generated by MAKEFILE. DO NOT Edit." > $(SOURCEDIR)/version.h
@@ -65,7 +59,13 @@ genversion:
gentest: build $(TESTSOURCE).o
mkdir -p $(BUILDDIR)/test
- $(CC) $(DEBUGFLAGS) -o $(BUILDDIR)/test/test $(TESTSOURCE).o $(OBJ) $(LDFLAGS)
+ $(CC) $(DEBUGFLAGS) -o $(BUILDDIR)/test/test $(TESTSOURCE).o $(OBJ) -lstdc++ -lm
+
+run: gentest
+ ./$(BUILDDIR)/test/test
+
+memleak: gentest
+ valgrind -v --track-origins=yes "./$(BUILDDIR)/test/test"
doc:
mkdir -p doc