Skip to content

Instantly share code, notes, and snippets.

@willscott
Created June 11, 2019 14:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willscott/a7062bfa80b14d610b39f06b1506cdc4 to your computer and use it in GitHub Desktop.
Save willscott/a7062bfa80b14d610b39f06b1506cdc4 to your computer and use it in GitHub Desktop.
Wasm source map compilation
.PHONY: all
all: rot13.wasm
%.wasm.full: %.c
clang $< -g -o $@
%.wasm.dwarf: %.wasm.full
llvm-dwarfdump $< > $@
%.wasm: %.wasm.full %.wasm.dwarf
../vendor/emscripten/tools/wasm-sourcemap.py $< -w $@ -p $(CURDIR) -s -u ./$(@:.wasm=.wasm.map) -o $(@:.wasm=.wasm.map) --dwarfdump-output=$(@:.wasm=.wasm.dwarf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment