Make cin be static
[oweals/busybox.git] / Makefile
index 52ad774d8d093b09bd7d59922ceada434fb53c57..285f3ab66620871919ded3fd9c3875372c7376f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
 #
 
 PROG      := busybox
-VERSION   := 0.48pre
+VERSION   := 0.49pre
 BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
 export VERSION
 
@@ -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,12 +72,21 @@ 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...
-#LIBCDIR=/home/andersen/CVS/uC-libc
-#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
-#CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
+# 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")
 
 #--------------------------------------------------------
 
@@ -134,7 +148,7 @@ else
     VPATH = .:$(BB_SRC_DIR)
     CONFIG_LIST = $(addsuffix /Config.h,$(subst :, ,$(VPATH)))
     CONFIG_H    = $(word 1,$(shell ls -f -1 $(CONFIG_LIST) 2>/dev/null))
-    CFLAGS += -I- $(patsubst %,-I%,$(subst :, ,$(VPATH)))
+    CFLAGS += -I- $(patsubst %,-I%,$(subst :, ,$(VPATH))) $(CROSS_CFLAGS)
 endif
 
 OBJECTS   = $(shell $(BB_SRC_DIR)/busybox.sh $(CONFIG_H) $(BB_SRC_DIR)) busybox.o messages.o usage.o utility.o
@@ -144,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
 
@@ -207,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
 
@@ -227,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