Gratuitously changed the file "busybox.defs.h" to the more
[oweals/busybox.git] / Makefile
index a43c7b0ee3458ab4b14993c8d50bc6df6c6bbd83..469539095f0533df6bd5bc9bd77106e623651abd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
 #
 
 PROG      := busybox
-VERSION   := 0.47pre
+VERSION   := 0.47
 BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
 export VERSION
 
@@ -40,9 +40,19 @@ DODEBUG = false
 # Do not enable this for production builds...
 DODMALLOC = false
 
+# If you want large file summit support, turn this on.
+# This has no effect if you don't have a kernel with lfs
+# support, and a system with libc-2.1.3 or later.
+# Some of the programs that can benefit from lfs support
+# are dd, gzip, mount, tar, and mkfs_minix.
+# LFS allows you to use the above programs for files
+# larger than 2GB!
+DOLFS = false
+
+
 # If you are running a cross compiler, you may want to set this
 # to something more interesting...
-CROSS =
+CROSS = #powerpc-linux-
 CC = $(CROSS)gcc
 STRIPTOOL = $(CROSS)strip
 
@@ -61,6 +71,12 @@ STRIPTOOL = $(CROSS)strip
 OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
     then echo "-Os"; else echo "-O2" ; fi)
 
+WARNINGS = -Wall
+
+ifeq ($(DOLFS),true)
+    # For large file summit support
+    CFLAGS+=-D_FILE_OFFSET_BITS=64
+endif
 ifeq ($(DODMALLOC),true)
     # For testing mem leaks with dmalloc
     CFLAGS+=-DDMALLOC
@@ -70,27 +86,27 @@ ifeq ($(DODMALLOC),true)
 endif
 # -D_GNU_SOURCE is needed because environ is used in init.c
 ifeq ($(DODEBUG),true)
-    CFLAGS += -Wall -g -D_GNU_SOURCE
+    CFLAGS += $(WARNINGS) -g -D_GNU_SOURCE
     LDFLAGS += 
     STRIP   =
 else
-    CFLAGS  += -Wall $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
+    CFLAGS  += $(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
     LDFLAGS  += -s
     STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
-    #Only staticly link when _not_ debugging 
-    ifeq ($(DOSTATIC),true)
-       LDFLAGS += --static
-       #
-       #use '-ffunction-sections -fdata-sections' and '--gc-sections' if they work
-       #to try and strip out any unused junk.  Doesn't do much for me, but you may
-       #want to give it a shot...
-       #
-       #ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
-       #       -o /dev/null -xc /dev/null 2>/dev/null && $(LD) --gc-sections -v >/dev/null && echo 1),1)
-       #       CFLAGS += -ffunction-sections -fdata-sections
-       #       LDFLAGS += --gc-sections
-       #endif
-    endif
+endif
+ifeq ($(DOSTATIC),true)
+    LDFLAGS += --static
+    #
+    #use '-ffunction-sections -fdata-sections' and '--gc-sections' (if they 
+    # work) to try and strip out any unused junk.  Doesn't do much for me, 
+    # but you may want to give it a shot...
+    #
+    #ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
+    #  -o /dev/null -xc /dev/null 2>/dev/null && $(LD) \
+    #                  --gc-sections -v >/dev/null && echo 1),1)
+    #  CFLAGS += -ffunction-sections -fdata-sections
+    #  LDFLAGS += --gc-sections
+    #endif
 endif
 
 ifndef $(PREFIX)
@@ -104,6 +120,7 @@ ifdef BB_INIT_SCRIPT
     CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
 endif
 
+
 all: busybox busybox.links doc
 
 doc: olddoc
@@ -130,7 +147,7 @@ docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod
 
 
 # New docs based on DOCBOOK SGML
-newdoc: docs/busybox.txt docs/busybox.pdf docs/busybox/busybox.html
+newdoc: docs/busybox.txt docs/busybox.pdf docs/busybox/busyboxdocumentation.html
 
 docs/busybox.txt: docs/busybox.sgml
        @echo
@@ -147,33 +164,37 @@ docs/busybox.ps: docs/busybox.sgml
 docs/busybox.pdf: docs/busybox.ps
        (cd docs; ps2pdf busybox.ps)
 
-docs/busybox/busybox.html: docs/busybox.sgml
+docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
        (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml)
 
 
 
-busybox: $(OBJECTS)
+busybox: $(OBJECTS) 
        $(CC) $(LDFLAGS) -o $@ $^ $(LIBRARIES)
        $(STRIP)
 
-busybox.links: busybox.def.h
+busybox.links: Config.h
        - ./busybox.mkll | sort >$@
 
 nfsmount.o cmdedit.o: %.o: %.h
-$(OBJECTS): %.o: busybox.def.h internal.h  %.c Makefile
+$(OBJECTS): %.o: Config.h internal.h  %.c Makefile
+
+utility.o: loop.h
+
+loop.h:
+       @./mk_loop_h.sh
 
 test tests:
        cd tests && $(MAKE) all
 
 clean:
-       - rm -f busybox.links *~ *.o core
-       - rm -rf _install
        cd tests && $(MAKE) clean
        - rm -f docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
            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 -rf docs/busybox
+       - rm -rf docs/busybox _install
+       - rm -f busybox.links *~ *.o core
 
 distclean: clean
        - rm -f busybox