#!/bin/sh set -eu version_llvm="$1" dir_download="$PWD/download" mkdir -p build; cd build dir_install="$PWD/install-llvm-$version_llvm" # Prepare source tar xf "$dir_download/llvm-$version_llvm.src.tar.xz" cd "llvm-$version_llvm.src" mkdir -p build; cd build # Configure source cmake .. \ -DCMAKE_INSTALL_PREFIX="$dir_install" \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_TARGETS_TO_BUILD="X86" \ -DLLVM_INSTALL_UTILS=ON # Build and install make make install