2007-04-15 18:28:24 +00:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
2007-07-26 11:32:13 +00:00
|
|
|
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 "*\\\#*"
|
2007-04-15 18:28:24 +00:00
|
|
|
define rdep
|
2007-07-26 11:32:13 +00:00
|
|
|
$(foreach file,$(shell find $(1) $(DEP_FINDPARAMS) $(4)),
|
2007-04-15 18:28:24 +00:00
|
|
|
$(2): $(file)
|
|
|
|
$(file): ;
|
|
|
|
)
|
|
|
|
|
2007-05-09 22:47:01 +00:00
|
|
|
ifneq ($(3),)
|
2007-07-30 23:52:17 +00:00
|
|
|
ifneq ($$(shell find $(1) $(DEP_FINDPARAMS) $(4) 2>/dev/null | md5s),$(if $(3),$(shell cat $(3) || touch $(3) 2>/dev/null)))
|
2007-05-09 22:47:01 +00:00
|
|
|
$(2): $(3)
|
|
|
|
endif
|
2007-04-15 18:28:24 +00:00
|
|
|
|
2007-05-09 22:47:01 +00:00
|
|
|
endif
|
2007-07-30 23:52:17 +00:00
|
|
|
|
|
|
|
$(3): FORCE
|
|
|
|
@-find $(1) $(DEP_FINDPARAMS) $(4) 2>/dev/null | md5s > $$@
|
|
|
|
.PRECIOUS: $(3)
|
2007-04-15 18:28:24 +00:00
|
|
|
endef
|