]> Shamusworld >> Repos - virtualjaguar/commitdiff
Rework CFLAGS & CXXFLAGS
authorTeemu Hukkanen <tjhukkan@iki.fi>
Sat, 4 Oct 2014 09:01:46 +0000 (10:01 +0100)
committerTeemu Hukkanen <tjhukkan@iki.fi>
Mon, 6 Oct 2014 12:59:05 +0000 (13:59 +0100)
Allow overriding the optimisation level from the environment.
Add CPPFLAGS, and always add -ffast-math and -fomit-frame-pointer.

Makefile

index edc1d20c7e035efa03b8b33546cd9912fd39b65d..4b30a7890df1e346f2d81efdc814b5d1fefc6631 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,12 +17,17 @@ ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin"
 QMAKE_EXTRA := -spec macx-g++
 endif
 
-# (This will only assign if the var doesn't exist already. Without these flags,
-# Virtual Jaguar will run very slow.)
-CFLAGS ?= -O2 -ffast-math -fomit-frame-pointer
-CPPFLAGS ?= -O2 -ffast-math -fomit-frame-pointer
-CXXFLAGS ?= -O2 -ffast-math -fomit-frame-pointer
-LDFLAGS ?= 
+# Set basic flags, these can be overridden from the environment
+CFLAGS = -O2
+CXXFLAGS = -O2
+
+# Add CPPFLAGS
+CFLAGS += $(CPPFLAGS)
+CXXFLAGS += $(CPPFLAGS)
+
+# Without these flags, Virtual Jaguar will run very slow.
+CFLAGS += -ffast-math -fomit-frame-pointer
+CXXFLAGS += -ffast-math -fomit-frame-pointer
 
 # Flags to pass on to qmake...
 QMAKE_EXTRA += "QMAKE_CFLAGS_RELEASE=$(CFLAGS)"