Skip to content

How To Run

Juules32 edited this page Sep 29, 2024 · 2 revisions

Compiling the engine

The Makefile provides an easy way to compile the engine for most operating systems. It does, however, require that you install the GCC Compiler.

Makefile Targets

debug, optimized, and publish all compile the binary with different tags. debug shows many compiler warnings. optimized Increases the calculation speed considerably. publish links some common dependencies with the optimized engine. The executable will be placed in the bin folder by default. To specify the output directory, use the syntax: make <target> OUTPUT_DIR="<path>".

run first runs optimized, then runs the binary with an optional CL_FLAGS variable. To specify the flags, use the syntax: make <target> CL_FLAGS="<flags>".

To get a feel for how the engine runs, I recommend the following command, which displays additional information with the -v flag:

make run CL_FLAGS="-v"
  • Run make publish to compile an executable program. This requires a C++ compiler (such as GNU to be installed). The executable will be placed in the bin folder by default but can be modified with the command: make publish OUTPUT_DIR="<path_name>".
  • Run the executable.

webassembly requires more steps to work, described in the following section.

Compiling to WebAssembly

Install emscripten and enter the emscripten command prompt. Instructions here.

When inside the emscripten command prompt, navigate to the repo root folder, then run the following command:

make webassembly

To see the webpage, spin up a webserver in the web directory (live-server is an easy way to do this).

Clone this wiki locally