From 7826fd9f2a4a1de15ec1b8fcbe61da931a6c4ad5 Mon Sep 17 00:00:00 2001 From: kartofen Date: Mon, 3 Apr 2023 12:40:02 +0300 Subject: done --- build.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 build.sh (limited to 'build.sh') diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..4b597bb --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +cd ${0%/*} # go to project root + +FLAGS="-Wall -Wextra -g -pedantic" +RAYLIB_FLAGS="-lraylib -lm -lpthread -lGL -ldl -lrt -lX11" +RAYLIB_SRC="/usr/local/src/raylib/src" + +set -xe + +if ! [[ $1 == "web" ]] &> /dev/null; then + gcc -o bin/main src/main.c $FLAGS $RAYLIB_FLAGS +else + source emsdk_env.sh + + emcc -o bin/proc-gen.html src/main.c \ + $FLAGS -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 src/shell.html +fi -- cgit v1.2.3