aboutsummaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'helpers')
-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