diff options
| author | iamcheeseman <[email protected]> | 2026-05-26 15:35:13 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-26 15:35:13 -0400 |
| commit | ed7dfaad432b6e3fe838b9a2b5fe225abea5365d (patch) | |
| tree | 0af2e01a688d963ec6d2977802dbeb9156335845 /build.sh | |
| parent | 8122098e3854bf68ca63cc25e082ba51a27b8615 (diff) | |
tbh i did a lot
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -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 |
