diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-05-12 19:38:40 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-05-12 19:38:40 +0000 |
commit | 3d427ac5efd249dc25dd03deb30520335f68911a (patch) | |
tree | b77ecc357ad981263f5c737c7aef4a32b345635c | |
parent | 59b9e870243c56a9c5ec045a925e4e9b3f1f6c3c (diff) | |
download | busybox-w32-3d427ac5efd249dc25dd03deb30520335f68911a.tar.gz busybox-w32-3d427ac5efd249dc25dd03deb30520335f68911a.tar.bz2 busybox-w32-3d427ac5efd249dc25dd03deb30520335f68911a.zip |
Some experimental stuff (work in progress). heheh.
-Erik
-rw-r--r-- | Makefile | 38 |
1 files changed, 10 insertions, 28 deletions
@@ -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. |
32 | DOSTATIC = false | 32 | DOSTATIC = false |
33 | 33 | ||
34 | # Figure out what arch we are on (not used at the moment) | ||
35 | ARCH := $(shell uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/') | ||
36 | |||
37 | |||
38 | CC = gcc | 34 | CC = gcc |
39 | 35 | ||
40 | GCCMAJVERSION = $(shell $(CC) --version | cut -f1 -d'.') | 36 | # use '-Os' optimization if available, else use -O2 |
41 | GCCMINVERSION = $(shell $(CC) --version | cut -f2 -d'.') | 37 | OPTIMIZATION = $(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 | ||
44 | GCCSUPPORTSOPTSIZE = $(shell \ | ||
45 | if ( test $(GCCMAJVERSION) -eq 2 ) ; then \ | ||
46 | if ( test $(GCCMINVERSION) -ge 66 ) ; then \ | ||
47 | echo "true"; \ | ||
48 | else \ | ||
49 | echo "false"; \ | ||
50 | fi; \ | ||
51 | else \ | ||
52 | if ( test $(GCCMAJVERSION) -gt 2 ) ; then \ | ||
53 | echo "true"; \ | ||
54 | else \ | ||
55 | echo "false"; \ | ||
56 | fi; \ | ||
57 | fi; ) | ||
58 | |||
59 | |||
60 | ifeq ($(GCCSUPPORTSOPTSIZE), true) | ||
61 | OPTIMIZATION = -Os | ||
62 | else | ||
63 | OPTIMIZATION = -O2 | ||
64 | endif | ||
65 | 40 | ||
66 | # Allow alternative stripping tools to be used... | 41 | # Allow alternative stripping tools to be used... |
67 | ifndef $(STRIPTOOL) | 42 | ifndef $(STRIPTOOL) |
@@ -99,6 +74,13 @@ ifdef BB_INIT_SCRIPT | |||
99 | CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"' | 74 | CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"' |
100 | endif | 75 | endif |
101 | 76 | ||
77 | # use '-ffunction-sections -fdata-sections' and '--gc-sections' if they work | ||
78 | ifeq ($(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 | ||
82 | endif | ||
83 | |||
102 | all: busybox busybox.links doc | 84 | all: busybox busybox.links doc |
103 | 85 | ||
104 | doc: docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html | 86 | doc: docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html |