summaryrefslogtreecommitdiff
path: root/build.sh
blob: 4b597bb57c401f557536ba3b4ac670fd52a543e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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