Patch from Matt Kraai <kraai@alumni.carnegiemellon.edu> to
[oweals/busybox.git] / Makefile
index f44790c80557c02d97730431afccd940f850ddaa..27ea8fd7f95f6d6f412bbbe02810a2c50f35cc59 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -52,11 +52,11 @@ endif
 
 # -D_GNU_SOURCE is needed because environ is used in init.c
 ifeq ($(DODEBUG),true)
-    CFLAGS += -Wall -g -fno-builtin -D_GNU_SOURCE
+    CFLAGS += -Wall -g -D_GNU_SOURCE
     LDFLAGS += 
     STRIP   =
 else
-    CFLAGS  += -Wall $(OPTIMIZATION) -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
+    CFLAGS  += -Wall $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
     LDFLAGS  += -s
     STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
     #Only staticly link when _not_ debugging 
@@ -87,25 +87,53 @@ ifdef BB_INIT_SCRIPT
     CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
 endif
 
-all: busybox busybox.links doc
+all: busybox busybox.links olddoc #doc
 
-doc: docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
 
-docs/BusyBox.txt: docs/busybox.pod
+# New docs based on DOCBOOK SGML
+doc: docs/BusyBox.txt docs/BusyBox.html docs/BusyBox.pdf
+
+docs/BusyBox.txt: docs/busybox.sgml
+       @echo
+       @echo BusyBox Documentation
+       @echo
+       (cd docs; sgmltools -b txt busybox.sgml)
+
+docs/BusyBox.dvi: docs/busybox.sgml
+       (cd docs; sgmltools -b dvi busybox.sgml)
+
+docs/BusyBox.ps: docs/BusyBox.dvi
+       (cd docs; sgmltools -b ps busybox.sgml)
+
+docs/BusyBox.pdf: docs/BusyBox.ps
+       (cd docs; ps2pdf busybox.ps)
+
+docs/busybox.lineo.com/BusyBox.html: docs/busybox.sgml
+       (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml)
+
+docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html
+       - rm -f docs/BusyBox.html
+       - ln -s busybox.lineo.com/BusyBox.html docs/BusyBox.html
+
+
+# Old Docs...
+olddoc: olddoc/BusyBox.txt olddoc/BusyBox.1 olddoc/BusyBox.html
+
+olddoc/BusyBox.txt: docs/busybox.pod
        @echo
        @echo BusyBox Documentation
        @echo
        - pod2text docs/busybox.pod > docs/BusyBox.txt
 
-docs/BusyBox.1: docs/busybox.pod
+olddoc/BusyBox.1: docs/busybox.pod
        - pod2man --center=BusyBox --release="version $(VERSION)" docs/busybox.pod > docs/BusyBox.1
 
-docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html
+olddoc/BusyBox.html: olddoc/busybox.lineo.com/BusyBox.html
        - rm -f docs/BusyBox.html
        - ln -s busybox.lineo.com/BusyBox.html docs/BusyBox.html
 
-docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod
-       - pod2html docs/busybox.pod > docs/busybox.lineo.com/BusyBox.html
+olddoc/busybox.lineo.com/BusyBox.html: docs/busybox.pod
+       - pod2html --noindex docs/busybox.pod > docs/busybox.lineo.com/BusyBox.html
        - rm -f pod2html*
 
 busybox: $(OBJECTS)
@@ -125,8 +153,9 @@ clean:
        - rm -f busybox.links *~ *.o core
        - rm -rf _install
        - cd tests && $(MAKE) clean
-       - rm -f docs/BusyBox.html docs/busybox.lineo.com/BusyBox.html \
-               docs/BusyBox.1 docs/BusyBox.txt pod2html*
+       - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
+           docs/busybox.pdf docs/busybox.lineo.com/busybox.html
+       - rm -rf docs/busybox
 
 distclean: clean
        - rm -f busybox