summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McCullough <davidm@snapgear.com>2001-01-29 14:58:05 +0000
committerDavid McCullough <davidm@snapgear.com>2001-01-29 14:58:05 +0000
commit5a2610fbeb4667ffac25551f5484b629707b996e (patch)
treecefb2fa8551b02e915d4357b04c981f9f806e96f
parent25b20c514618c2df1c67fc8defabb220471a5ed0 (diff)
Allow Config to override OPTIMIZATION flags.
-rw-r--r--Rules.mak6
1 files changed, 4 insertions, 2 deletions
diff --git a/Rules.mak b/Rules.mak
index 8c362f5f8..8080007f9 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -26,16 +26,18 @@ include $(TOPDIR)Config
GCCINCDIR = $(shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
-# use '-Os' optimization if available, else use -O2
+# use '-Os' optimization if available, else use -O2, allow Config to override
+ifndef OPTIMIZATION
OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
then echo "-Os"; else echo "-O2" ; fi)
+endif
ARFLAGS=r
CCFLAGS=$(WARNINGS) $(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -Dlinux -D__linux__ -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D__LIBC__
-CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS)
+CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS) $(ARCH_CFLAGS2)
ifeq ($(DODEBUG),true)
CFLAGS += -g