diff options
author | Ying Wang <wangying@google.com> | 2013-12-04 16:04:49 -0800 |
---|---|---|
committer | Ying Wang <wangying@google.com> | 2013-12-05 18:37:20 +0000 |
commit | 7493c39eff203ed027b0f0ea320c26dd7d895b22 (patch) | |
tree | 7da43c22c4b15d61419e780ca8a6d92432109a13 | |
parent | ab92f3dff0eb87a8aed4fdbcf1e16b71fd026daf (diff) | |
download | build-7493c39eff203ed027b0f0ea320c26dd7d895b22.tar.gz |
Add utility function find-files-in-subdirsandroid-sdk-4.4.2_r1.0.1android-sdk-4.4.2_r1
find-files-in-subdirs uses utility find to find given files in the given
subdirs. This function uses $(1), instead of LOCAL_PATH as the base.
Change-Id: Ib76631c97acd257d651a580cbad767606874f5d0
(cherry picked from commit 85898bca9969ec30c746cc852394bbae0195edbc)
-rw-r--r-- | core/definitions.mk | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/definitions.mk b/core/definitions.mk index 290bb2f451..e1eb9f12be 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -342,6 +342,22 @@ define find-other-html-files endef ########################################################### +# Use utility find to find given files in the given subdirs. +# This function uses $(1), instead of LOCAL_PATH as the base. +# $(1): the base dir, relative to the root of the source tree. +# $(2): the file name pattern to be passed to find as "-name". +# $(3): a list of subdirs of the base dir. +# Returns: a list of paths relative to the base dir. +########################################################### + +define find-files-in-subdirs +$(patsubst ./%,%, \ + $(shell cd $(1) ; \ + find -L $(3) -name $(2) -and -not -name ".*") \ + ) +endef + +########################################################### ## Scan through each directory of $(1) looking for files ## that match $(2) using $(wildcard). Useful for seeing if ## a given directory or one of its parents contains |