aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2016-05-27 12:56:06 +0300
committerDiana Picus <diana.picus@linaro.org>2016-06-16 18:10:07 +0300
commitc581e1933bff781b459b8cc92aad81c697198c84 (patch)
tree37090f587fb5d19a157e0758a531515fa7f3fb7b
parent72189fd702d00d45714f98857a88159097933b5c (diff)
downloadlinaro-scripts-c581e1933bff781b459b8cc92aad81c697198c84.tar.gz
Add option to build a certain target (and -h option)
This should allow us to run make/ninja on a given target, e.g. `llvm-build llc` will build only the llc target `llvm-build check-llvm-codegen-aarch64` will only run a subset of the tests This also adds a -h option. Change-Id: I4b2d195ed7f7f4b23f84438068dd1e13a094e947
-rwxr-xr-xhelpers/llvm-build57
1 files changed, 13 insertions, 44 deletions
diff --git a/helpers/llvm-build b/helpers/llvm-build
index b674fa9..40c42e2 100755
--- a/helpers/llvm-build
+++ b/helpers/llvm-build
@@ -18,42 +18,15 @@ build_type=Release
shared=
targets=
prog=`basename $0`
-syntax="Syntax: $prog [-u(pdate)] [-c(check-all)] [-i(nstall)]"
+syntax="Syntax: $prog [targets]"
update=false
check=false
master=false
inst=false
-while getopts "ucim" opt; do
- case $opt in
- u)
- update=true
- ;;
- c)
- check=true
- ;;
- i)
- inst=true
- ;;
- m)
- master=true
- ;;
- *)
- echo $syntax
- exit 1
- ;;
- esac
-done
-## Run llvm-sync before
-if $update; then
- echo " + Updating Repositories"
- safe_run llvm-sync -a
-fi
-
-## Make sure all branches are on master
-if $master; then
- echo " + Checking out master"
- safe_run llvm-branch master
+if [ "$1" = "-h" ]; then
+ echo $syntax
+ exit 0
fi
## Choose between make and ninja
@@ -77,7 +50,7 @@ if [ ! -d $build_dir ]; then
fi
cd $build_dir
-## Re-run CMake file files are damaged / not there
+## Re-run CMake if files are damaged / not there
if [ ! -f build.ninja ] && [ ! -f Makefile ]; then
echo " + Configuring Build"
safe_run cmake -G "$generator" $LLVM_SRC \
@@ -90,17 +63,13 @@ if [ ! -f build.ninja ] && [ ! -f Makefile ]; then
fi
## Build
-echo " + Building LLVM"
-safe_run $make -j$CPUs
-
-## Check
-if $check; then
- echo " + Running Tests"
- safe_run $make check-all
+if [ "$1" == "" ]; then
+ echo " + Building LLVM"
+ safe_run $make -j$CPUs
+else
+ for target in "$@"; do
+ echo " + Running $target"
+ safe_run $make -j$CPUs $target
+ done
fi
-## Install
-if $inst; then
- echo " + Installing on the System"
- safe_run $make install
-fi