From: Teemu Hukkanen Date: Sat, 4 Oct 2014 09:01:46 +0000 (+0100) Subject: Rework CFLAGS & CXXFLAGS X-Git-Tag: 2.1.1~8 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=virtualjaguar;a=commitdiff_plain;h=8eaab6439da19d5a346eb9cc9ff2e0b19bd0f6c3 Rework CFLAGS & CXXFLAGS Allow overriding the optimisation level from the environment. Add CPPFLAGS, and always add -ffast-math and -fomit-frame-pointer. --- diff --git a/Makefile b/Makefile index edc1d20..4b30a78 100644 --- 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)"