summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-01-12 09:21:10 +0000
committerEric Andersen <andersen@codepoet.org>2001-01-12 09:21:10 +0000
commit163df9f27d764392b3a718ddd51a693f3fc874e4 (patch)
tree8717e90c8e470365df09ece4e1376c5e9f7cccb9
parentdee92a2d222d0ebe49a9ddf8c409cbc2431c945b (diff)
Makefile cleanups. For starters, OPTIMIZATION was missing...
-rw-r--r--Makefile4
-rw-r--r--Rules.mak26
2 files changed, 15 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index d490a9f1f..5d88e1ad6 100644
--- a/Makefile
+++ b/Makefile
@@ -43,10 +43,10 @@ halfclean:
headers: dummy
@rm -f include/asm include/net include/linux include/bits
- @ln -s $(KERNEL_SOURCE)/include/asm-$(ARCH_DIR) include/asm
+ @ln -s $(KERNEL_SOURCE)/include/asm include/asm
@if [ ! -f include/asm/unistd.h ] ; then \
echo " "; \
- echo "The path '$(KERNEL_SOURCE)/include/asm-$(ARCH_DIR)' doesn't exist."; \
+ echo "The path '$(KERNEL_SOURCE)/include/asm' doesn't exist."; \
echo "I bet you didn't set KERNEL_SOURCE, TARGET_ARCH or HAS_MMU in \`Config'"; \
echo "correctly. Please edit \`Config' and fix these settings."; \
echo " "; \
diff --git a/Rules.mak b/Rules.mak
index ab41e57c4..901976e07 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -26,13 +26,14 @@ include $(TOPDIR)Config
GCCINCDIR = $(shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+# use '-Os' optimization if available, else use -O2
+OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
+ then echo "-Os"; else echo "-O2" ; fi)
+
ARFLAGS=r
-CCFLAGS=$(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -Dlinux -D__linux__ -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D__LIBC__
-ifeq ($(TARGET_ARCH), arm)
- ARCH_CFLAGS=-fpic
-endif
+CCFLAGS=$(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -Dlinux -D__linux__ -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D__LIBC__
CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS)
@@ -51,9 +52,6 @@ endif
ifneq ($(HAS_MMU),true)
CFLAGS += -D__HAS_NO_MMU__
- ARCH_DIR = $(shell echo $(TARGET_ARCH)nommu)
-else
- ARCH_DIR = $(TARGET_ARCH)
endif
ifneq ($(HAS_FLOATS),true)
@@ -61,14 +59,16 @@ ifneq ($(HAS_FLOATS),true)
endif
-
+# It turns out the currently, function-sections causes ldelf2flt to segfault.
+# So till further notice, this is disabled by default....
+#
# Use '-ffunction-sections -fdata-sections' and '--gc-sections' if they work
# to try and strip out any unused junk automagically....
#
-ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
- -o /dev/null -xc /dev/null && $(LD) --gc-sections -v >/dev/null && echo 1),1)
- CFLAGS += -ffunction-sections -fdata-sections
- LDFLAGS += --gc-sections
-endif
+#ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
+# -o /dev/null -xc /dev/null && $(LD) --gc-sections -v >/dev/null && echo 1),1)
+# CFLAGS += -ffunction-sections -fdata-sections
+# LDFLAGS += --gc-sections
+#endif