aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-05-12 19:38:40 +0000
committerErik Andersen <andersen@codepoet.org>2000-05-12 19:38:40 +0000
commit3d427ac5efd249dc25dd03deb30520335f68911a (patch)
treeb77ecc357ad981263f5c737c7aef4a32b345635c
parent59b9e870243c56a9c5ec045a925e4e9b3f1f6c3c (diff)
downloadbusybox-w32-3d427ac5efd249dc25dd03deb30520335f68911a.tar.gz
busybox-w32-3d427ac5efd249dc25dd03deb30520335f68911a.tar.bz2
busybox-w32-3d427ac5efd249dc25dd03deb30520335f68911a.zip
Some experimental stuff (work in progress). heheh.
-Erik
-rw-r--r--Makefile38
1 files changed, 10 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index d7b1a9bdb..1ea5368d0 100644
--- a/Makefile
+++ b/Makefile
@@ -31,37 +31,12 @@ DODEBUG = true
31# If you want a static binary, turn this on. 31# If you want a static binary, turn this on.
32DOSTATIC = false 32DOSTATIC = false
33 33
34# Figure out what arch we are on (not used at the moment)
35ARCH := $(shell uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/')
36
37
38CC = gcc 34CC = gcc
39 35
40GCCMAJVERSION = $(shell $(CC) --version | cut -f1 -d'.') 36# use '-Os' optimization if available, else use -O2
41GCCMINVERSION = $(shell $(CC) --version | cut -f2 -d'.') 37OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
42 38 then echo "-Os"; else echo "-O2" ; fi)
43 39
44GCCSUPPORTSOPTSIZE = $(shell \
45if ( test $(GCCMAJVERSION) -eq 2 ) ; then \
46 if ( test $(GCCMINVERSION) -ge 66 ) ; then \
47 echo "true"; \
48 else \
49 echo "false"; \
50 fi; \
51else \
52 if ( test $(GCCMAJVERSION) -gt 2 ) ; then \
53 echo "true"; \
54 else \
55 echo "false"; \
56 fi; \
57fi; )
58
59
60ifeq ($(GCCSUPPORTSOPTSIZE), true)
61 OPTIMIZATION = -Os
62else
63 OPTIMIZATION = -O2
64endif
65 40
66# Allow alternative stripping tools to be used... 41# Allow alternative stripping tools to be used...
67ifndef $(STRIPTOOL) 42ifndef $(STRIPTOOL)
@@ -99,6 +74,13 @@ ifdef BB_INIT_SCRIPT
99 CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"' 74 CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
100endif 75endif
101 76
77# use '-ffunction-sections -fdata-sections' and '--gc-sections' if they work
78ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
79 -o /dev/null -xc /dev/null && $(LD) --gc-sections -v >/dev/null && echo 1),1)
80 CFLAGS += -ffunction-sections -fdata-sections -DFUNCTION_SECTIONS
81 LDFLAGS += --gc-sections
82endif
83
102all: busybox busybox.links doc 84all: busybox busybox.links doc
103 85
104doc: docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html 86doc: docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html