Skip to content

Building cFrOSt

azertyfun edited this page Oct 7, 2016 · 1 revision

cFrOSt currently uses clang and llvm-dcpu16, originally modified by the guys over at https://github.com/llvm-dcpu16.

Windows

  • You need to download llvm-dcpu16/llvm-dcpu16 (you can download their sdk, complete with binutils-dcpu16, here), yamakaky/dcpu and DCPU-Toolchain-cli;
  • Extract the bin folder from the sdk here, or copy the binaries you compiled in a tools/ folder here. You should now have cFrOSt/tools/clang.exe;
  • Install rust and build the assembler part of yamakaky/dcpu, and copy target/release/assembler.exe to the tools/ folder;
  • Extract DCPU-Toolchain-cli.zip in tools/, so you have tools/DCPU-Toolchain.jar
  • Create an assembly file with src/include.c, and all *.dasm files into one file. Compile it by running bin/clang.exe file.c then bin/assembler.exe file.s -o FrOSt.bin then move FrOSt.bin tools/, or if you have cygwin just run make then make run.
  • If you do not have cygwin, run the project with cd tools then java -jar DCPU-Toolchain.jar java -jar DCPU-Toolchain.jar run none --rom=FrOSt.bin --clock --keyboard --lem1802 --lem1802-fps=10 --debugger

Linux x86 or x86_64

  • Run git clone https://github.com/FrOSt-Foundation/cFrOSt --depth=1 to download cFrOSt ;
  • Run cd cFrOSt/tools && ./download-toolchain.sh to download DCPU-Toolchain ;
  • Run make, then make run.

Useful env variables:

  • AS: the assembler to use
  • CC: the C compiler to use (must support the DCPU)
  • CFLAGS, CPPFLAGS, ASFLAGS: pass custom arguments
Clone this wiki locally