38 lines
738 B
Bash
Executable file
38 lines
738 B
Bash
Executable file
#!/bin/bash -e
|
|
|
|
INSTALL=$(pwd)/llvm-mos
|
|
|
|
if [[ "${1,,}" == "all" ]]; then
|
|
if [[ ! -d llvm-mos-source ]]; then
|
|
git clone https://github.com/llvm-mos/llvm-mos.git llvm-mos-source
|
|
fi
|
|
|
|
pushd llvm-mos-source
|
|
cmake \
|
|
-C clang/cmake/caches/MOS.cmake \
|
|
-G Ninja \
|
|
-S llvm \
|
|
-B build \
|
|
-DCMAKE_INSTALL_PREFIX=${INSTALL}
|
|
cmake --build build
|
|
cmake --install build
|
|
popd
|
|
fi
|
|
|
|
if [[ ! -d llvm-mos-sdk-source ]]; then
|
|
git clone https://github.com/llvm-mos/llvm-mos-sdk.git llvm-mos-sdk-source
|
|
fi
|
|
|
|
cp -Rf llvm-mos-sdk-patches/* llvm-mos-sdk-source/.
|
|
|
|
pushd llvm-mos-sdk-source
|
|
mkdir -p build
|
|
pushd build
|
|
cmake \
|
|
-G Ninja \
|
|
-DCMAKE_INSTALL_PREFIX=${INSTALL} \
|
|
..
|
|
ninja install
|
|
popd
|
|
popd
|
|
|