mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Make the base CFLAGS overridable.
This was requested several times, the last time in pull request #523. Only the optimization level, warning level and debug stuff may be overridden. All other options are enforces because they're required. While here add a new variable to force a debug build: `make DEBUG=1`.
This commit is contained in:
parent
466e689695
commit
09aad64202
1 changed files with 25 additions and 26 deletions
51
Makefile
51
Makefile
|
@ -111,33 +111,32 @@ endif
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
# Base CFLAGS.
|
# Base CFLAGS. These may be overridden by the environment.
|
||||||
#
|
# Highest supported optimizations are -O2, higher levels
|
||||||
# -O2 are enough optimizations.
|
# will likely break this crappy code.
|
||||||
#
|
ifdef DEBUG
|
||||||
# -fno-strict-aliasing since the source doesn't comply
|
CFLAGS ?= -O0 -g -Wall -pipe
|
||||||
# with strict aliasing rules and it's next to impossible
|
|
||||||
# to get it there...
|
|
||||||
#
|
|
||||||
# -fomit-frame-pointer since the framepointer is mostly
|
|
||||||
# useless for debugging Quake II and slows things down.
|
|
||||||
#
|
|
||||||
# -g to build always with debug symbols. Please DO NOT
|
|
||||||
# CHANGE THIS, since it's our only chance to debug this
|
|
||||||
# crap when random crashes happen!
|
|
||||||
#
|
|
||||||
# -MMD to generate header dependencies. (They cannot be
|
|
||||||
# generated if building universal binaries on OSX)
|
|
||||||
#
|
|
||||||
# -fwrapv for defined integer wrapping. MSVC6 did this
|
|
||||||
# and the game code requires it.
|
|
||||||
ifeq ($(YQ2_OSTYPE), Darwin)
|
|
||||||
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
|
|
||||||
-Wall -pipe -g -fwrapv
|
|
||||||
CFLAGS += $(OSX_ARCH)
|
|
||||||
else
|
else
|
||||||
CFLAGS := -std=gnu99 -O2 -fno-strict-aliasing \
|
CFLAGS ?= -O2 -Wall -pipe -fomit-frame-pointer
|
||||||
-Wall -pipe -g -ggdb -MMD -fwrapv
|
endif
|
||||||
|
|
||||||
|
# Always needed are:
|
||||||
|
# -fno-strict-aliasing since the source doesn't comply
|
||||||
|
# with strict aliasing rules and it's next to impossible
|
||||||
|
# to get it there...
|
||||||
|
# -fwrapv for defined integer wrapping. MSVC6 did this
|
||||||
|
# and the game code requires it.
|
||||||
|
CFLAGS += -std=gnu99 -fno-strict-aliasing -fwrapv
|
||||||
|
|
||||||
|
# -MMD to generate header dependencies. Unsupported by
|
||||||
|
# the Clang shipped with OS X.
|
||||||
|
ifneq ($(YQ2_OSTYPE), Darwin)
|
||||||
|
CFLAGS += -MMD
|
||||||
|
endif
|
||||||
|
|
||||||
|
# OS X architecture.
|
||||||
|
ifeq ($(YQ2_OSTYPE), Darwin)
|
||||||
|
CFLAGS += $(OSX_ARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
|
|
Loading…
Reference in a new issue