-
Notifications
You must be signed in to change notification settings - Fork 9
Basic build instructions
These instructions focus on how to build this on Linux. It's possible to build on Windows as well, either with some kind of emulation layer like MINGW, MSYS or Cygwin, or building with Visual Studio/msbuild directly, but you'll have to check the LLVM documentation for details on this.
The LLVM documentation for building is located here.
- At least CMake 3.4.3
- A reasonably new version of gcc or clang. gcc 8.0.0 or newer is probably good.
-
Make yourself a workspace.
mkdir llvm cd llvm
-
Check out the llvm-gbz80 repository.
git clone https://github.com/Bevinsky/llvm-gbz80.git
-
Check out the clang-gbz80 repository and ake a symlink at
tools/clang
in the LLVM repository to the Clang repository.git clone https://github.com/Bevinsky/clang-gbz80.git cd llvm-gbz80/tools ln -s ../../clang-gbz80 clang
Or, just clone Clang there directly.
cd llvm-gbz80/tools git clone https://github.com/Bevinsky/clang-gbz80.git clang
-
Make a build directory in the workspace root.
cd ../.. mkdir build cd build
-
Configure the build with CMake.
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="GBZ80" ../llvm-gbz80
If you are short on memory (8 GB or less) you can either configure a release build (
-DCMAKE_BUILD_TYPE=Release
) or install thegold
linker and enable it (-DLLVM_USE_LINKER=gold
). Building a debug build is recommended if you're going to experiment, though. -
Build clang and llc.
make llc clang