Last active
August 29, 2015 14:08
-
-
Save rizsotto/e617c3dcc3f34943fc9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -o nounset | |
| set -o errexit | |
| set -o xtrace | |
| source_dir="llvm.src" | |
| build_dir="llvm.build" | |
| target_dir="llvm.install" | |
| svn_update() | |
| { | |
| pushd $1 | |
| trap popd SIGINT | |
| svn up -q | |
| svn info | grep Revision | |
| trap - SIGINT | |
| popd | |
| } | |
| gitsvn_update() | |
| { | |
| pushd $1 | |
| trap popd SIGINT | |
| git svn fetch | |
| git svn rebase | |
| trap - SIGINT | |
| popd | |
| } | |
| # http://llvm.org/svn/llvm-project/llvm/trunk | |
| svn_update $source_dir | |
| # http://llvm.org/svn/llvm-project/cfe/trunk | |
| gitsvn_update "$source_dir/tools/clang" | |
| # http://llvm.org/svn/llvm-project/clang-tools-extra/trunk | |
| #svn_update "$source_dir/tools/clang/tools" | |
| # http://llvm.org/svn/llvm-project/compiler-rt/trunk | |
| svn_update "$source_dir/projects" | |
| build() | |
| { | |
| local dest_dir=$(realpath $target_dir) | |
| local src_dir=$(realpath $source_dir) | |
| if [ ! -d $build_dir ]; then | |
| rm -rf $build_dir | |
| mkdir $build_dir | |
| cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $src_dir --build $build_dir | |
| fi | |
| make -C $build_dir -j9 all | |
| rm -rf $dest_dir | |
| mkdir $dest_dir | |
| DESTDIR=$dest_dir make -C $build_dir install | |
| } | |
| build false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment