Set optimization level only if not already overridden

This commit is contained in:
Elliot Saba 2016-08-08 17:24:07 -07:00
parent 0fa599cce8
commit 75ec57d90f

View file

@ -99,8 +99,10 @@ ifeq ($(ARCH),x86_64)
override ARCH := amd64
endif
# The optimization flag may be overriden with the environment variable CFLAGS.
CFLAGS ?= -O3
# If CFLAGS does not contain a -O optimization flag, default to -O3
ifeq ($(findstring -O,$(CFLAGS)),)
CFLAGS_add += -O3
endif
ifneq (,$(findstring MINGW,$(OS)))
override OS=WINNT