aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-22 11:02:36 -0400
committeriamcheeseman <[email protected]>2026-05-22 11:02:36 -0400
commit0d07ba17500b6c44d17b6465c303e46175507557 (patch)
treec1c4e40b5c10c7b0f316f07849bbbc0ba0eb3bf9 /build.sh
parente375289782c924c0c382a752498fbd348ea7f918 (diff)
switch to a makefile
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh68
1 files changed, 0 insertions, 68 deletions
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 2690406..0000000
--- a/build.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-cc=cc
-cflags=(-Wall -Wextra -std=c99 -D_XOPEN_SOURCE=700 -O2)
-ldflags=(-lm)
-
-platform=gl
-debug=
-run=
-clean=
-tags=
-
-for flag in $@; do
- case "$flag" in
- '-run') run=true ;;
- '-debug') debug=true ;;
- '-clean') clean=true ;;
- '-use-x11') platform=x11 ;;
- '-use-gl') platform=gl ;;
- esac
-done
-
-if [ ! -z "$clean" ]; then
- rm demonchime
- rm libteensy.so
- exit
-fi
-
-[ ! -z "$debug" ] && cflags+=(-g -ggdb -rdynamic)
-
-teensy_cflags=(${cflags[@]} -fPIC -Iteensy -Iteensy/platform/$platform)
-[ ! -z "$debug" ] && teensy_cflags+=(-DTEENSY_DEBUG)
-teensy_ldflags=(${ldflags[@]})
-
-case "$platform" in
- 'x11')
- teensy_ldflags+=(-lX11)
- ;;
- 'gl')
- teensy_ldflags+=(./libglfw3.a)
- ;;
-esac
-
-dc_cflags=(${cflags[@]} -Iteensy -Idc)
-[ ! -z "$debug" ] && teensy_cflags+=(-DDC_DEBUG)
-dc_ldflags=(${ldflags[@]} -L. -l:libteensy.so -Wl,-rpath,$PWD)
-
-dc_src=$(find dc -name '*.c')
-teensy_src=$(find teensy -name '*.c' -not -path '*platform*')
-platform_src=$(find teensy/platform/$platform -name '*.c')
-
-echo -e "dc:\t\t$(tr '\n' ' ' <<< "$dc_src")"
-echo -e "teensy:\t\t$(tr '\n' ' ' <<< "$teensy_src")"
-echo -e "platform:\t$(tr '\n' ' ' <<< "$platform_src")"
-
-time (
- set -x
- $cc -shared -o libteensy.so \
- ${teensy_src[@]} ${platform_src[@]} \
- ${teensy_ldflags[@]} \
- ${teensy_cflags[@]} || exit 1
- $cc -o demonchime \
- ${dc_src[@]} \
- ${dc_ldflags[@]} \
- ${dc_cflags[@]} || exit 1
-)
-
-[ $? -eq 0 ] && [ ! -z "$run" ] && $RUN_CMD ./demonchime