Created
April 10, 2015 00:01
-
-
Save astarasikov/a2e9287a34381f680d58 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/bash | |
set -e | |
set -u | |
export SRC_LLVM="https://github.com/llvm-mirror/llvm.git" | |
export SRC_COMPILER_RT="https://github.com/llvm-mirror/compiler-rt.git" | |
export SRC_CLANG="https://github.com/llvm-mirror/clang.git" | |
export SRC_CLANG_EXTRA="https://github.com/llvm-mirror/clang-tools-extra.git" | |
export SRC_LIBCXX="https://github.com/llvm-mirror/libcxx.git" | |
export SRC_LIBCXXABI="https://github.com/llvm-mirror/libcxxabi.git" | |
function git_up() { | |
git reset -- . | |
git checkout -- . | |
git clean -df | |
git pull --rebase | |
} | |
function llvm_install() { | |
echo "Installing $2 to $1" | |
pushd . | |
if [[ ! -e "$1" ]]; then | |
mkdir -p "$1" | |
fi | |
cd "$1" | |
git clone "$2" "$3" || (cd "$3" && git_up) | |
popd | |
} | |
pushd . | |
llvm_install "." "$SRC_LLVM" "llvm" | |
llvm_install "llvm/tools" "$SRC_CLANG" "clang" | |
llvm_install "llvm/tools/clang/tools" "$SRC_CLANG_EXTRA" "extra" | |
llvm_install "llvm/projects" "$SRC_LIBCXX" "libcxx" | |
llvm_install "llvm/projects" "$SRC_LIBCXXABI" "libcxxabi" | |
llvm_install "llvm/projects" "$SRC_COMPILER_RT" "compiler-rt" | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment