Static linking

Check changes in README.md
This commit is contained in:
var
2026-05-08 07:11:40 -05:00
parent 13bec80438
commit 3f4a2eec82
5 changed files with 8085 additions and 15 deletions

View File

@@ -1,3 +1,34 @@
# Sandbox
Gamedev Experiments
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](https://github.com/libsdl-org/SDL/releases/tag/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](https://glew.sourceforge.net/).
2. Extract to `~/Code/glew` .
3. Just enter `make` to build GLEW.
- cglm:
1. Download source code: I am using [Release 0.9.6](https://github.com/recp/cglm/releases/tag/v0.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.