process utilities related style cleanup
[oweals/busybox.git] / Makefile
index e5ac831678b82fa98743b5af3256eddfdef54b7b..cc223478ba582b16f843aafd5641760cd46e25d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -140,6 +140,7 @@ help:
        @echo '  all                    - Executable and documentation'
        @echo '  busybox                - the swiss-army executable'
        @echo '  doc                    - docs/BusyBox.{txt,html,1}'
+       @echo '  html                   - create html-based cross-reference'
        @echo
        @echo 'Configuration:'
        @echo '  allnoconfig            - disable all symbols in .config'
@@ -215,8 +216,6 @@ randconfig: scripts/config/conf
 
 allyesconfig: scripts/config/conf
        @./scripts/config/conf -y $(CONFIG_CONFIG_IN) > /dev/null
-       @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER)=.*/# \1 is not set/" .config
-       @./scripts/config/conf -o $(CONFIG_CONFIG_IN) > /dev/null
 
 allnoconfig: scripts/config/conf
        @./scripts/config/conf -n $(CONFIG_CONFIG_IN) > /dev/null
@@ -227,13 +226,13 @@ allnoconfig: scripts/config/conf
 
 defconfig: scripts/config/conf
        @./scripts/config/conf -y $(CONFIG_CONFIG_IN) > /dev/null
-       @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG.*|STATIC|SELINUX|BUILD_(AT_ONCE|LIBBUSYBOX)|FEATURE_(DEVFS|FULL_LIBBUSYBOX|SHARED_BUSYBOX|MTAB_SUPPORT|CLEAN_UP|UDHCP_DEBUG)|INSTALL_NO_USR))=.*/# \1 is not set/" .config
+       @$(SED) -i -r -e "s/^(CONFIG_(DEBUG.*|STATIC|SELINUX|NITPICK|BUILD_(AT_ONCE|LIBBUSYBOX)|FEATURE_(DEVFS|FULL_LIBBUSYBOX|SHARED_BUSYBOX|MTAB_SUPPORT|CLEAN_UP|UDHCP_DEBUG)|INSTALL_NO_USR))=.*/# \1 is not set/" .config
        @./scripts/config/conf -o $(CONFIG_CONFIG_IN) > /dev/null
 
 
 allbareconfig: scripts/config/conf
        @./scripts/config/conf -y $(CONFIG_CONFIG_IN) > /dev/null
-       @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG|STATIC|SELINUX|DEVFSD|NC_GAPING_SECURITY_HOLE|BUILD_AT_ONCE)).*/# \1 is not set/" .config
+       @$(SED) -i -r -e "s/^(CONFIG_(DEBUG|STATIC|SELINUX|DEVFSD|NC_GAPING_SECURITY_HOLE|BUILD_AT_ONCE)).*/# \1 is not set/" .config
        @$(SED) -i -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config
        @echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config
        @yes n | ./scripts/config/conf -o $(CONFIG_CONFIG_IN) > /dev/null
@@ -279,6 +278,7 @@ endif # CONFIG_FEATURE_FULL_LIBBUSYBOX
 APPLET_SRC:=$(APPLET_SRC-y)
 APPLETS_DEFINE:=$(APPLETS_DEFINE-y)
 else  # CONFIG_BUILD_AT_ONCE
+APPLET_SRC:=
 # no --combine, build archives out of the individual .o
 # This was the old way the binary was built.
 libbusybox-obj:=archival/libunarchive/libunarchive.a \
@@ -430,25 +430,25 @@ DEP_INCLUDES := include/bb_config.h
 ifeq ($(strip $(CONFIG_BBCONFIG)),y)
 DEP_INCLUDES += include/bbconfigopts.h
 
-include/bbconfigopts.h: .config
+include/bbconfigopts.h: .config $(top_srcdir)/scripts/config/mkconfigs
        $(disp_gen)
        $(Q)$(top_srcdir)/scripts/config/mkconfigs > $@
 endif
 
 ifeq ($(strip $(CONFIG_FEATURE_COMPRESS_USAGE)),y)
 USAGE_BIN:=scripts/usage
-$(USAGE_BIN): $(top_srcdir)/scripts/usage.c .config
+$(USAGE_BIN): $(top_srcdir)/scripts/usage.c .config \
+               $(top_srcdir)/include/usage.h
        $(do_link.h)
 
 DEP_INCLUDES += include/usage_compressed.h
 
-include/usage_compressed.h: .config $(USAGE_BIN)
-       $(Q)SED="$(SED)" $(SHELL) $(top_srcdir)/scripts/usage_compressed "$(top_builddir)/scripts" > $@
+include/usage_compressed.h: .config $(USAGE_BIN) \
+               $(top_srcdir)/scripts/usage_compressed
+       $(Q)SED="$(SED)" $(SHELL) $(top_srcdir)/scripts/usage_compressed \
+       "$(top_builddir)/scripts" > $@
 endif # CONFIG_FEATURE_COMPRESS_USAGE
 
-# workaround alleged bug in make-3.80, make-3.81
-.NOTPARALLEL: .depend
-
 depend dep: .depend
 .depend: scripts/bb_mkdep $(USAGE_BIN) $(DEP_INCLUDES)
        $(disp_gen)
@@ -471,17 +471,18 @@ clean:
            docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
            docs/busybox.net/BusyBox.html busybox.links \
            libbusybox.so* \
-           .config.old busybox busybox_unstripped
+           .config.old busybox busybox_unstripped \
+           include/usage_compressed.h scripts/usage
        - rm -r -f _install testsuite/links
-       - find . -name .\*.flags -o -name \*.o  -o -name \*.om \
+       - find . -name .\*.flags -o -name \*.o  -o -name \*.om -o -name \*.syn \
            -o -name \*.os -o -name \*.osm -o -name \*.a | xargs rm -f
 
 distclean: clean
        rm -f scripts/bb_mkdep scripts/usage
        rm -r -f include/config include/config.h $(DEP_INCLUDES)
        find . -name .depend'*' -print0 | xargs -0 rm -f
-       rm -f .hdepend
-       rm -f .config .config.old .config.cmd
+       find . -name '*.rej' -print0 | xargs -0 rm -f
+       rm -f .hdepend busybox_old .config .config.old .config.cmd
 
 release: distclean #doc
        cd ..; \
@@ -503,6 +504,17 @@ release: distclean #doc
 tags:
        ctags -R .
 
+# documentation, cross-reference
+# Modern distributions already ship synopsis packages (e.g. debian)
+# If you have an old distribution go to http://synopsis.fresco.org/
+syn_tgt := $(wildcard $(patsubst %,%/*.c,$(SRC_DIRS)))
+syn     := $(patsubst %.c, %.syn, $(syn_tgt))
+
+%.syn: %.c
+       synopsis -p C -l Comments.SSDFilter,Comments.Previous $(INCS) -Wp,verbose,debug,preprocess,cppflags="'$(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) $(APPLETS_DEFINE) $(BUSYBOX_DEFINE)'" -o $@ $<
+html: $(syn)
+       synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
+
 
 endif # ifeq ($(skip-makefile),)