Commit 9e2a0ca1 authored by Jaromil's avatar Jaromil
Browse files

fixes to javascript build flags

parent 9eddb8a0
......@@ -46,17 +46,17 @@ apply-patches:
# TODO: improve flags according to
# https://github.com/kripken/emscripten/blob/master/src/settings.js
js-node: cflags += -DARCH_JS -D'ARCH=\"JS\"'
js-node: apply-patches lua53 milagro lpeglabel
javascript-node: cflags += -DARCH_JS -D'ARCH=\"JS\"'
javascript-node: apply-patches lua53 milagro lpeglabel
CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
make -C src js
@mkdir -p build/nodejs
@cp -v src/zenroom.js build/nodejs/
@cp -v src/zenroom.js.mem build/nodejs/
js-wasm: cflags += -DARCH_WASM -D'ARCH=\"WASM\"'
js-wasm: ldflags += -s WASM=1 -s MODULARIZE=1
js-wasm: apply-patches lua53 milagro lpeglabel
javascript-wasm: cflags += -DARCH_WASM -D'ARCH=\"WASM\"'
javascript-wasm: ldflags += -s WASM=1 -s MODULARIZE=1
javascript-wasm: apply-patches lua53 milagro lpeglabel
CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
make -C src js
@mkdir -p build/wasm
......@@ -64,9 +64,9 @@ js-wasm: apply-patches lua53 milagro lpeglabel
@cp -v src/zenroom.wasm build/wasm/
js-demo: cflags += -DARCH_WASM -D'ARCH=\"WASM\"'
js-demo: ldflags += -s WASM=1 -s ASSERTIONS=1 --shell-file ${extras}/shell_minimal.html -s NO_EXIT_RUNTIME=1
js-demo: apply-patches lua53 milagro lpeglabel
javascript-demo: cflags += -DARCH_WASM -D'ARCH=\"WASM\"'
javascript-demo: ldflags += -s WASM=1 -s ASSERTIONS=1 --shell-file ${extras}/shell_minimal.html -s NO_EXIT_RUNTIME=1
javascript-demo: apply-patches lua53 milagro lpeglabel
CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
make -C src js-demo
......
......@@ -68,14 +68,13 @@ ldflags := -lm
system := Darwin
endif
ifneq (,$(findstring js,$(MAKECMDGOALS)))
ifneq (,$(findstring javascript,$(MAKECMDGOALS)))
gcc := ${EMSCRIPTEN}/emcc
ar := ${EMSCRIPTEN}/emar
ld := ${gcc}
system:= Javascript
ldflags := -s "EXPORTED_FUNCTIONS='[\"_zenroom_exec\",\"_zenroom_exec_tobuf\",\"_zenroom_parse_ast\",\"_set_debug\"]'" -s "EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\",\"cwrap\"]'" -s USE_SDL=0 -s USE_PTHREADS=0
ldflags := -s "EXPORTED_FUNCTIONS='[\"_zenroom_exec\",\"_zenroom_exec_tobuf\",\"_zenroom_parse_ast\",\"_set_debug\"]'" -s "EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\",\"cwrap\"]'" -s USE_SDL=0 -s USE_PTHREADS=0 -lm
cflags := -O2 -Wall -I ${EMSCRIPTEN}/system/include/libc -DLIBRARY
ldflags := -lm
endif
ifneq (,$(findstring esp32,$(MAKECMDGOALS)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment