This change was done due to general recommendations and because of
some versions of gcc emitting lots of misleading warnings with "-O3"
related to pointers possibly being null in cases where they surely
cannot be null ("warning: argument 1 null where non-null expected"
for "strcmp(s1, s2)" in src/libgame/misc.c after explicitly checking
that s1 is not null), which makes it harder to recognize "real"
warnings when building the distribution packages.
DEBUG = -DDEBUG -g
OPTIONS = $(DEBUG) -Wall # only for debugging purposes
DEBUG = -DDEBUG -g
OPTIONS = $(DEBUG) -Wall # only for debugging purposes
-# OPTIONS = -O3 -Wall # distribution build
+# OPTIONS = -O2 -Wall # distribution build
# LOCAL_CFLAGS := -DTARGET_SDL2
LOCAL_CFLAGS := -DTARGET_SDL2 $(OPTIONS)
# LOCAL_CFLAGS := -DTARGET_SDL2
LOCAL_CFLAGS := -DTARGET_SDL2 $(OPTIONS)
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
-# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes
+# OPTIONS = $(DEBUG) -O2 -Wall # only for debugging purposes
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes
# OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes
# OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes
-# OPTIONS = -O3 -Wall -ansi -pedantic
-# OPTIONS = -O3 -Wall
-# OPTIONS = -O3
+# OPTIONS = -O2 -Wall -ansi -pedantic
+# OPTIONS = -O2 -Wall
+# OPTIONS = -O2
ifdef BUILD_DIST # distribution build
SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) | \
sed -e "s%-rpath,[^ ]*%-rpath,'\$$ORIGIN/lib'%")
ifdef BUILD_DIST # distribution build
SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) | \
sed -e "s%-rpath,[^ ]*%-rpath,'\$$ORIGIN/lib'%")
endif
CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(EXTRA_CFLAGS) $(CONFIG)
endif
CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(EXTRA_CFLAGS) $(CONFIG)