Makefile: move dialect/warning flags to mandatory CFLAGS
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 1 Nov 2008 18:11:51 +0000 (18:11 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 1 Nov 2008 18:11:51 +0000 (18:11 +0000)
When specifying CFLAGS directly on the command-line, I usually want
-Wall -ansi -pedantic to remain in effect.  With this change I just
don't have to specify them manually every time.

git-svn-id: https://s.snth.net/svn/neverball/trunk@2589 78b8d119-cf0a-0410-b17c-f493084dd1d7

Makefile

index ac41f83..c995d91 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,25 +15,12 @@ endif
 #------------------------------------------------------------------------------
 # Optional flags (CFLAGS, CPPFLAGS, ...)
 
-ifeq ($(ENABLE_WII),1)
-    # 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
+ifeq ($(DEBUG),1)
+    CFLAGS   := -g
+    CPPFLAGS :=
 else
-    ifeq ($(DEBUG),1)
-        CFLAGS   := -Wall -g -ansi -pedantic
-        CPPFLAGS :=
-    else
-        CFLAGS   := -Wall -O2 -ansi -pedantic
-        CPPFLAGS := -DNDEBUG
-    endif
+    CFLAGS   := -O2
+    CPPFLAGS := -DNDEBUG
 endif
 
 #------------------------------------------------------------------------------
@@ -43,7 +30,13 @@ endif
 
 SSE_CFLAGS := $(shell env CC="$(CC)" sh scripts/get-sse-cflags.sh)
 
-ALL_CFLAGS := $(SSE_CFLAGS) $(CFLAGS)
+ifeq ($(ENABLE_WII),1)
+    # libwiimote is NOT ANSI compliant (TODO, check if this is necessary.  GCC
+    # is supposed to suppress warnings from system headers.)
+    ALL_CFLAGS := $(SSE_CFLAGS) $(CFLAGS)
+else
+    ALL_CFLAGS := -Wall -ansi -pedantic $(SSE_FLAGS) $(CFLAGS)
+endif
 
 # Preprocessor...