Umorna -- Tiny game written to test 'chads' library, it uses assets from itch.io...
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/bin/bash
-
- set -xe
-
- CC=clang
- CFLAGS="-std=gnu17 -Weverything -Werror"
- LDLIBS="-lraylib"
-
- TARGET=umorna
-
- build_type="$1"
-
- if [ -z "$build_type" ] || \
- [ "$build_type" = debug ]; then
- CFLAGS+=" -O0 -g"
- elif [ "$build_type" = "release" ]; then
- CFLAGS+=" -O3 -flto"
- fi
-
- sources=(
- "source/engine.c"
- "source/render.c"
- "source/game.c"
- "source/menu.c"
- "source/main.c"
- )
-
- objects=()
-
- updated=""
-
- for source in "${sources[@]}"; do
- obj="${source%.*}.o"
- objects+=("$obj")
-
- if [ "$source" -nt "$obj" ]; then
- "$CC" $CFLAGS -c "$source" -o "$obj"
- updated="y"
- fi
- done
-
- if [ ! -f "$TARGET" ] || [ -n "$updated" ]; then
- "$CC" $CFLAGS $LDLIBS "${objects[@]}" -o "$TARGET"
- fi
|