mkdir llvm
export LLVMDIR=~/clang/llvm
git clone --depth=1 http://llvm.org/git/llvm.git
cd $LLVMDIR/tools
git clone --depth=1 http://llvm.org/git/clang.git
cd $LLVMDIR/tools/clang/tools
git clone --depth=1 http://llvm.org/git/clang-tools-extra.git extra
cd $LLVMDIR/projects
git clone --depth=1 http://llvm.org/git/compiler-rt.git
cd $LLVMDIR/projects
git clone --depth=1 http://llvm.org/git/libcxx.git
cd $LLVMDIR/projects
git clone --depth=1 http://llvm.org/git/libcxxabi.git
mkdir build
cd build
#CC=clang
#CXX=clang++
cmake -DCMAKE_BUILD_TYPE=Release ../llvm
make
#make install