Umorna -- Tiny game written to test 'chads' library, it uses assets from itch.io...
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

45 lignes
725B

  1. #!/bin/bash
  2. set -xe
  3. CC=clang
  4. CFLAGS="-std=gnu17 -Weverything -Werror"
  5. LDLIBS="-lraylib"
  6. TARGET=umorna
  7. build_type="$1"
  8. if [ -z "$build_type" ] || \
  9. [ "$build_type" = debug ]; then
  10. CFLAGS+=" -O0 -g"
  11. elif [ "$build_type" = "release" ]; then
  12. CFLAGS+=" -O3 -flto"
  13. fi
  14. sources=(
  15. "source/engine.c"
  16. "source/render.c"
  17. "source/game.c"
  18. "source/menu.c"
  19. "source/main.c"
  20. )
  21. objects=()
  22. updated=""
  23. for source in "${sources[@]}"; do
  24. obj="${source%.*}.o"
  25. objects+=("$obj")
  26. if [ "$source" -nt "$obj" ]; then
  27. "$CC" $CFLAGS -c "$source" -o "$obj"
  28. updated="y"
  29. fi
  30. done
  31. if [ ! -f "$TARGET" ] || [ -n "$updated" ]; then
  32. "$CC" $CFLAGS $LDLIBS "${objects[@]}" -o "$TARGET"
  33. fi