make sure tmp/info gets created
[openwrt-10.03/.git] / include / scan.mk
index 7725fc713a8145a4440fc7f7f6874f433c905527..3229523ea4ef36c0c1e28543ad6b433c6c4705ed 100644 (file)
@@ -24,10 +24,22 @@ tmp/.$(SCAN_TARGET):
        @($(call progress,Collecting $(SCAN_NAME) info: done))
        @echo
 
+ifneq ($(SCAN_EXTRA),)
+SCAN_STAMP=tmp/info/.scan-$(SCAN_TARGET)-$(shell ls $(SCAN_EXTRA) 2>/dev/null | (md5sum || md5) 2>/dev/null | cut -d' ' -f1)
+$(SCAN_STAMP):
+       rm -f tmp/info/.scan-$(SCAN_TARGET)-*
+       touch $@
+endif
+
+# FIXME: generate this dynamically?
+ifeq ($(SCAN_TARGET),pkginfo)
+tmp/info/.pkginfo-kernel: $(shell ls package/kernel/modules/*.mk)
+endif
+
 define scanfiles
 $(foreach FILE,$(SCAN),
   tmp/.$(SCAN_TARGET): tmp/info/.$(SCAN_TARGET)-$(FILE) FORCE
-  tmp/info/.$(SCAN_TARGET)-$(FILE): $(SCAN_DEPS) $(SCAN_DIR)/$(FILE)/Makefile
+  tmp/info/.$(SCAN_TARGET)-$(FILE): $(SCAN_DEPS) $(SCAN_DIR)/$(FILE)/Makefile $(SCAN_STAMP)
        { \
                $$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(FILE)) \
                echo Source-Makefile: $(SCAN_DIR)/$(FILE)/Makefile; \