Skip to content

Commit b1e4cef

Browse files
committed
Gate --debug wat and --no-inline with makefile flags
1 parent 88628c7 commit b1e4cef

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

Makefile.standalone

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,27 @@ CAMLOPT_PERF ?= $(OCAMLOPTP)
2424
CAMLOPT_PERF_SHOW:=OCAMLOPTP
2525
endif
2626
CAMLEXTRAFLAGS ?=
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
2740
JS_OF_OCAML ?= js_of_ocaml
2841
WASM_OF_OCAML ?= wasm_of_ocaml
2942
STANDALONE_CAMLFLAGS ?= -package unix -w -20 -g $(CAMLEXTRAFLAGS)
3043
STANDALONE_JS_CAMLFLAGS ?= -package js_of_ocaml $(STANDALONE_CAMLFLAGS)
3144
JS_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)
3346
WASM_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

3649
PACKAGE ?= standalone.tar.gz
3750
PACKAGE_CMD ?= tar -czvf
@@ -112,7 +125,10 @@ standalone-haskell: standalone-unified-haskell standalone-separate-haskell
112125
standalone-unified-haskell: $(UNIFIED_STANDALONE_HASKELL:%=src/ExtractionHaskell/%)
113126
standalone-separate-haskell: $(SEPARATE_STANDALONE_HASKELL:%=src/ExtractionHaskell/%)
114127
standalone-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

117133
uninstall-standalone-ocaml:: FILESTOINSTALL=$(OCAML_BINARIES)
118134
uninstall-standalone-unified-ocaml:: FILESTOINSTALL=$(UNIFIED_OCAML_BINARIES)

0 commit comments

Comments
 (0)