OpenKKnD/engine-c/build.sh
2026-09-17 21:48:48 +02:00

22 lines
699 B
Bash
Executable file

#!/bin/bash
# Build script for openkknd - the merged KKND-style 2D RTS.
set -e
cd "$(dirname "$0")"
CC=${CC:-gcc}
CFLAGS="-O2 -Wall -Iinclude"
SRCS="src/unit_card.c src/rng.c src/config.c src/png.c src/snapshot.c src/map.c src/sprites.c \
src/units.c src/buildings.c src/projectiles.c src/render.c \
src/input.c src/ai.c src/audio.c src/save.c src/engine.c src/main.c"
LIBS=$(pkg-config --cflags --libs sdl2 SDL2_ttf 2>/dev/null)
if [ -z "$LIBS" ]; then
LIBS="-lSDL2 -lSDL2_ttf"
fi
LIBS="$LIBS -lz"
echo "openkknd: compiling..."
$CC $CFLAGS $SRCS -o openkknd $LIBS -lm
echo "openkknd: built -> ./openkknd"
echo "usage: ./openkknd [--easy|--normal|--hard] [--load savegame.kknd]"