summaryrefslogtreecommitdiff
path: root/circle-thingy/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'circle-thingy/build.sh')
-rwxr-xr-xcircle-thingy/build.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/circle-thingy/build.sh b/circle-thingy/build.sh
new file mode 100755
index 0000000..47c4d75
--- /dev/null
+++ b/circle-thingy/build.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+FLAGS="-Wall -Wextra -g -pedantic"
+RAYLIB_FLAGS="-lraylib -lm -lpthread -lGL -ldl -lrt -lX11"
+RAYLIB_SRC="/usr/local/src/raylib/src"
+
+mkdir -p bin
+set -xe
+
+if ! [[ $1 = "web" ]]; then
+ gcc -o bin/main main.c $DEBUG_FLAGS $RAYLIB_FLAGS
+else
+ source emsdk_env.sh
+
+ emcc -o bin/circle-thingy.html *.c \
+ -O2 -DPLATFORM_WEB \
+ -DRAYLIB_SRC="\"$RAYLIB_SRC/raylib.h\"" \
+ $RAYLIB_SRC/libraylib.a \
+ -I$RAYLIB_SRC/raylib.h \
+ -s USE_GLFW=3 -s ASYNCIFY \
+ --shell-file shell.html
+fi