-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathbuild_wasm.sh
executable file
·34 lines (27 loc) · 1.23 KB
/
build_wasm.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
#!/bin/bash
mkdir build
cd build
PATH=$PATH:~/Documents/git/ext/emsdk/upstream/emscripten
PATH=$PATH:~/Documents/git/ext/emsdk/upstream/bin
INCLUDES="\
-I ../../../os_platform/common/include
-I ../../../os_host/source"
SOURCE="\
../../../os_platform/wasm/source/wasmmain.cpp \
../main.cpp \
../CharMap.cpp \
../../../os_platform/common/source/framework/framework.cpp \
../../../os_platform/common/source/bios/dbg.cpp \
../../../os_platform/common/source/bios/gpio.cpp \
../../../os_platform/common/source/bios/key.cpp \
../../../os_platform/common/source/bios/lcd.cpp \
../../../os_platform/common/source/bios/fat.cpp \
../../../os_platform/common/source/bios/memory.cpp \
../../../os_platform/common/source/bios/sys.cpp"
NAME=charmap
BASE=http://localhost:8080/apps/
EXPORTED="['_appLoop', '_appInit', '_appFinish']"
CONFIGURATION="-s TOTAL_STACK=1024 -s TOTAL_MEMORY=65536 -s MINIMAL_RUNTIME=1 -s WASM=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s WARN_ON_UNDEFINED_SYMBOLS=0"
DEFINES="-DEMULATED -DEMSCRIPTEN -DLA104"
emcc $INCLUDES $SOURCE -gsource-map -O3 --std=c++11 $CONFIGURATION $DEFINES --source-map-base $BASE -s EXPORTED_FUNCTIONS="${EXPORTED}" -o $NAME.js || exit 1
node ../../../os_platform/wasm/htmllite/package.js $NAME