aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-05-22 21:12:45 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-05-22 21:12:45 +0200
commit675e8972384e808f2b622922df5e8deef418e165 (patch)
tree236f917e7f5578aff39049f02ad1cf85a477d7db
parent648a47211578617d228c22fac44b1ccc1f8f521d (diff)
Debug branch in Makefile
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index acef217..35ec6a2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,9 @@
-CXXFLAGS = -Wall -O2 -std=c++11
+CXXFLAGS_BASE = -Wall -std=c++11
+ifdef DEBUG
+ CXXFLAGS = $(CXXFLAGS_BASE) -g
+else
+ CXXFLAGS = $(CXXFLAGS_BASE) -O2
+endif
CXX = g++
BINARIES = engine
@@ -17,7 +22,9 @@ remake: clean all
engine: $(OBJ_FILES)
$(CXX) $(CXXFLAGS) -o $@ $(OBJ_FILES)
+ifndef DEBUG
strip $@
+endif
%.o: %.cpp %.h
$(CXX) $(CXXFLAGS) -c -o $*.o $*.cpp