Add gawk as a preriquisite (needed for ramdisk images)
[openwrt.git] / Makefile
index d9db236..bee47c4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -44,32 +44,13 @@ ifeq ($(FORCE),)
   world: tmp/.prereq-packages tmp/.prereq-target
 endif
 
-define stamp
-tmp/info/.stamp-$(1)-$(shell ls $(2)/*/Makefile | (md5sum || md5) 2>/dev/null | cut -d' ' -f1)
-endef
-
-STAMP_pkginfo=$(call stamp,pkginfo,package)
-STAMP_targetinfo=$(call stamp,targetinfo,target/linux)
-define scan_info
-
-$(STAMP_$(1)):
+tmp/.pkginfo: FORCE
        @mkdir -p tmp/info
-       @rm -f tmp/info/.stamp-$(1)*
-       @touch $$@
-
-$(foreach FILE,$(shell ls $(2)/*/Makefile),
-tmp/.$(1): $(FILE)
-$(FILE):
-)
-
-tmp/.$(1): $(STAMP_$(1))
-       @echo -n Collecting $(3) info... 
-       @$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="$(1)" SCAN_DIR="$(2)" SCAN_NAME="$(3)" SCAN_DEPS="$(4)"
+       @$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="pkginfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(shell ls include/package*.mk) include/kernel.mk" SCAN_EXTRA=""
 
-endef
-
-$(eval $(call scan_info,pkginfo,package,package,include/package.mk))
-$(eval $(call scan_info,targetinfo,target/linux,target,include/kernel-build.mk include/kernel-version.mk))
+tmp/.targetinfo: FORCE
+       @mkdir -p tmp/info
+       @$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="$(shell ls include/kernel*.mk)" SCAN_EXTRA=""
 
 tmpinfo-clean: FORCE
        @-rm -rf tmp/.pkginfo tmp/.targetinfo
@@ -110,11 +91,14 @@ kernel_menuconfig: .config FORCE
        -$(MAKE) target/linux-prepare
        $(NO_TRACE_MAKE) -C target/linux menuconfig
 
-package/%: 
+scan_packages:
        @$(NO_TRACE_MAKE) -s tmp/.pkginfo tmp/.targetinfo
+       
+
+package/%: scan_packages
        $(MAKE) -C package $(patsubst package/%,%,$@)
 
-target/%:
+target/%: scan_packages
        @$(NO_TRACE_MAKE) -s tmp/.pkginfo tmp/.targetinfo
        $(MAKE) -C target $(patsubst target/%,%,$@)
 
@@ -174,7 +158,7 @@ clean: FORCE
 dirclean: clean
        rm -rf staging_dir_* toolchain_build_* tool_build
 
-distclean: dirclean config-clean
+distclean: dirclean config-clean symlinkclean docclean
        rm -rf dl
 
 help:
@@ -186,7 +170,10 @@ doc:
 docclean:
        $(MAKE) -C docs/ clean
 
-.SILENT: clean dirclean distclean config-clean download world
+symlinkclean:
+       find package -type l | xargs rm -f
+
+.SILENT: clean dirclean distclean symlinkclean config-clean download world
 FORCE: ;
 .PHONY: FORCE help
 %: ;
This page took 0.029109 seconds and 4 git commands to generate.