rv32emu
rv32emu copied to clipboard
Support hosting WebAssembly demo page locally
To enhance the user experience of using WebAssembly version of rv32emu, we shall provide a Makefile target (serve-wasm) to serve the WebAssembly demo page in an easy way.
Since rv32emu leverages TCO (tail call optimization) when being compiled, so we have to tell if the user's browser supports TCO. Currently, only Chrome with MAJOR 112 and Firefox with MAJOR 121 supports TCO execution runtime, thus we focus on this two browsers. Also, use color text to remind the users if they need to update their Chrome or Firefox.
See also: #75
Run make CC=emcc start-web
to test it.
Note that you should install emcc then source your emcc firstly. In macOS or Linux, use source ~/emsdk/emsdk_env.sh
.
Move WebAssembly related rules to
mk/wasm.mk
.
Done.
README will be updated on future PR.
Update
README.md
to reflect the proposed changes.
Done.
Thank @ChinYikMing for contributing!