Files
Sandbox/README.md
var 3f4a2eec82 Static linking
Check changes in README.md
2026-05-08 07:11:40 -05:00

1.7 KiB

Sandbox

Gamedev Experiments

How to Build

Note

The makefile is configured for Linux only. Cross-compilation for Windows is planned.

Note

This project uses external libraries SDL2, GLEW, and cglm. To avoid depending on any Linux distro's package system, these libraries are built from source and linked statically, not dynamically. This makes the executable a few MB larger but also very portable. A few other small libraries are included directly in the src/ directory of this git repo.

  1. Build external libraries.
    • SDL2:
      1. Download source code: I am using Release 2.32.10.
      2. If this project is located at ~/Code/Sandbox, place the source code for SDL2 at ~/Code/SDL2 .
      3. Open a terminal in the SDL2 directory. Enter ./configure and then make .
    • GLEW:
      1. Download source code here.
      2. Extract to ~/Code/glew .
      3. Just enter make to build GLEW.
    • cglm:
      1. Download source code: I am using Release 0.9.6
      2. Extract to ~/Code/cglm .
      3. In a terminal, ./autogen.sh then ./configure and finally make .
  2. Build the project.
    • In the Sandbox directory, enter make to build the executable.
    • Symbolic links in lib/ and include/ are used to find the header files and static archives of the external libraries that were prepared in the previous step.
    • Other commands are available:
      • make clean to delete the executable and object files.
      • make rebuild to clean and build in one step.
      • make run to build and run in one step.
      • make release to make a smaller executable suitable for distribution.