aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 25 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ec02957ac..29a6cb0df 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,30 @@ DOSTATIC=false
31#This will choke on a non-debian system 31#This will choke on a non-debian system
32ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` 32ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
33 33
34GCCMAJVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\1/p"`
35GCCMINVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\2/p"`
36
37GCCSUPPORTSOPTSIZE=$(shell \
38if ( test $(GCCMAJVERSION) -eq 2 ) ; then \
39 if ( test $(GCCMINVERSION) -ge 95 ) ; then \
40 echo "true"; \
41 else \
42 echo "false"; \
43 fi; \
44else \
45 if ( test $(GCCMAJVERSION) -gt 2 ) ; then \
46 echo "true"; \
47 else \
48 echo "false"; \
49 fi; \
50fi; )
51
52
53ifeq ($(GCCSUPPORTSOPTSIZE), true)
54 OPTIMIZATION=-Os
55else
56 OPTIMIZATION=-O2
57endif
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
36ifeq ($(DODEBUG),true) 60ifeq ($(DODEBUG),true)
@@ -38,7 +62,7 @@ ifeq ($(DODEBUG),true)
38 STRIP= 62 STRIP=
39 LDFLAGS= 63 LDFLAGS=
40else 64else
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