X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=include%2Fdepends.mk;fp=include%2Fdepends.mk;h=b74e535506a382f128b996342f730cc6f09048ff;hp=0000000000000000000000000000000000000000;hb=7214b5b403e25e053792cb13c20d66a0967187c3;hpb=65cea206cd6e09da0471862a4610aae5133ccf30 diff --git a/include/depends.mk b/include/depends.mk new file mode 100644 index 0000000000..b74e535506 --- /dev/null +++ b/include/depends.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# define a dependency on a subtree +# parameters: +# 1: directory +# 2: directory dependency +# 3: tempfile for file listings +# 4: find options + +FINDPARAMS := -type f -not -name ".*" -and -not -path "*.svn*" +define rdep + $(foreach file,$(shell find $(1) $(FINDPARAMS) -and -not -path "*:*" $(4)), + $(2): $(file) + $(file): ; + ) + + ifneq ($(shell find $(1) $(FINDPARAMS) $(4) 2>/dev/null | md5s),$(shell cat $(3) 2>/dev/null)) + $(2): $(3) + endif + + $(3): FORCE + @find $(1) $(FINDPARAMS) $(4) 2>/dev/null | md5s > $$@ + +endef