fix a rebuild bug related to quilt
[openwrt/svn-archive/archive.git] / include / depends.mk
index 1e01d35f81bdceb395c1d66e7f45fb9977cc75bd..4819d6dfc1c4015e651d7d5b9c33e160e4c04587 100644 (file)
 #      3: tempfile for file listings
 #      4: find options
 
-DEP_FINDPARAMS := -type f -not -name ".*" -and -not -path "*.svn*" 
+DEP_FINDPARAMS := -type f -not -name ".*" -and -not -path "*.svn*" -type f -not -name ".*" -and -not -path "*.svn*" -and -not -path "*:*" -and -not -path "*!*" -and -not -path "* *" -and -not -path "*\\\#*"
 define rdep
-  $(foreach file,$(shell find $(1) $(DEP_FINDPARAMS) -and -not -path "*:*" $(4)),
+  $(foreach file,$(shell find $(1) $(DEP_FINDPARAMS) $(4)),
     $(2): $(file)
     $(file): ;
   )
 
   ifneq ($(3),)
-    ifneq ($$(shell find $(1) $(DEP_FINDPARAMS) $(4) 2>/dev/null | md5s),$(if $(3),$(shell cat $(3) 2>/dev/null)))
+    ifneq ($$(shell find $(1) $(DEP_FINDPARAMS) $(4) 2>/dev/null | md5s),$(if $(3),$(shell cat $(3) || touch $(3) 2>/dev/null)))
       $(2): $(3)
     endif
   
-    $(3): FORCE
-         @-find $(1) $(DEP_FINDPARAMS) $(4) 2>/dev/null | md5s > $$@
   endif
+
+  $(3): FORCE
+         @-find $(1) $(DEP_FINDPARAMS) $(4) 2>/dev/null | md5s > $$@
+  .PRECIOUS: $(3)
 endef