#!/bin/sh DEBUG="" LIB="-Ilib/ -lSDL2_gfx -lSDL2_ttf" while getopts "d" opt; do case "$opt" in d) DEBUG="-Wall -fsanitize=address -g" ;; esac done shift $((OPTIND-1)) [ "${1:-}" = "--" ] && shift if [ "$1" ]; then printf -- "\n\nmaking src %s\n" "$1" file="src/$1" clang -o bin/$(basename $file | sed 's/.c$//') $file $LIB `sdl2-config --cflags --libs` -lm $DEBUG else for file in src/*; do if [ -f "$file" ]; then if [ "$file" != ".clangd" ]; then printf -- "\n\nmaking %s\n" "$file" clang -o bin/$(basename $file | sed 's/.c$//') $file $LIB `sdl2-config --cflags --libs` -lm $DEBUG fi fi done fi