summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-19 16:31:47 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-19 16:31:47 +0000
commit1824ae8d9d3e8c6117a055164d6bc2073a46f918 (patch)
treef075f84c08be62eb85ef8342a2d80089e8e204c2 /make
parentc2ec183ffe0fd0db4fe3c06874a888f84738f49c (diff)
Disable -O2 when compiling with full debug, allow make D=2 to enable debug+optimize
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12498 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make')
-rw-r--r--make/template/main.mk23
1 files changed, 13 insertions, 10 deletions
diff --git a/make/template/main.mk b/make/template/main.mk
index 9852f8919..d9b57a17b 100644
--- a/make/template/main.mk
+++ b/make/template/main.mk
@@ -51,20 +51,23 @@ INSTMODE_LIB = 0644
CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include
@ENDIF
-@IFDEF D
- CXXFLAGS += -g3 -Werror
- HEADER = debug-header
-@ELSE
- CXXFLAGS += -g1
- HEADER = std-header
+@IFNDEF D
+ D=0
@ENDIF
-FOOTER = finishmessage
-@IFDEF QUICK
- CXXFLAGS += -O0
+@IFEQ $(D) 0
+ CXXFLAGS += -O2 -g1
+ HEADER = std-header
+@ELSIFEQ $(D) 1
+ CXXFLAGS += -O0 -g3 -Werror
+ HEADER = debug-header
+@ELSIFEQ $(D) 2
+ CXXFLAGS += -O2 -g3
+ HEADER = debug-header
@ELSE
- CXXFLAGS += -O2
+ HEADER = unknown-debug-level
@ENDIF
+FOOTER = finishmessage
CXXFLAGS += -Iinclude