@@ -24,14 +24,27 @@ CAMLOPT_PERF ?= $(OCAMLOPTP)
2424CAMLOPT_PERF_SHOW:=OCAMLOPTP
2525endif
2626CAMLEXTRAFLAGS ?=
27+
28+ JSOO_NO_INLINE?=1
29+ ifneq ($(JSOO_NO_INLINE),)
30+ JSOO_NO_INLINE_FLAG ?= --no-inline
31+ else
32+ JSOO_NO_INLINE_FLAG ?=
33+ endif
34+ EMIT_WAT?=1
35+ ifneq ($(EMIT_WAT),)
36+ EMIT_WAT_FLAG ?= --debug wat
37+ else
38+ EMIT_WAT_FLAG ?=
39+ endif
2740JS_OF_OCAML ?= js_of_ocaml
2841WASM_OF_OCAML ?= wasm_of_ocaml
2942STANDALONE_CAMLFLAGS ?= -package unix -w -20 -g $(CAMLEXTRAFLAGS)
3043STANDALONE_JS_CAMLFLAGS ?= -package js_of_ocaml $(STANDALONE_CAMLFLAGS)
3144JS_OF_OCAML_EXTRAFLAGS ?=
32- JS_OF_OCAML_FLAGS ?= --source-map --no-inline --enable=effects $(JS_OF_OCAML_EXTRAFLAGS)
45+ JS_OF_OCAML_FLAGS ?= --source-map $(JSOO_NO_INLINE_FLAG) --enable=effects $(JS_OF_OCAML_EXTRAFLAGS)
3346WASM_OF_OCAML_EXTRAFLAGS ?=
34- WASM_OF_OCAML_FLAGS ?= --source-map --no-inline $(WASM_OF_OCAML_EXTRAFLAGS)
47+ WASM_OF_OCAML_FLAGS ?= --source-map $(JSOO_NO_INLINE_FLAG) $(EMIT_WAT_FLAG) $(WASM_OF_OCAML_EXTRAFLAGS)
3548
3649PACKAGE ?= standalone.tar.gz
3750PACKAGE_CMD ?= tar -czvf
@@ -112,7 +125,10 @@ standalone-haskell: standalone-unified-haskell standalone-separate-haskell
112125standalone-unified-haskell: $(UNIFIED_STANDALONE_HASKELL:%=src/ExtractionHaskell/%)
113126standalone-separate-haskell: $(SEPARATE_STANDALONE_HASKELL:%=src/ExtractionHaskell/%)
114127standalone-js-of-ocaml: $(STANDALONE_JS_OF_OCAML:%=src/ExtractionJsOfOCaml/%.js)
115- standalone-wasm-of-ocaml: $(STANDALONE_WASM_OF_OCAML:%=src/ExtractionJsOfOCaml/%.wasm) $(STANDALONE_WASM_OF_OCAML:%=src/ExtractionJsOfOCaml/%.wat.gz)
128+ standalone-wasm-of-ocaml: $(STANDALONE_WASM_OF_OCAML:%=src/ExtractionJsOfOCaml/%.wasm)
129+ ifneq ($(EMIT_WAT),)
130+ standalone-wasm-of-ocaml: $(STANDALONE_WASM_OF_OCAML:%=src/ExtractionJsOfOCaml/%.wat.gz)
131+ endif
116132
117133uninstall-standalone-ocaml:: FILESTOINSTALL=$(OCAML_BINARIES)
118134uninstall-standalone-unified-ocaml:: FILESTOINSTALL=$(UNIFIED_OCAML_BINARIES)
0 commit comments