Typo fix.
[oweals/busybox.git] / Makefile
index fe346b0d4eb7c7b1207a4fcfa243217ed2a2b533..7bf72f232bf9a7d759caeb3b70ee8ce48f77ece2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -128,14 +128,17 @@ help:
        @echo '  oldconfig              - resolve any unresolved symbols in .config'
        @echo
        @echo 'Installation:'
-       @echo '  install                - install busybox into $prefix'
+       @echo '  install                - install busybox into $(PREFIX)'
        @echo '  uninstall'
        @echo
        @echo 'Development:'
+       @echo '  bloatcheck             - show size difference between old and new versions'
        @echo '  check                  - run the test suite for all applets'
+       @echo '  checkhelp              - check for missing help-entries in Config.in'
        @echo '  randconfig             - generate a random configuration'
        @echo '  release                - create a distribution tarball'
        @echo '  sizes                  - show size of all enabled busybox symbols'
+       @echo '  objsizes               - show size of each .o object built'
        @echo
 
 
@@ -144,7 +147,7 @@ include $(top_srcdir)/Rules.mak
 ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
 
 # Default target if none was requested explicitly
-all: defconfig menuconfig
+all: menuconfig
 
 # warn if no configuration exists and we are asked to build a non-config target
 .config:
@@ -205,7 +208,7 @@ allbareconfig: scripts/config/conf
        @$(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 -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config
        @echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config
-       @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
+       @yes n | ./scripts/config/conf -o $(CONFIG_CONFIG_IN)
 
 else # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
 
@@ -258,6 +261,7 @@ LIBBUSYBOX_SONAME:=$(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL
 DO_INSTALL_LIBS:=$(LD_LIBBUSYBOX) \
        $(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
        $(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION)
+endif # CONFIG_BUILD_LIBBUSYBOX
 
 ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
 ifneq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
@@ -269,7 +273,6 @@ $(LIBBUSYBOX_SONAME): $(LIBRARY_SRC)
 else # CONFIG_BUILD_AT_ONCE
 $(LIBBUSYBOX_SONAME): $(libbusybox-obj)
 endif # CONFIG_BUILD_AT_ONCE
-endif # CONFIG_BUILD_LIBBUSYBOX
 
 ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
 LDBUSYBOX:=-L$(top_builddir) -lbusybox
@@ -305,6 +308,9 @@ busybox: busybox_unstripped
        $(Q)cp busybox_unstripped busybox
        $(do_strip)
 
+%.bflt: %_unstripped
+       $(do_elf2flt)
+
 busybox.links: $(top_srcdir)/applets/busybox.mkll include/bb_config.h $(top_srcdir)/include/applets.h
        $(Q)-$(SHELL) $^ >$@
 
@@ -346,8 +352,20 @@ check test: busybox
        bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
        $(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE)
 
+.PHONY: checkhelp
+checkhelp:
+       $(Q)$(top_srcdir)/scripts/checkhelp.awk \
+               $(wildcard $(patsubst %,%/Config.in,$(SRC_DIRS) ./))
+.PHONY: sizes
 sizes: busybox_unstripped
        $(NM) --size-sort $(<)
+.PHONY: bloatcheck
+bloatcheck: busybox_old busybox_unstripped
+       @$(top_srcdir)/scripts/bloat-o-meter busybox_old busybox_unstripped
+
+.PHONY: objsizes
+objsizes: busybox_unstripped
+       $(SHELL) $(top_srcdir)/scripts/objsizes
 
 # Documentation Targets
 doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
@@ -384,7 +402,7 @@ docs/busybox.net/BusyBox.html: docs/busybox.pod
 
 # The nifty new dependency stuff
 scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
-       $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
+       $(do_link.h)
 
 DEP_INCLUDES := include/bb_config.h
 
@@ -396,6 +414,13 @@ include/bbconfigopts.h: .config
        $(Q)$(top_srcdir)/scripts/config/mkconfigs > $@
 endif
 
+scripts/usage: $(top_srcdir)/scripts/usage.c .config
+       $(do_link.h) -I$(top_srcdir)/include
+
+DEP_INCLUDES += include/usage_compressed.h
+include/usage_compressed.h: .config scripts/usage
+       $(Q)sh $(top_srcdir)/scripts/usage_compressed "$(top_srcdir)/scripts" > $@
+
 depend dep: .depend
 .depend: scripts/bb_mkdep $(DEP_INCLUDES)
        $(disp_gen)
@@ -424,9 +449,10 @@ clean:
            -o -name \*.os -o -name \*.osm -o -name \*.a | xargs rm -f
 
 distclean: clean
-       - rm -f scripts/bb_mkdep
-       - rm -r -f include/config $(DEP_INCLUDES)
-       - find . -name .depend'*' | xargs rm -f
+       rm -f scripts/bb_mkdep scripts/usage
+       rm -r -f include/config include/_usage.h include/config.h $(DEP_INCLUDES)
+       find . -name .depend'*' -print0 | xargs -0 rm -f
+       rm -f .hdepend
        rm -f .config .config.old .config.cmd
 
 release: distclean #doc