-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·65 lines (53 loc) · 1.7 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
rm -rf build/*
cp -r lib build/
RLPATH=./lib/libraylib.a
if [ -n "$WEB" ]; then
RLPATH=./lib/web/libraylib.a
fi
if [ -n "$SETUP" ]; then
rm -rf raylib lib include
mkdir lib include
mkdir lib/web
git clone https://github.com/raysan5/raylib --depth=1
cd raylib/src
if [ -n "$WEB" ]; then
emcc -c rcore.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rshapes.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rtextures.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rtext.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rmodels.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c utils.c -Os -Wall -DPLATFORM_WEB
emcc -c raudio.c -Os -Wall -DPLATFORM_WEB
emar rcs libraylib.a rcore.o rshapes.o rtextures.o rtext.o rmodels.o utils.o raudio.o
mv libraylib.a ../../lib/web/
rm *.o
fi
make clean
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC
mv libraylib.a ../../lib/
mv raylib.h ../../include/
mv raymath.h ../../include/
mv rlgl.h ../../include/
mv rcamera.h ../../include/
mv rgestures.h ../../include/
cd ../..
rm -rf raylib
rm -rf bruter
rm include/bruter.h
git clone https://github.com/jardimdanificado/bruter -b experimental
cd bruter
EMCC=emcc ./build.sh
cd ..
rm lib/bruter.js lib/bruter.wasm lib/bruter.o
cp bruter/build/web/bruter.js lib/
cp bruter/build/web/bruter.wasm lib/
cp bruter/build/include/bruter.h include/
cd bruter
rm -rf build
EMCC=emcc WOUT='bruter.o -r' ./build.sh
cd ..
cp bruter/build/web/bruter.o lib/
rm -rf bruter
fi
emcc -o build/bruter.html src/main.c lib/bruter.o -Llib -Iinclude $RLPATH -s USE_GLFW=3 -s ASYNCIFY --shell-file src/minshell.html
mv build/bruter.html build/index.html