Make cin be static
[oweals/busybox.git] / Makefile
index ec2ffa6df946d08e45888f895cd9fdf176017002..285f3ab66620871919ded3fd9c3875372c7376f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,11 @@ export VERSION
 # overridden at the command line.  For example:
 #   make CROSS=powerpc-linux- BB_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
 
+# If you want to add some simple compiler switches (like -march=i686),
+# especially from the command line, use this instead of CFLAGS directly.
+# For optimization overrides, it's better still to set OPTIMIZATION.
+CFLAGS_EXTRA =
 # If you want a static binary, turn this on.
 DOSTATIC = false
 
@@ -67,14 +72,22 @@ STRIPTOOL = $(CROSS)strip
 
 # To compile vs an alternative libc, you may need to use/adjust
 # the following lines to meet your needs.  This is how I make
-# busybox compile with uC-Libc (needs BB_GETOPT and BB_FEATURE_NFSMOUNT
-# disabled at the moment).
+# busybox compile staticly with uClibc (needs BB_FEATURE_NFSMOUNT
+# disabled at the moment).  Note the _full_ path for LIBCDIR.
+# This is because make doesn't do ~ expansion...
 #LIBCDIR=/home/andersen/CVS/uClibc
 #LDFLAGS+=-nostdlib
 #LIBRARIES = $(LIBCDIR)/libc.a -lgcc
 #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
 #GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
 
+# This is how I compile with the uClibc shared lib...
+#LIBCDIR=/home/andersen/CVS/uClibc
+#LDFLAGS+=-nostdlib
+#LIBRARIES = -luClibc -lgcc $(LIBCDIR)/crt0.o
+#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
+#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+
 #--------------------------------------------------------
 
 # use '-Os' optimization if available, else use -O2
@@ -145,6 +158,9 @@ ifdef BB_INIT_SCRIPT
     CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
 endif
 
+# Put user-supplied flags at the end, where they
+# have a chance of winning.
+CFLAGS += $(CFLAGS_EXTRA)
 
 all: busybox busybox.links doc
 
@@ -208,11 +224,11 @@ busybox: $(OBJECTS)
        $(CC) $(LDFLAGS) -o $@ $^ $(LIBRARIES)
        $(STRIP)
 
-busybox.links: Config.h
+busybox.links: Config.h applets.h
        - $(BB_SRC_DIR)/busybox.mkll $(CONFIG_H) $(BB_SRC_DIR)/applets.h >$@
 
 nfsmount.o cmdedit.o: %.o: %.h
-$(OBJECTS): %.o: %.c Config.h busybox.h Makefile
+$(OBJECTS): %.o: %.c Config.h busybox.h applets.h Makefile
 
 utility.o: loop.h
 
@@ -228,6 +244,7 @@ clean:
            docs/busybox.lineo.com/BusyBox.html
        - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
            docs/busybox.pdf docs/busybox.lineo.com/busybox.html
+       - rm -f Config.h.ORG bb.def.h busybox.REGRESS.sh.results bb.OptionsAndFeatures
        - rm -rf docs/busybox _install
        - rm -f busybox.links loop.h *~ *.o core