aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-26 15:35:13 -0400
committeriamcheeseman <[email protected]>2026-05-26 15:35:13 -0400
commited7dfaad432b6e3fe838b9a2b5fe225abea5365d (patch)
tree0af2e01a688d963ec6d2977802dbeb9156335845 /build.sh
parent8122098e3854bf68ca63cc25e082ba51a27b8615 (diff)
tbh i did a lot
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/build.sh b/build.sh
index 51dbc6e..c123671 100755
--- a/build.sh
+++ b/build.sh
@@ -1,9 +1,11 @@
#!/bin/bash
+set -e
+
source build.env
-INC="-Iteensy -Iteensy/platform/$PLATFORM -Idc"
-CFLAGS="$INC -Wall -Wextra -pedantic -std=c99 -D_XOPEN_SOURCE=700 -O2"
+INC="-Iteensy -Iteensy/platform/$PLATFORM -Idc -Ieditor"
+CFLAGS="$INC -Wall -Wextra -std=c99 -D_XOPEN_SOURCE=700 -O2"
LDFLAGS=-lm
DO_RUN=0
@@ -19,15 +21,19 @@ for flag in $@; do
esac
done
-if [ "$PLATFORM" == 'gl' ]; then
- CFLAGS="$CFLAGS $(pkg-config --cflags glfw3 gl)"
- LDFLAGS="$LDFLAGS $(pkg-config --libs glfw3 gl)"
+if [ "$PLATFORM" == 'gl' ]; then
+ LDFLAGS="$LDFLAGS ./libglfw3.a"
fi
-SRC=$(find dc teensy platform/$PLATFORM -name '*.c' | tr '\n' ' ')
+SRC=$(find dc teensy platform/$PLATFORM editor -name '*.c' | tr '\n' ' ')
+
+execute() {
+ echo $1
+ eval $1
+}
-CMD="$CC -o $OUT $CFLAGS $LDFLAGS $SRC"
-echo $CMD
-time eval $CC -o $OUT $CFLAGS $LDFLAGS $SRC
+time (
+ execute "$CC -o $OUT $SRC $CFLAGS $LDFLAGS"
+)
[ "$DO_RUN" -eq 1 ] && $RUN_CMD ./$OUT