summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-01-28 03:19:57 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-01-28 03:19:57 +0000
commit410b46a3900729aa7f1f0083651068cf57ad643d (patch)
treed833674aa510e9a9d21ebc85353ed78b7596f840 /Makefile
parentbc49cf73079c1223fba5046047517fc3c00d5284 (diff)
downloadllvm-410b46a3900729aa7f1f0083651068cf57ad643d.tar.gz
llvm-410b46a3900729aa7f1f0083651068cf57ad643d.tar.bz2
llvm-410b46a3900729aa7f1f0083651068cf57ad643d.tar.xz
Improved svn repo searching for 'make update'
Use a simple recursive bash function to search for svn repos for the 'make update' target thus including projects like clang-tools-extra. Reviewers: bkramer, echristo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 17 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 70fad6d818..7a1b190459 100644
--- a/Makefile
+++ b/Makefile
@@ -248,13 +248,26 @@ build-for-llvm-top:
SVN = svn
SVN-UPDATE-OPTIONS =
AWK = awk
-SUB-SVN-DIRS = $(AWK) '/I|\? / {print $$2}' \
- | LC_ALL=C xargs $(SVN) info 2>/dev/null \
- | $(AWK) '/^Path:\ / {print $$2}'
+
+# Multiline variable defining a recursive function for finding svn repos rooted at
+# a given path. svnup() requires one argument: the root to search from.
+define SUB_SVN_DIRS
+svnup() {
+ dirs=`svn status --no-ignore $$1 | awk '/I|\? / {print $$2}' | LC_ALL=C xargs svn info 2>/dev/null | awk '/^Path:\ / {print $$2}'`;
+ if [ "$$dirs" = "" ]; then
+ return;
+ fi;
+ for f in $$dirs; do
+ echo $$f;
+ svnup $$f;
+ done
+}
+endef
+export SUB_SVN_DIRS
update:
$(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
- @ $(SVN) status --no-ignore $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
+ @eval $$SUB_SVN_DIRS; $(SVN) status --no-ignore $(LLVM_SRC_ROOT) | svnup $(LLVM_SRC_ROOT) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
happiness: update all check-all