More stuff
[oweals/busybox.git] / Makefile
index cf182097e67759245a676c9ee2dd49752eb72f72..4b05075f9abc5695920cac8c4bc7a12777f24190 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,10 @@
 
 VERSION=0.29alpha1
 BUILDTIME=$(shell date "+%Y%m%d-%H%M")
-DODEBUG=true
+
+# Comment out the following to make a debuggable build
+# Leave this off for production use.
+#DODEBUG=true
 
 #This will choke on a non-debian system
 ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
@@ -11,8 +14,10 @@ ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
 ifeq ($(DODEBUG),true)
     CFLAGS=-Wall -g -D_GNU_SOURCE
     STRIP=
+    LDFLAGS=
 else
-    CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
+    CFLAGS=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
+    LDFLAGS= -s
     STRIP= strip --remove-section=.note --remove-section=.comment busybox
 endif
 
@@ -21,24 +26,22 @@ ifndef $(prefix)
 endif
 BINDIR=$(prefix)
 
-LDFLAGS= -s
 LIBRARIES=-lc
 OBJECTS=$(shell ./busybox.sh)
 CFLAGS+= -DBB_VER='"$(VERSION)"'
 CFLAGS+= -DBB_BT='"$(BUILDTIME)"'
 
 all: busybox links
-#all: busybox
 
 busybox: $(OBJECTS)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o busybox $(OBJECTS) $(LIBRARIES)
+       $(CC) $(LDFLAGS) -o busybox $(OBJECTS) $(LIBRARIES)
        $(STRIP)
 
 links:
        - ./busybox.mkll | sort >busybox.links
        
 clean:
-       - rm -f busybox busybox.links *~ *.o 
+       - rm -f busybox busybox.links *~ *.o core 
 
 distclean: clean
        - rm -f busybox