diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -31,6 +31,30 @@ DOSTATIC=false | |||
31 | #This will choke on a non-debian system | 31 | #This will choke on a non-debian system |
32 | ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` | 32 | ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` |
33 | 33 | ||
34 | GCCMAJVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\1/p"` | ||
35 | GCCMINVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\2/p"` | ||
36 | |||
37 | GCCSUPPORTSOPTSIZE=$(shell \ | ||
38 | if ( test $(GCCMAJVERSION) -eq 2 ) ; then \ | ||
39 | if ( test $(GCCMINVERSION) -ge 95 ) ; then \ | ||
40 | echo "true"; \ | ||
41 | else \ | ||
42 | echo "false"; \ | ||
43 | fi; \ | ||
44 | else \ | ||
45 | if ( test $(GCCMAJVERSION) -gt 2 ) ; then \ | ||
46 | echo "true"; \ | ||
47 | else \ | ||
48 | echo "false"; \ | ||
49 | fi; \ | ||
50 | fi; ) | ||
51 | |||
52 | |||
53 | ifeq ($(GCCSUPPORTSOPTSIZE), true) | ||
54 | OPTIMIZATION=-Os | ||
55 | else | ||
56 | OPTIMIZATION=-O2 | ||
57 | endif | ||
34 | 58 | ||
35 | # -D_GNU_SOURCE is needed because environ is used in init.c | 59 | # -D_GNU_SOURCE is needed because environ is used in init.c |
36 | ifeq ($(DODEBUG),true) | 60 | ifeq ($(DODEBUG),true) |
@@ -38,7 +62,7 @@ ifeq ($(DODEBUG),true) | |||
38 | STRIP= | 62 | STRIP= |
39 | LDFLAGS= | 63 | LDFLAGS= |
40 | else | 64 | else |
41 | CFLAGS+=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE | 65 | CFLAGS+=-Wall $(OPTIMIZATION) -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE |
42 | LDFLAGS= -s | 66 | LDFLAGS= -s |
43 | STRIP= strip --remove-section=.note --remove-section=.comment $(PROG) | 67 | STRIP= strip --remove-section=.note --remove-section=.comment $(PROG) |
44 | #Only staticly link when _not_ debugging | 68 | #Only staticly link when _not_ debugging |