aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile37
1 files changed, 27 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index bcaac87c4..f4df9c702 100644
--- a/Makefile
+++ b/Makefile
@@ -26,31 +26,48 @@ export VERSION
26# Set the following to `true' to make a debuggable build. 26# Set the following to `true' to make a debuggable build.
27# Leave this set to `false' for production use. 27# Leave this set to `false' for production use.
28# eg: `make DODEBUG=true tests' 28# eg: `make DODEBUG=true tests'
29# Do not enable this for production builds...
29DODEBUG = false 30DODEBUG = false
30 31
32# This enables compiling with dmalloc ( http://dmalloc.com/ )
33# which is an excellent public domain mem leak and malloc problem
34# detector. To enable dmalloc, before running busybox you will
35# want to first set up your environment.
36# eg: `export DMALLOC_OPTIONS=debug=0x14f47d83,inter=100,log=logfile`
37# Do not enable this for production builds...
38DODMALLOC = false
39
31# If you want a static binary, turn this on. 40# If you want a static binary, turn this on.
32DOSTATIC = false 41DOSTATIC = false
33 42
43# If you are running a cross compiler, you may want to set this
44# to something more interesting...
45CROSS =
46CC = $(CROSS)gcc
47STRIPTOOL = $(CROSS)strip
48
34# To compile vs an alternative libc, you may need to use/adjust 49# To compile vs an alternative libc, you may need to use/adjust
35# the following lines to meet your needs. This is how I did it... 50# the following lines to meet your needs. This is how I make
51# busybox compile with uC-Libc...
52#LIBCDIR=/home/andersen/CVS/uC-libc
36#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") 53#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
37#CFLAGS+=-nostdinc -fno-builtin -I/home/andersen/CVS/uC-libc/include -I$(GCCINCDIR) 54#CFLAGS+=-nostdinc -fno-builtin -I$(LIBCDIR)/include -I$(GCCINCDIR)
38#LDFLAGS+=-nostdlib 55#LDFLAGS+=-nostdlib
39#LIBRARIES = /home/andersen/CVS/uC-libc/libc.a 56#LIBRARIES = $(LIBCDIR)/libc.a
40
41 57
42CC = gcc 58#--------------------------------------------------------
43 59
44# use '-Os' optimization if available, else use -O2 60# use '-Os' optimization if available, else use -O2
45OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ 61OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
46 then echo "-Os"; else echo "-O2" ; fi) 62 then echo "-Os"; else echo "-O2" ; fi)
47 63
48 64ifeq ($(DODMALLOC),true)
49# Allow alternative stripping tools to be used... 65 # For testing mem leaks with dmalloc
50ifndef $(STRIPTOOL) 66 CFLAGS+=-DDMALLOC
51 STRIPTOOL = strip 67 LIBRARIES = -ldmalloc
68 # Force debug=true, since this is useless when not debugging...
69 DODEBUG = true
52endif 70endif
53
54# -D_GNU_SOURCE is needed because environ is used in init.c 71# -D_GNU_SOURCE is needed because environ is used in init.c
55ifeq ($(DODEBUG),true) 72ifeq ($(DODEBUG),true)
56 CFLAGS += -Wall -g -D_GNU_SOURCE 73 CFLAGS += -Wall -g -D_GNU_SOURCE