All I can really say is that this works in my current setup. This current setup was not the first setup I tried, with lots of random flailing around emscripten and binaryen versions to be compatible with my LLVM version. Perhaps later emscripten needs slightly different flags to export functions, who knows. Signed-off-by: Ilia Mirkin <imirkin@xxxxxxxxxxxx> --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 6db6386..49ad39b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ bindir ?= /usr/bin mandir ?= /usr/share/man +EMXX ?= em++ + SOURCES = edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \ parse-displayid-block.cpp parse-ls-ext-block.cpp \ parse-di-ext-block.cpp parse-vtb-ext-block.cpp @@ -13,6 +15,9 @@ sha = -DSHA=$(shell if [ -d .git ]; then git rev-parse HEAD ; else printf '"not edid-decode: $(SOURCES) edid-decode.h Makefile $(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) -g $(sha) -o $@ $(SOURCES) -lm +edid-decode.js: $(SOURCES) edid-decode.h Makefile + $(EMXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) $(sha) -s EXPORTED_FUNCTIONS='["_parse_edid"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -o $@ $(SOURCES) -lm + clean: rm -f edid-decode -- 2.24.1