Skip to content

How to build on linux

Joris Dauphin edited this page Jun 18, 2024 · 2 revisions

How to build on linux

Building maxr on Linux

This page describes how to build maxr under Linux using GCC or Clang. For other platforms/compilers or general information see How to build.

Prerequisites

You need the following tools installed on you system

  • gcc 5.4.0 (or newer) or clang 3.1 (or newer)
  • cmake

For Ubuntu you can use the following command to install them: sudo apt-get install gcc cmake

For Fedora you can use the following command to install them: sudo dnf install gcc cmake

You need the following libraries (and their development versions):

  • SDL 2.0.4 (or newer)
  • SDL_mixer
  • SDL_net

For Ubuntu you can use the following command to install them: sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev

For Fedora you can use the following command to install them: sudo dnf install SDL2-devel SDL2_mixer-devel SDL2_net-devel

Get the source code

Download the code or get the latest release: https://github.com/maxr-dot-org/maxr/releases or clone our git repository to get the latest development version: git clone --recurse-submodules https://github.com/maxr-dot-org/maxr.git

Build steps

Execute the following commands:

git clone --recurse-submodules https://github.com/maxr-dot-org/maxr.git
cd maxr
mkdir build
cd build
cmake ..
make

Hint: To change between Debug and Release build, use the options -DCMAKE_BUILD_TYPE=Debug or -DCMAKE_BUILD_TYPE=Release when running cmake: E. g. cmake -DCMAKE_BUILD_TYPE=Release ..

Installing

You can install maxr with the following command: make install

This installs the game to the default prefix which is probably /usr/local.

Use make DESTDIR=/foo/bar install to set your own installation directory.

After installing you can start maxr by executing maxr

Hint: If you just want to start maxr without installing, simply override the data path MAXRDATA after running make in your build dir: MAXRDATA=../data/ ./maxr