aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '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