2018-02-15 00:26:40 +00:00
|
|
|
all: js/verilator_bin.js wasm/verilator_bin.js
|
|
|
|
|
|
|
|
js/%.js: js/%.bc
|
|
|
|
emcc -Oz --memory-init-file 0 \
|
|
|
|
-s ASM_JS=1 \
|
|
|
|
-s MODULARIZE=1 \
|
|
|
|
-s EXPORT_NAME=\"'$*'\" \
|
2020-06-08 21:36:33 +00:00
|
|
|
-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["FS","callMain"]' \
|
2018-02-15 00:26:40 +00:00
|
|
|
-s FORCE_FILESYSTEM=1 \
|
|
|
|
$< -o $@ $(ARGS_$*) \
|
|
|
|
|
|
|
|
wasm/%.js: js/%.bc
|
|
|
|
emcc -Oz --memory-init-file 0 \
|
|
|
|
-s WASM=1 \
|
|
|
|
-s MODULARIZE=1 \
|
|
|
|
-s BINARYEN_ASYNC_COMPILATION=0 \
|
|
|
|
-s TOTAL_MEMORY=256MB \
|
|
|
|
-s NO_EXIT_RUNTIME=1 \
|
|
|
|
-s EXPORT_NAME=\"'$*'\" \
|
2020-06-08 21:36:33 +00:00
|
|
|
-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["FS","callMain"]' \
|
2018-02-15 00:26:40 +00:00
|
|
|
-s FORCE_FILESYSTEM=1 \
|
|
|
|
$< -o $@ $(ARGS_$*) \
|
|
|
|
|
|
|
|
|
|
|
|
mainwasm/%.js: js/%.bc
|
|
|
|
emcc -Oz --memory-init-file 0 \
|
|
|
|
-s WASM=1 \
|
|
|
|
-s EXPORT_NAME=\"'$*'\" \
|
2020-06-08 21:36:33 +00:00
|
|
|
-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["FS","callMain"]' \
|
2018-02-15 00:26:40 +00:00
|
|
|
-s FORCE_FILESYSTEM=1 \
|
|
|
|
$< -o $@ $(ARGS_$*) \
|
|
|
|
|
|
|
|
|
|
|
|
debugjs/%.js: js/%.bc
|
|
|
|
emcc -O1 --memory-init-file 0 \
|
|
|
|
-s ASM_JS=1 \
|
|
|
|
-s MODULARIZE=1 \
|
|
|
|
-s EXPORT_NAME=\"'$*'\" \
|
2020-06-08 21:36:33 +00:00
|
|
|
-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["FS","callMain"]' \
|
2018-02-15 00:26:40 +00:00
|
|
|
-s FORCE_FILESYSTEM=1 \
|
|
|
|
$< -o $@ $(ARGS_$*) \
|
|
|
|
|
|
|
|
js/fssdcc.js:
|
|
|
|
ln -s ./sdcc/device/include include
|
|
|
|
ln -s ./sdcc/device/lib/build lib
|
|
|
|
python $(EMSCRIPTEN)/tools/file_packager.py js/fssdcc.data \
|
|
|
|
--preload include lib/z80 \
|
|
|
|
--separate-metadata --js-output=js/fssdcc.js
|