From 75ec57d90f4b8169c5bcb9666b5bae38800b03ca Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 8 Aug 2016 17:24:07 -0700 Subject: [PATCH] Set optimization level only if not already overridden --- Make.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Make.inc b/Make.inc index cca2ca7..e4c50b2 100644 --- a/Make.inc +++ b/Make.inc @@ -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