Skip to content

Instantly share code, notes, and snippets.

@acoomans
Last active August 17, 2018 17:34
Show Gist options
  • Save acoomans/29261d8099cc8707e277bc1e02c28d2e to your computer and use it in GitHub Desktop.
Save acoomans/29261d8099cc8707e277bc1e02c28d2e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
GIT_CLONE_ARGS="--depth 1"
## LLVM
# http://llvm.org/docs/GettingStarted.html#git-mirror
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/llvm.git
git -C llvm remote add acoomans [email protected]:acoomans/llvm.git
git -C llvm config branch.master.rebase true
## Tools
cd llvm/tools
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/clang.git
git -C clang remote add acoomans [email protected]:acoomans/clang.git
git -C clang config branch.master.rebase true
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/lldb.git
git -C lldb remote add acoomans [email protected]:acoomans/lldb.git
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/clang-tools-extra.git
cd ../..
## Projects
cd llvm/projects
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/compiler-rt.git
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/openmp.git
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/libcxx.git
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/libcxxabi.git
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/test-suite.git
cd ../..
## Build
# https://clang.llvm.org/get_started.html
if ! [ -x "$(command -v cmake)" ]; then
echo 'cmake not found; cannot build'
exit 0
fi
cd llvm
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment