19 FEB 2026

rahulmnavneeth

build system

homedocs

Build Tools

ToolRole
MakeBuild orchestration
NixReproducible toolchain and deps
ccC11 compiler (clang or gcc)
arStatic archive creation

Nix is the canonical build method. Make is the build driver. No CMake, no autotools.

Quick Start

nix develop          # Enter development shell
make                 # Build static library

With Nix Build

nix build            # Build in a pure Nix sandbox
ls ./result/lib/     # libmop.a

Without Nix

If you have a C11 compiler and make installed:

make CC=clang        # Or CC=gcc

Make Targets

TargetEffect
makeBuild the static library (libmop.a)
make libSame as make
make testBuild and run all tests
make cleanRemove build/ directory
make installInstall to PREFIX (default /usr/local)

Optional Features

FlagEffect
MOP_ENABLE_VULKAN=1Compile Vulkan backend (src/backend/vulkan/)
MOP_ENABLE_OPENGL=1Compile OpenGL backend (src/backend/opengl/)
MOP_ENABLE_LUA=1Enable Lua configuration system (src/config/)
make MOP_ENABLE_VULKAN=1              # Build with Vulkan
make test                             # Run tests (rebuild lib without Vulkan first)

Note: tests link against libmop.a without -lvulkan, so build the library without MOP_ENABLE_VULKAN=1 when running tests. The Vulkan backend is tested via the examples.

Build Outputs

build/
  obj/          — Object files (mirrors src/ structure)
  lib/
    libmop.a    — Static library

Compiler Flags

-std=c11 -Wall -Wextra -Wpedantic -Werror
-Wno-unused-parameter -Wno-missing-field-initializers

Debug mode (default): -O0 -g Release mode: -O2 -DNDEBUG (set RELEASE=1)

Nix Flake Structure

The flake.nix provides:

The core library has zero platform-specific dependencies beyond a C11 compiler.

Examples

Examples live in examples/ with their own Makefile and flake.nix.

cd examples && nix develop    # SDL3 + pkg-config
make                          # Build all examples
make run                      # Run interactive viewport
make run-headless             # Run headless PPM exporter

See examples/Makefile for all targets.