Shutdown sending on the socket when stdin closes.
[oweals/busybox.git] / Makefile
index 3b24002fc770f888e4f6a282f6a158aee0e3d34f..5de1c504a401416e67d6960dd6aeb4c310c14c6e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
 #
 
 PROG      := busybox
-VERSION   := 0.48pre
+VERSION   := 0.48
 BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
 export VERSION
 
@@ -67,12 +67,13 @@ 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 with uC-Libc (needs BB_GETOPT and BB_FEATURE_NFSMOUNT
+# disabled at the moment).
+#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")
 
 #--------------------------------------------------------
 
@@ -93,14 +94,13 @@ ifeq ($(DODMALLOC),true)
     # Force debug=true, since this is useless when not debugging...
     DODEBUG = true
 endif
-# -D_GNU_SOURCE is needed because environ is used in init.c
 ifeq ($(DODEBUG),true)
-    CFLAGS += $(WARNINGS) -g -D_GNU_SOURCE
-    LDFLAGS += 
-    STRIP   =
+    CFLAGS  += $(WARNINGS) -g -D_GNU_SOURCE
+    LDFLAGS += -Wl,-warn-common
+    STRIP    =
 else
     CFLAGS  += $(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
-    LDFLAGS  += -s
+    LDFLAGS += -s -Wl,-warn-common
     STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
 endif
 ifeq ($(DOSTATIC),true)
@@ -135,7 +135,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
@@ -184,19 +184,19 @@ docs/busybox.txt: docs/busybox.sgml
        @echo BusyBox Documentation
        @echo
        - mkdir -p docs
-       (cd docs; sgmltools -b txt $(BB_SRC_DIR)/busybox.sgml)
+       (cd docs; sgmltools -b txt busybox.sgml)
 
 docs/busybox.dvi: docs/busybox.sgml
        - mkdir -p docs
-       (cd docs; sgmltools -b dvi $(BB_SRC_DIR)/busybox.sgml)
+       (cd docs; sgmltools -b dvi busybox.sgml)
 
 docs/busybox.ps: docs/busybox.sgml
        - mkdir -p docs
-       (cd docs; sgmltools -b ps $(BB_SRC_DIR)/busybox.sgml)
+       (cd docs; sgmltools -b ps busybox.sgml)
 
 docs/busybox.pdf: docs/busybox.ps
        - mkdir -p docs
-       (cd docs; ps2pdf $(BB_SRC_DIR)/busybox.ps)
+       (cd docs; ps2pdf busybox.ps)
 
 docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
        - mkdir -p docs
@@ -209,7 +209,7 @@ busybox: $(OBJECTS)
        $(STRIP)
 
 busybox.links: Config.h
-       -$(BB_SRC_DIR)/busybox.mkll $(BB_SRC_DIR)/applets.h | sort >$@
+       - $(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