aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authoriceyrazor <iceyrazor@mailfence.com>2026-02-08 04:07:36 -0600
committericeyrazor <iceyrazor@mailfence.com>2026-02-08 04:07:36 -0600
commit82f4a3b8acfd5677762fd8cb00922fd32c102fef (patch)
treeaa9fa91ee341edc4d54e7b960301d1bfa3d7c0c3 /make
a janky init
Diffstat (limited to 'make')
-rwxr-xr-xmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/make b/make
new file mode 100755
index 0000000..72f08f9
--- /dev/null
+++ b/make
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+DEBUG=""
+LIB="-Ilib/"
+
+while getopts "d" opt; do
+ case "$opt" in
+ d) DEBUG="-Wall -fsanitize=address -g"
+ ;;
+ esac
+done
+
+shift $((OPTIND-1))
+[ "${1:-}" = "--" ] && shift
+
+echo making shit
+if [[ "$1" ]]; then
+ 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
+ clang -o bin/$(basename $file | sed 's/.c$//') $file $LIB `sdl2-config --cflags --libs` -lm $DEBUG
+ fi
+ fi
+ done
+fi