change osbolete sigpause() to sigsuspend()
[oweals/busybox.git] / Makefile
index cfa5e52de5d64e13ba155f6b17641516e1cd9f9b..f603d2d1a91babc494ad29f77786f8fb25b35497 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,8 @@
 # You shouldn't need to mess with anything beyond this point...
 #--------------------------------------------------------------
 noconfig_targets := menuconfig config oldconfig randconfig \
-       defconfig allyesconfig allnoconfig clean distclean \
+       defconfig allyesconfig allnoconfig allbareconfig \
+       clean distclean \
        release tags
 
 # the toplevel sourcedir
@@ -52,6 +53,11 @@ else
   KBUILD_OUTPUT := $(top_builddir)
 endif
 
+ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
+# pull in OS specific commands like cp, mkdir, etc. early
+-include $(top_srcdir)/Rules.mak
+endif
+
 # All object directories.
 OBJ_DIRS := $(DIRS)
 all_tree := $(patsubst %,$(top_builddir)/%,$(OBJ_DIRS) scripts scripts/config include)
@@ -74,8 +80,6 @@ $(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUT
        top_srcdir=$(top_srcdir) \
        top_builddir=$(top_builddir) \
        KBUILD_SRC=$(top_srcdir) \
-       PREFIX=$(PREFIX) \
-       CROSS=$(CROSS) \
        -f $(CURDIR)/Makefile $@
 
 $(KBUILD_OUTPUT)/Rules.mak:
@@ -118,7 +122,8 @@ help:
        @echo 'Configuration:'
        @echo '  allnoconfig            - disable all symbols in .config'
        @echo '  allyesconfig           - enable (almost) all symbols in .config'
-       @echo '  config         - text based configurator (of last resort).'
+       @echo '  allbareconfig          - enable all basics without any features'
+       @echo '  config         - text based configurator (of last resort)'
        @echo '  defconfig              - set .config to defaults'
        @echo '  menuconfig             - interactive curses-based configurator'
        @echo '  oldconfig              - resolve any unresolved symbols in .config'
@@ -180,7 +185,7 @@ randconfig: scripts/config/conf
 
 allyesconfig: scripts/config/conf
        @./scripts/config/conf -y $(CONFIG_CONFIG_IN)
-       sed -i -r -e "s/^(CONFIG_DEBUG|USING_CROSS_COMPILER|CONFIG_STATIC|CONFIG_SELINUX).*/# \1 is not set/" .config
+       sed -i -r -e "s/^(CONFIG_DEBUG|USING_CROSS_COMPILER|CONFIG_STATIC|CONFIG_SELINUX|CONFIG_FEATURE_DEVFS).*/# \1 is not set/" .config
        @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
 
 allnoconfig: scripts/config/conf
@@ -189,6 +194,13 @@ allnoconfig: scripts/config/conf
 defconfig: scripts/config/conf
        @./scripts/config/conf -d $(CONFIG_CONFIG_IN)
 
+allbareconfig: scripts/config/conf
+       @./scripts/config/conf -y $(CONFIG_CONFIG_IN)
+       sed -i -r -e "s/^(CONFIG_DEBUG|USING_CROSS_COMPILER|CONFIG_STATIC|CONFIG_SELINUX).*/# \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)
+
 else # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
 
 all: busybox busybox.links doc
@@ -245,7 +257,7 @@ sizes:
        -rm -f busybox
        $(MAKE) top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) \
                -f $(top_srcdir)/Makefile STRIPCMD=/bin/true
-       nm --size-sort busybox
+       $(NM) --size-sort busybox
 
 # Documentation Targets
 doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
@@ -292,11 +304,12 @@ include/bbconfigopts.h: .config
        $(top_srcdir)/scripts/config/mkconfigs > $@
 endif
 
-depend dep $(top_builddir)/.depend: .depend
+depend dep: .depend
 .depend: scripts/bb_mkdep $(DEP_INCLUDES)
        @rm -f .depend
        @mkdir -p include/config
-       scripts/bb_mkdep -c include/config.h -c include/bb_config.h -I $(top_srcdir)/include $(top_srcdir)/ > $@.tmp
+       scripts/bb_mkdep -c include/config.h -c include/bb_config.h \
+                       -I $(top_srcdir)/include $(top_srcdir) > $@.tmp
        mv $@.tmp $@
 
 include/config.h: .config
@@ -355,4 +368,4 @@ tags:
 endif # ifeq ($(skip-makefile),)
 
 .PHONY: dummy subdirs release distclean clean config oldconfig \
-       menuconfig tags check test depend buildtree
+       menuconfig tags check test depend dep buildtree