'make DEBUG=1' to build with debugging symbols
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Mon, 2 Jun 2008 15:20:35 +0000 (15:20 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Mon, 2 Jun 2008 15:20:35 +0000 (15:20 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@2209 78b8d119-cf0a-0410-b17c-f493084dd1d7

Makefile

index 173db63..24eae4a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,11 +16,24 @@ endif
 # Optional flags (CFLAGS, CPPFLAGS, ...)
 
 ifeq ($(ENABLE_WII),1)
-    # libwiimote is NOT ANSI compliant
-    CFLAGS := -O2
+    # libwiimote is NOT ANSI compliant (TODO, check if this is necessary.  GCC
+    # is supposed to suppress warnings from system headers.)
+
+    ifneq ($(DEBUG),1)
+        CFLAGS   := -g
+        CPPFLAGS :=
+    else
+        CFLAGS   := -O2
+        CPPFLAGS := -DNDEBUG
+    endif
 else
-    #CFLAGS := -Wall -g -ansi -pedantic
-    CFLAGS := -Wall -O2 -ansi -pedantic
+    ifeq ($(DEBUG),1)
+        CFLAGS   := -Wall -g -ansi -pedantic
+        CPPFLAGS :=
+    else
+        CFLAGS   := -Wall -O2 -ansi -pedantic
+        CPPFLAGS := -DNDEBUG
+    endif
 endif
 
 #------------------------------------------------------------------------------