ifplugd: code shrink
[oweals/busybox.git] / Makefile
index 51c08a782c4e5ecb717189dd2c59eed81b725638..2d6a3b2a04e8be26f2eac07a246a6858dd0c0def 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 1
-PATCHLEVEL = 15
+PATCHLEVEL = 18
 SUBLEVEL = 0
-EXTRAVERSION =
+EXTRAVERSION = .git
 NAME = Unnamed
 
 # *DOCUMENTATION*
@@ -358,6 +358,20 @@ scripts_basic:
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
 
+# This target generates Kbuild's and Config.in's from *.c files
+PHONY += gen_build_files
+gen_build_files: $(wildcard $(srctree)/*/*.c) $(wildcard $(srctree)/*/*/*.c)
+       $(Q)$(srctree)/scripts/gen_build_files.sh $(srctree) $(objtree)
+
+# bbox: we have helpers in applets/
+# we depend on scripts_basic, since scripts/basic/fixdep
+# must be built before any other host prog
+PHONY += applets_dir
+applets_dir: scripts_basic gen_build_files
+       $(Q)$(MAKE) $(build)=applets
+
+applets/%: applets_dir ;
+
 PHONY += outputmakefile
 # outputmakefile generates a Makefile in the output directory, if using a
 # separate output directory. This allows convenient use of make in the
@@ -419,7 +433,7 @@ ifeq ($(config-targets),1)
 -include $(srctree)/arch/$(ARCH)/Makefile
 export KBUILD_DEFCONFIG
 
-config %config: scripts_basic outputmakefile FORCE
+config %config: scripts_basic outputmakefile gen_build_files FORCE
        $(Q)mkdir -p include
        $(Q)$(MAKE) $(build)=scripts/kconfig $@
        $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
@@ -432,9 +446,9 @@ else
 ifeq ($(KBUILD_EXTMOD),)
 # Additional helpers built in scripts/
 # Carefully list dependencies so we do not try to build scripts twice
-# in parrallel
+# in parallel
 PHONY += scripts
-scripts: scripts_basic include/config/MARKER
+scripts: gen_build_files scripts_basic include/config/MARKER
        $(Q)$(MAKE) $(build)=$(@)
 
 scripts_basic: include/autoconf.h
@@ -495,9 +509,11 @@ include $(srctree)/Makefile.flags
 # with it and forgot to run make oldconfig.
 # If kconfig.d is missing then we are probarly in a cleaned tree so
 # we execute the config step to be sure to catch updated Kconfig files
-include/autoconf.h: .kconfig.d .config
+include/autoconf.h: .kconfig.d .config $(wildcard $(srctree)/*/*.c) $(wildcard $(srctree)/*/*/*.c) | gen_build_files
        $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
 
+include/usage.h: gen_build_files
+
 else
 # Dummy target needed, because used as prerequisite
 include/autoconf.h: ;
@@ -797,7 +813,7 @@ ifneq ($(KBUILD_MODULES),)
        $(Q)rm -f $(MODVERDIR)/*
 endif
 
-archprepare: prepare1 scripts_basic
+archprepare: prepare1 scripts_basic applets_dir
 
 prepare0: archprepare FORCE
        $(Q)$(MAKE) $(build)=.
@@ -987,6 +1003,8 @@ $(mrproper-dirs):
 mrproper: clean archmrproper $(mrproper-dirs)
        $(call cmd,rmdirs)
        $(call cmd,rmfiles)
+       @find -name Config.src | sed 's/.src$$/.in/' | xargs -r rm -f
+       @find -name Kbuild.src | sed 's/.src$$//' | xargs -r rm -f
 
 # distclean
 #