From af54a4275469a622f08d514f42a16edce3090c8e Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Wed, 14 Jun 2023 22:36:22 +0200 Subject: [PATCH 01/23] remove winmake.bat --- interpreter/Makefile | 30 ++++------------- interpreter/winmake.bat | 75 ----------------------------------------- 2 files changed, 7 insertions(+), 98 deletions(-) delete mode 100644 interpreter/winmake.bat diff --git a/interpreter/Makefile b/interpreter/Makefile index 740554d3a5..3479dad75d 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -1,4 +1,4 @@ -# This Makefile uses ocamlbuild but does not rely on ocamlfind or the Opam +# This Makefile uses dune but does not rely on ocamlfind or the Opam # package manager to build. However, Opam package management is available # optionally through the check/install/uninstall targets. # @@ -15,10 +15,9 @@ OPT = $(NAME) LIB = $(NAME) ZIP = $(NAME).zip JSLIB = wast -WINMAKE = winmake.bat DIRS = util syntax binary text valid runtime exec script host main tests -LIBS = +LIBS = FLAGS = -lexflags -ml -cflags '-w +a-4-27-42-44-45-70 -warn-error +a-3' OCBA = ocamlbuild $(FLAGS) $(DIRS:%=-I %) OCB = $(OCBA) $(LIBS:%=-libs %) @@ -28,7 +27,7 @@ JS = # set to JS shell command to run JS tests, empty to skip # Main targets -.PHONY: default opt unopt libopt libunopt jslib all land zip smallint dunebuild +.PHONY: default opt unopt libopt libunopt jslib all zip smallint dunebuild default: opt debug: unopt @@ -38,10 +37,9 @@ libopt: _build/$(LIB).cmx _build/$(LIB).cmxa libunopt: _build/$(LIB).cmo _build/$(LIB).cma jslib: $(JSLIB).js all: unopt opt libunopt libopt test -land: $(WINMAKE) all -zip: $(ZIP) +zip: $(ZIP) smallint: smallint.native -ci: land jslib dunebuild +ci: all jslib dunebuild dunebuild: dune build @@ -121,20 +119,6 @@ $(JSLIB).byte: $(JSLIB_DIR)/$(JSLIB).ml $(JSLIB).js: $(JSLIB).byte $(JSO) $< -# Building Windows build file - -$(WINMAKE): clean - echo rem Auto-generated from Makefile! >$@ - echo set NAME=$(NAME) >>$@ - echo if \'%1\' neq \'\' set NAME=%1 >>$@ - $(OCB) main.byte \ - | grep -v ocamldep \ - | grep -v mkdir \ - | sed s:`which ocaml`:ocaml:g \ - | sed s:main/main.d.byte:%NAME%.exe: \ - >>$@ - - # Executing test suite TESTDIR = ../test/core @@ -182,8 +166,8 @@ dunetest: .PHONY: clean -$(ZIP): $(WINMAKE) - git archive --format=zip --prefix=$(NAME)/ -o $@ HEAD +$(ZIP): + git archive --format=zip --prefix=$(NAME)/ -o $@ HEAD clean: rm -rf _build/jslib $(LIB).mlpack _tags $(JSLIB).js diff --git a/interpreter/winmake.bat b/interpreter/winmake.bat deleted file mode 100644 index 6ff7e8caae..0000000000 --- a/interpreter/winmake.bat +++ /dev/null @@ -1,75 +0,0 @@ -rem Auto-generated from Makefile! -set NAME=wasm -if '%1' neq '' set NAME=%1 -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/numeric_error.cmo exec/numeric_error.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/int.cmo exec/int.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/lib.cmi util/lib.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/i32.cmo exec/i32.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/float.cmo exec/float.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I syntax -I main -I text -I binary -I exec -I script -I runtime -I util -I host -I valid -o syntax/types.cmo syntax/types.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/f32.cmo exec/f32.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/f64.cmo exec/f64.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/i64.cmo exec/i64.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I syntax -I main -I text -I binary -I exec -I script -I runtime -I util -I host -I valid -o syntax/values.cmo syntax/values.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/memory.cmi runtime/memory.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/source.cmi util/source.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I syntax -I main -I text -I binary -I exec -I script -I runtime -I util -I host -I valid -o syntax/ast.cmo syntax/ast.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/func.cmi runtime/func.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/global.cmi runtime/global.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/table.cmi runtime/table.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/instance.cmo runtime/instance.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/eval.cmi exec/eval.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I binary -I main -I syntax -I text -I exec -I script -I runtime -I util -I host -I valid -o binary/utf8.cmi binary/utf8.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I host -I main -I syntax -I text -I binary -I exec -I script -I runtime -I util -I valid -o host/env.cmo host/env.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I main -I syntax -I text -I binary -I exec -I script -I runtime -I util -I host -I valid -o main/flags.cmo main/flags.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I script -I main -I syntax -I text -I binary -I exec -I runtime -I util -I host -I valid -o script/import.cmi script/import.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I script -I main -I syntax -I text -I binary -I exec -I runtime -I util -I host -I valid -o script/run.cmi script/run.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I host -I main -I syntax -I text -I binary -I exec -I script -I runtime -I util -I valid -o host/spectest.cmo host/spectest.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I main -I syntax -I text -I binary -I exec -I script -I runtime -I util -I host -I valid -o main/main.cmo main/main.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/error.cmi util/error.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I script -I main -I syntax -I text -I binary -I exec -I runtime -I util -I host -I valid -o script/script.cmo script/script.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I binary -I main -I syntax -I text -I exec -I script -I runtime -I util -I host -I valid -o binary/decode.cmi binary/decode.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I binary -I main -I syntax -I text -I exec -I script -I runtime -I util -I host -I valid -o binary/encode.cmi binary/encode.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I script -I main -I syntax -I text -I binary -I exec -I runtime -I util -I host -I valid -o script/js.cmi script/js.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/parse.cmi text/parse.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/print.cmi text/print.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I valid -I main -I syntax -I text -I binary -I exec -I script -I runtime -I util -I host -o valid/valid.cmi valid/valid.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I script -I main -I syntax -I text -I binary -I exec -I runtime -I util -I host -I valid -o script/import.cmo script/import.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I script -I main -I syntax -I text -I binary -I exec -I runtime -I util -I host -I valid -o script/run.cmo script/run.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I binary -I main -I syntax -I text -I exec -I script -I runtime -I util -I host -I valid -o binary/utf8.cmo binary/utf8.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/eval_numeric.cmi exec/eval_numeric.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/i64_convert.cmi exec/i64_convert.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/eval.cmo exec/eval.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/func.cmo runtime/func.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/source.cmo util/source.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/f32_convert.cmi exec/f32_convert.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/f64_convert.cmi exec/f64_convert.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/i32_convert.cmi exec/i32_convert.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/error.cmo util/error.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/eval_numeric.cmo exec/eval_numeric.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/global.cmo runtime/global.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/i64_convert.cmo exec/i64_convert.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/lib.cmo util/lib.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/memory.cmo runtime/memory.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I runtime -I main -I syntax -I text -I binary -I exec -I script -I util -I host -I valid -o runtime/table.cmo runtime/table.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/f32_convert.cmo exec/f32_convert.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/f64_convert.cmo exec/f64_convert.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I exec -I main -I syntax -I text -I binary -I script -I runtime -I util -I host -I valid -o exec/i32_convert.cmo exec/i32_convert.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I syntax -I main -I text -I binary -I exec -I script -I runtime -I util -I host -I valid -o syntax/operators.cmo syntax/operators.ml -ocamlyacc text/parser.mly -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/parser.cmi text/parser.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/lexer.cmi text/lexer.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/sexpr.cmi util/sexpr.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/arrange.cmi text/arrange.mli -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I binary -I main -I syntax -I text -I exec -I script -I runtime -I util -I host -I valid -o binary/decode.cmo binary/decode.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I binary -I main -I syntax -I text -I exec -I script -I runtime -I util -I host -I valid -o binary/encode.cmo binary/encode.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I script -I main -I syntax -I text -I binary -I exec -I runtime -I util -I host -I valid -o script/js.cmo script/js.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/parse.cmo text/parse.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/print.cmo text/print.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I valid -I main -I syntax -I text -I binary -I exec -I script -I runtime -I util -I host -o valid/valid.cmo valid/valid.ml -ocamllex.opt -q text/lexer.mll -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/lexer.cmo text/lexer.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/parser.cmo text/parser.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I text -I main -I syntax -I binary -I exec -I script -I runtime -I util -I host -I valid -o text/arrange.cmo text/arrange.ml -ocamlc.opt -c -w +a-3-4-27-42-44-45 -warn-error +a -I util -I main -I syntax -I text -I binary -I exec -I script -I runtime -I host -I valid -o util/sexpr.cmo util/sexpr.ml -ocamlc.opt bigarray.cma -I util -I binary -I exec -I syntax -I runtime -I host -I main -I script -I text -I valid util/lib.cmo binary/utf8.cmo exec/float.cmo exec/f32.cmo exec/f64.cmo exec/numeric_error.cmo exec/int.cmo exec/i32.cmo exec/i64.cmo exec/i32_convert.cmo exec/f32_convert.cmo exec/i64_convert.cmo exec/f64_convert.cmo syntax/types.cmo syntax/values.cmo runtime/memory.cmo util/source.cmo syntax/ast.cmo exec/eval_numeric.cmo runtime/func.cmo runtime/global.cmo runtime/table.cmo runtime/instance.cmo util/error.cmo exec/eval.cmo host/env.cmo host/spectest.cmo main/flags.cmo script/import.cmo binary/encode.cmo syntax/operators.cmo binary/decode.cmo script/script.cmo text/parser.cmo text/lexer.cmo text/parse.cmo script/js.cmo util/sexpr.cmo text/arrange.cmo text/print.cmo valid/valid.cmo script/run.cmo main/main.cmo -o main/main.byte From 6e7cccc6afea1f4b7d91f9719809c15f5d91f3b8 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Wed, 14 Jun 2023 23:03:11 +0200 Subject: [PATCH 02/23] switch the Makefile to dune --- interpreter/Makefile | 171 +++++--------------------- interpreter/README.md | 17 +-- interpreter/dune | 19 ++- interpreter/{meta => }/jslib/wast.ml | 1 + interpreter/main/{main.ml => wasm.ml} | 0 interpreter/meta/findlib/META | 4 - 6 files changed, 44 insertions(+), 168 deletions(-) rename interpreter/{meta => }/jslib/wast.ml (99%) rename interpreter/main/{main.ml => wasm.ml} (100%) delete mode 100644 interpreter/meta/findlib/META diff --git a/interpreter/Makefile b/interpreter/Makefile index 3479dad75d..e7997e0815 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -9,115 +9,39 @@ # Configuration -NAME = wasm -UNOPT = $(NAME).debug -OPT = $(NAME) -LIB = $(NAME) -ZIP = $(NAME).zip -JSLIB = wast - -DIRS = util syntax binary text valid runtime exec script host main tests -LIBS = -FLAGS = -lexflags -ml -cflags '-w +a-4-27-42-44-45-70 -warn-error +a-3' -OCBA = ocamlbuild $(FLAGS) $(DIRS:%=-I %) -OCB = $(OCBA) $(LIBS:%=-libs %) -JSO = js_of_ocaml -q --opt 3 +OPT = wasm.exe +ZIP = wasm.zip +JSLIB = wast.bc.js + +BUILDDIR = _build/default + JS = # set to JS shell command to run JS tests, empty to skip # Main targets -.PHONY: default opt unopt libopt libunopt jslib all zip smallint dunebuild +.PHONY: default opt jslib all zip smallint -default: opt -debug: unopt -opt: $(OPT) -unopt: $(UNOPT) -libopt: _build/$(LIB).cmx _build/$(LIB).cmxa -libunopt: _build/$(LIB).cmo _build/$(LIB).cma -jslib: $(JSLIB).js -all: unopt opt libunopt libopt test +default: $(OPT) +jslib: $(JSLIB) +all: $(OPT) test zip: $(ZIP) -smallint: smallint.native -ci: all jslib dunebuild - -dunebuild: - dune build - +smallint: smallint.exe +ci: all jslib # Building executable +.PHONY: wasm.exe +wasm.exe: + dune build $@ -empty = -space = $(empty) $(empty) -comma = , - -.INTERMEDIATE: _tags -_tags: - echo >$@ "true: bin_annot" - echo >>$@ "true: debug" - echo >>$@ "<{$(subst $(space),$(comma),$(DIRS))}/*.cmx>: for-pack($(PACK))" - -$(UNOPT): main.byte - mv $< $@ - -$(OPT): main.native - mv $< $@ - -.PHONY: main.byte main.native -main.byte: _tags - $(OCB) -quiet $@ - -main.native: _tags - $(OCB) -quiet $@ - -.PHONY: smallint.byte smallint.native -smallint.byte: _tags - $(OCB) -quiet $@ -smallint.native: _tags - $(OCB) -quiet $@ - - -# Building library - -FILES = $(shell ls $(DIRS:%=%/*) | grep '[.]ml[^.]*$$') -PACK = $(shell echo `echo $(LIB) | sed 's/^\(.\).*$$/\\1/g' | tr [:lower:] [:upper:]``echo $(LIB) | sed 's/^.\(.*\)$$/\\1/g'`) - -.INTERMEDIATE: $(LIB).mlpack -$(LIB).mlpack: $(DIRS) - ls $(FILES) \ - | sed 's:\(.*/\)\{0,1\}\(.*\)\.[^\.]*:\2:' \ - | grep -v main \ - | sort | uniq \ - >$@ - -.INTERMEDIATE: $(LIB).mllib -$(LIB).mllib: - echo Wasm >$@ - -_build/$(LIB).cmo: $(FILES) $(LIB).mlpack _tags Makefile - $(OCB) -quiet $(LIB).cmo - -_build/$(LIB).cmx: $(FILES) $(LIB).mlpack _tags Makefile - $(OCB) -quiet $(LIB).cmx - -_build/$(LIB).cma: $(FILES) $(LIB).mllib _tags Makefile - $(OCBA) -quiet $(LIB).cma - -_build/$(LIB).cmxa: $(FILES) $(LIB).mllib _tags Makefile - $(OCBA) -quiet $(LIB).cmxa - +.PHONY: smallint.exe +smallint.exe: + dune build $@ # Building JavaScript library -JSLIB_DIR = meta/jslib -JSLIB_FLAGS = -I $(JSLIB_DIR) -use-ocamlfind -pkg js_of_ocaml -pkg js_of_ocaml-ppx - -.INTERMEDIATE: $(JSLIB).byte -$(JSLIB).byte: $(JSLIB_DIR)/$(JSLIB).ml - $(OCBA) $(JSLIB_FLAGS) $@ - -$(JSLIB).js: $(JSLIB).byte - $(JSO) $< +wast.bc.js: + dune build $@ # Executing test suite @@ -126,37 +50,30 @@ TESTDIR = ../test/core TESTFILES = $(shell cd $(TESTDIR); ls *.wast; ls [a-z]*/*.wast) TESTS = $(TESTFILES:%.wast=%) -.PHONY: test debugtest partest dune-test +.PHONY: test partest dune-test test: $(OPT) smallint - $(TESTDIR)/run.py --wasm `pwd`/$(OPT) $(if $(JS),--js '$(JS)',) - ./smallint.native -debugtest: $(UNOPT) smallint - $(TESTDIR)/run.py --wasm `pwd`/$(UNOPT) $(if $(JS),--js '$(JS)',) - ./smallint.native + $(TESTDIR)/run.py --wasm `pwd`/$(BUILDDIR)/$(OPT) $(if $(JS),--js '$(JS)',) + dune exec ./smallint.exe test/%: $(OPT) - $(TESTDIR)/run.py --wasm `pwd`/$(OPT) $(if $(JS),--js '$(JS)',) $(TESTDIR)/$*.wast -debugtest/%: $(UNOPT) - $(TESTDIR)/run.py --wasm `pwd`/$(UNOPT) $(if $(JS),--js '$(JS)',) $(TESTDIR)/$*.wast + $(TESTDIR)/run.py --wasm `pwd`/$(BUILDDIR)/$(OPT) $(if $(JS),--js '$(JS)',) $(TESTDIR)/$*.wast run/%: $(OPT) ./$(OPT) $(TESTDIR)/$*.wast -debug/%: $(UNOPT) - ./$(UNOPT) $(TESTDIR)/$*.wast -partest: $(TESTS:%=quiettest/%) +partest: $(TESTS:%=quiettest/%) @echo All tests passed. quiettest/%: $(OPT) @ ( \ - $(TESTDIR)/run.py 2>$(@F).out --wasm `pwd`/$(OPT) $(if $(JS),--js '$(JS)',) $(TESTDIR)/$*.wast && \ + $(TESTDIR)/run.py 2>$(@F).out --wasm `pwd`/$(BUILDDIR)/$(OPT) $(if $(JS),--js '$(JS)',) $(TESTDIR)/$*.wast && \ rm $(@F).out \ ) || \ cat $(@F).out || rm $(@F).out || exit 1 smallinttest: smallint - @./smallint.native + dune exec ./smallint.exe dunetest: dune test @@ -167,37 +84,7 @@ dunetest: .PHONY: clean $(ZIP): - git archive --format=zip --prefix=$(NAME)/ -o $@ HEAD + git archive --format=zip --prefix=wasm/ -o $@ HEAD clean: - rm -rf _build/jslib $(LIB).mlpack _tags $(JSLIB).js - $(OCB) -clean - - -# Opam support - -.PHONY: check install uninstall - -check: - # Check that we can find all relevant libraries - # when using ocamlfind - ocamlfind query $(LIBS) - -install: _build/$(LIB).cmx _build/$(LIB).cmo - ocamlfind install $(LIB) meta/findlib/META _build/$(LIB).o \ - $(wildcard _build/$(LIB).cm*) \ - $(wildcard $(DIRS:%=%/*.mli)) - -uninstall: - ocamlfind remove $(LIB) - -opam-release/%: - git tag opam-$* - git push --tags - rm -f opam-$*.zip - wget https://github.com/WebAssembly/spec/archive/opam-$*.zip - cp meta/opam/opam . - sed -i ".tmp" s/@VERSION/$*/g opam - sed -i ".tmp" s/@MD5/`md5 -q opam-$*.zip`/g opam - rm opam.tmp opam-$*.zip - @echo Created file ./opam, submit to github opam-repository/packages/wasm/wasm.$*/opam + dune clean diff --git a/interpreter/README.md b/interpreter/README.md index fc2a1827a4..870af355e2 100644 --- a/interpreter/README.md +++ b/interpreter/README.md @@ -22,10 +22,7 @@ Once you have OCaml, simply do ``` make ``` -You'll get an executable named `./wasm`. This is a byte code executable. If you want a (faster) native code executable, do -``` -make opt -``` +You'll get an executable named `_build/default/wasm.exe`. To run the test suite, ``` make test @@ -34,12 +31,6 @@ To do everything: ``` make all ``` -Before committing changes, you should do -``` -make land -``` -That builds `all`, plus updates `winmake.bat`. - #### Building on Windows @@ -49,12 +40,6 @@ The instructions depend on how you [installed OCaml on Windows](https://ocaml.or 2. *Windows Subsystem for Linux* (WSL): You can build the interpreter using `make`, as described above. -3. *From source*: If you just want to build the interpreter and don't care about modifying it, you don't need to install the Cygwin core that comes with the installer. Just install OCaml itself and run -``` -winmake.bat -``` -in a Windows shell, which creates a program named `wasm`. Note that this will be a byte code executable only, i.e., somewhat slower. - In any way, in order to run the test suite you'll need to have Python installed. If you used Option 3, you can invoke the test runner `runtests.py` directly instead of doing it through `make`. diff --git a/interpreter/dune b/interpreter/dune index 48274aad99..9c6db15b89 100644 --- a/interpreter/dune +++ b/interpreter/dune @@ -2,15 +2,15 @@ (library (name wasm) - ; The 'main' module shall not be part of the library, as it would start the + ; The 'wasm' module shall not be part of the library, as it would start the ; Wasm REPL every time in all the dependencies. ; We exclude the 'wast' module as it is only used for the JS build. ; 'smallint' is a separate test module. - (modules :standard \ main smallint wast)) + (modules :standard \ wasm smallint wast)) (executable - (name main) - (modules main) + (name wasm) + (modules wasm) (libraries wasm) (flags (-open Wasm))) @@ -22,6 +22,13 @@ (flags (-open Wasm))) +(executable + (name wast) + (modules wast) + (modes js) + (libraries js_of_ocaml wasm) + (preprocess (pps js_of_ocaml-ppx))) + (subdir text (rule @@ -42,10 +49,10 @@ (rule (alias runtest) (deps - ./main.exe + ./wasm.exe ./smallint.exe (source_tree ../test)) (action (progn - (run ../test/core/run.py --wasm ./main.exe) + (run ../test/core/run.py --wasm ./wasm.exe) (run ./smallint.exe)))) diff --git a/interpreter/meta/jslib/wast.ml b/interpreter/jslib/wast.ml similarity index 99% rename from interpreter/meta/jslib/wast.ml rename to interpreter/jslib/wast.ml index 9af04f9189..0ab4bd8fdd 100644 --- a/interpreter/meta/jslib/wast.ml +++ b/interpreter/jslib/wast.ml @@ -1,6 +1,7 @@ (* Implements a wrapper library that allows the use of the reference * interpreter's encode/decode functionality in JavaScript. *) +open Wasm open Js_of_ocaml let _ = diff --git a/interpreter/main/main.ml b/interpreter/main/wasm.ml similarity index 100% rename from interpreter/main/main.ml rename to interpreter/main/wasm.ml diff --git a/interpreter/meta/findlib/META b/interpreter/meta/findlib/META deleted file mode 100644 index 2c1d96dd03..0000000000 --- a/interpreter/meta/findlib/META +++ /dev/null @@ -1,4 +0,0 @@ -description = "A library for writing/reading/running WebAssembly binaries" -requires = "bigarray,str" -archive(byte) = "wasm.cmo" -archive(native) = "wasm.cmx" From b12aaee22f872e3bff815f0ac8127e4425cd0698 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:06:53 +0200 Subject: [PATCH 03/23] bring back $NAME in the Makefile --- interpreter/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index e7997e0815..b1c8bb0673 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -9,8 +9,9 @@ # Configuration -OPT = wasm.exe -ZIP = wasm.zip +NAME = wasm +OPT = $(NAME).exe +ZIP = $(NAME).zip JSLIB = wast.bc.js BUILDDIR = _build/default @@ -30,8 +31,8 @@ smallint: smallint.exe ci: all jslib # Building executable -.PHONY: wasm.exe -wasm.exe: +.PHONY: $(NAME).exe +$(NAME).exe: dune build $@ .PHONY: smallint.exe From 38e26c22b9240b066200dab4cb7f65b64ca2c78f Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:10:58 +0200 Subject: [PATCH 04/23] add wast.js rule --- interpreter/Makefile | 4 ++-- interpreter/dune | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index b1c8bb0673..dce29d46b1 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -12,7 +12,7 @@ NAME = wasm OPT = $(NAME).exe ZIP = $(NAME).zip -JSLIB = wast.bc.js +JSLIB = wast.js BUILDDIR = _build/default @@ -41,7 +41,7 @@ smallint.exe: # Building JavaScript library -wast.bc.js: +$(JSLIB): dune build $@ # Executing test suite diff --git a/interpreter/dune b/interpreter/dune index 9c6db15b89..f58f650710 100644 --- a/interpreter/dune +++ b/interpreter/dune @@ -29,6 +29,11 @@ (libraries js_of_ocaml wasm) (preprocess (pps js_of_ocaml-ppx))) +(rule + (targets wast.js) + (deps wast.bc.js) + (action (copy wast.bc.js wast.js))) + (subdir text (rule From 1fe1fff591edd2d986ff57b9e67aa495da4d21e9 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:13:52 +0200 Subject: [PATCH 05/23] add instructions on how to install dune --- interpreter/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interpreter/README.md b/interpreter/README.md index 870af355e2..9aa665a0f0 100644 --- a/interpreter/README.md +++ b/interpreter/README.md @@ -17,6 +17,8 @@ The text format defines modules in S-expression syntax. Moreover, it is generali You'll need OCaml 4.12 or higher. Instructions for installing a recent version of OCaml on multiple platforms are available [here](https://ocaml.org/docs/install.html). On most platforms, the recommended way is through [OPAM](https://ocaml.org/docs/install.html#OPAM). +You'll also need to install the dune build system. See the [installation instructions](https://github.com/ocaml/dune#installation-1). + Once you have OCaml, simply do ``` From 63adaf46b3b1ebba0ef1aa30d21e375928768bb3 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:15:53 +0200 Subject: [PATCH 06/23] update .gitignore --- interpreter/.gitignore | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/interpreter/.gitignore b/interpreter/.gitignore index 0a02ff708c..8de9ec68d3 100644 --- a/interpreter/.gitignore +++ b/interpreter/.gitignore @@ -1,13 +1,2 @@ -*.cmo -*.cmx -*.native -*.byte -*.opt -*.unopt -*.js -*.zip -*.mlpack _build wasm -wasm.debug - From 8e82fbe66d155c44e6fbccde72bd951fc728b650 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:17:38 +0200 Subject: [PATCH 07/23] bring back the wasm executable at the root of the interpreter directory when running make --- interpreter/Makefile | 2 ++ interpreter/README.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index dce29d46b1..02f5a8315b 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -34,6 +34,8 @@ ci: all jslib .PHONY: $(NAME).exe $(NAME).exe: dune build $@ + rm -f $(NAME) + cp $(BUILDDIR)/$(OPT) $(NAME) .PHONY: smallint.exe smallint.exe: diff --git a/interpreter/README.md b/interpreter/README.md index 9aa665a0f0..1df7ff715a 100644 --- a/interpreter/README.md +++ b/interpreter/README.md @@ -24,7 +24,7 @@ Once you have OCaml, simply do ``` make ``` -You'll get an executable named `_build/default/wasm.exe`. +You'll get an executable named `./wasm`. To run the test suite, ``` make test From 71715d2f56e8a9a941f5ab74ce8fa35674d18fd9 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:25:31 +0200 Subject: [PATCH 08/23] basic opam support --- interpreter/.gitignore | 1 + interpreter/Makefile | 3 +++ interpreter/dune | 4 ++-- interpreter/dune-project | 7 +++++++ interpreter/wasm.opam | 22 ++++++++++++++++++++++ 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 interpreter/wasm.opam diff --git a/interpreter/.gitignore b/interpreter/.gitignore index 8de9ec68d3..0a955945de 100644 --- a/interpreter/.gitignore +++ b/interpreter/.gitignore @@ -1,2 +1,3 @@ _build wasm +*.install diff --git a/interpreter/Makefile b/interpreter/Makefile index 02f5a8315b..d5509e036d 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -81,6 +81,9 @@ smallinttest: smallint dunetest: dune test +install: + dune build -p $(NAME) @install + dune install # Miscellaneous targets diff --git a/interpreter/dune b/interpreter/dune index f58f650710..6d56ae79d2 100644 --- a/interpreter/dune +++ b/interpreter/dune @@ -1,7 +1,7 @@ (include_subdirs unqualified) (library - (name wasm) + (public_name wasm) ; The 'wasm' module shall not be part of the library, as it would start the ; Wasm REPL every time in all the dependencies. ; We exclude the 'wast' module as it is only used for the JS build. @@ -9,7 +9,7 @@ (modules :standard \ wasm smallint wast)) (executable - (name wasm) + (public_name wasm) (modules wasm) (libraries wasm) (flags diff --git a/interpreter/dune-project b/interpreter/dune-project index c994249ac2..f579f3ce88 100644 --- a/interpreter/dune-project +++ b/interpreter/dune-project @@ -1 +1,8 @@ (lang dune 2.9) + +(name "wasm") + +(generate_opam_files true) + +(package + (name "wasm")) diff --git a/interpreter/wasm.opam b/interpreter/wasm.opam new file mode 100644 index 0000000000..09ef829e48 --- /dev/null +++ b/interpreter/wasm.opam @@ -0,0 +1,22 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +depends: [ + "dune" {>= "2.9"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "--promote-install-files=false" + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] + ["dune" "install" "-p" name "--create-install-files" name] +] From ecf6af731f3f3e710f263c86533ece9923b0fb18 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:32:22 +0200 Subject: [PATCH 09/23] makefile tweaks --- interpreter/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interpreter/Makefile b/interpreter/Makefile index d5509e036d..27c506f1e4 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -45,6 +45,8 @@ smallint.exe: $(JSLIB): dune build $@ + rm -f $@ + cp $(BUILDDIR)/$@ $@ # Executing test suite @@ -94,3 +96,4 @@ $(ZIP): clean: dune clean + rm -f $(NAME) $(JSLIB) From 0737b9baffef0e340afbb45a82d3c9e57944dc51 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Wed, 21 Jun 2023 16:06:19 +0200 Subject: [PATCH 10/23] Makefile fix --- interpreter/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index 27c506f1e4..9c6f989c8d 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -33,8 +33,8 @@ ci: all jslib # Building executable .PHONY: $(NAME).exe $(NAME).exe: - dune build $@ rm -f $(NAME) + dune build $@ cp $(BUILDDIR)/$(OPT) $(NAME) .PHONY: smallint.exe @@ -44,8 +44,8 @@ smallint.exe: # Building JavaScript library $(JSLIB): - dune build $@ rm -f $@ + dune build $@ cp $(BUILDDIR)/$@ $@ # Executing test suite From 02008712695ba57238bda497604988391517d893 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Wed, 21 Jun 2023 16:06:28 +0200 Subject: [PATCH 11/23] rename wasm.ml to main.ml --- interpreter/dune | 7 ++++++- interpreter/main/{wasm.ml => main.ml} | 0 2 files changed, 6 insertions(+), 1 deletion(-) rename interpreter/main/{wasm.ml => main.ml} (100%) diff --git a/interpreter/dune b/interpreter/dune index 6d56ae79d2..c0e9c292f3 100644 --- a/interpreter/dune +++ b/interpreter/dune @@ -6,7 +6,7 @@ ; Wasm REPL every time in all the dependencies. ; We exclude the 'wast' module as it is only used for the JS build. ; 'smallint' is a separate test module. - (modules :standard \ wasm smallint wast)) + (modules :standard \ main wasm smallint wast)) (executable (public_name wasm) @@ -29,6 +29,11 @@ (libraries js_of_ocaml wasm) (preprocess (pps js_of_ocaml-ppx))) +(rule + (targets wasm.ml) + (deps main/main.ml) + (action (copy main/main.ml wasm.ml))) + (rule (targets wast.js) (deps wast.bc.js) diff --git a/interpreter/main/wasm.ml b/interpreter/main/main.ml similarity index 100% rename from interpreter/main/wasm.ml rename to interpreter/main/main.ml From a6855a7ed8eb1d2b7771d717fd70554e5c0ee184 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 26 Jun 2023 16:45:50 +0200 Subject: [PATCH 12/23] use $(NAME) everywhere --- interpreter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index 9c6f989c8d..ad2affc6ae 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -92,7 +92,7 @@ install: .PHONY: clean $(ZIP): - git archive --format=zip --prefix=wasm/ -o $@ HEAD + git archive --format=zip --prefix=$(NAME)/ -o $@ HEAD clean: dune clean From 069c4e329392eadf482a9a8671ded1d9a6c984fb Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 26 Jun 2023 16:47:19 +0200 Subject: [PATCH 13/23] add a distclean target --- interpreter/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interpreter/Makefile b/interpreter/Makefile index ad2affc6ae..c77c972c22 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -96,4 +96,6 @@ $(ZIP): clean: dune clean + +distclean: rm -f $(NAME) $(JSLIB) From b37da56a6e7d04bf5e314b37510d33cf83126d91 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 26 Jun 2023 17:21:19 +0200 Subject: [PATCH 14/23] update .gitignore --- interpreter/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interpreter/.gitignore b/interpreter/.gitignore index 0a955945de..7ad4c8570c 100644 --- a/interpreter/.gitignore +++ b/interpreter/.gitignore @@ -1,3 +1,5 @@ _build wasm *.install +*.js +*.zip From f4265a21bc08ce348fefd0e9bf327a020747dea5 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 26 Jun 2023 18:52:41 +0200 Subject: [PATCH 15/23] fix distclean target --- interpreter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index c77c972c22..7ab0ade2d0 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -97,5 +97,5 @@ $(ZIP): clean: dune clean -distclean: +distclean: clean rm -f $(NAME) $(JSLIB) From 030a5ceeb7b2c5d8efd125fafeb671cc5b073e7c Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 24 Jul 2023 19:53:56 +0200 Subject: [PATCH 16/23] update dune-project --- interpreter/dune-project | 16 ++++++++++++++-- interpreter/wasm.opam | 10 ++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/interpreter/dune-project b/interpreter/dune-project index f579f3ce88..0d15135d31 100644 --- a/interpreter/dune-project +++ b/interpreter/dune-project @@ -1,8 +1,20 @@ (lang dune 2.9) -(name "wasm") +(name wasm) (generate_opam_files true) +(license Apache-2.0) + +(source + (github WebAssembly/spec)) + +(authors "Andreas Rossberg = 4.12)))) diff --git a/interpreter/wasm.opam b/interpreter/wasm.opam index 09ef829e48..5d5984106c 100644 --- a/interpreter/wasm.opam +++ b/interpreter/wasm.opam @@ -1,7 +1,16 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" +synopsis: + "Library to read and write WebAssembly (Wasm) files and manipulate their AST" +maintainer: ["Andreas Rossberg = "2.9"} + "ocaml" {>= "4.12"} "odoc" {with-doc} ] build: [ @@ -20,3 +29,4 @@ build: [ ] ["dune" "install" "-p" name "--create-install-files" name] ] +dev-repo: "git+https://github.com/WebAssembly/spec.git" From 0d5943e5057886f5a1db1e2cd457f26eecb1ee28 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 24 Jul 2023 19:57:20 +0200 Subject: [PATCH 17/23] remove meta --- interpreter/meta/opam/opam | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 interpreter/meta/opam/opam diff --git a/interpreter/meta/opam/opam b/interpreter/meta/opam/opam deleted file mode 100644 index 845fe675ec..0000000000 --- a/interpreter/meta/opam/opam +++ /dev/null @@ -1,23 +0,0 @@ -opam-version: "2.0" -maintainer: "Andreas Rossberg " -authors: "Andreas Rossberg " -homepage: "https://github.com/WebAssembly/spec" -bug-reports: "https://github.com/WebAssembly/spec/issues" -license: "Apache-2.0" -dev-repo: "git+https://github.com/WebAssembly/spec.git" -build: [ - [make "-C" "interpreter" "opt" "unopt"] -] -install: [make "-C" "interpreter" "install"] -depends: [ - "ocaml" {>= "4.12.0"} - "ocamlfind" {build} - "ocamlbuild" {build} -] -conflicts: ["ocaml-option-bytecode-only"] # uses ocamlopt unconconditionally -synopsis: - "Library to read and write WebAssembly (Wasm) files and manipulate their AST" -url { - src: "https://github.com/WebAssembly/spec/archive/opam-@VERSION.zip" - checksum: "md5=@MD5" -} From c02251b22d7e7ee8f16024a3b9618c9f3ed87d51 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 24 Jul 2023 21:21:45 +0200 Subject: [PATCH 18/23] fix jslib --- interpreter/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index 7ab0ade2d0..2c6d6e94b7 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -43,10 +43,11 @@ smallint.exe: # Building JavaScript library -$(JSLIB): - rm -f $@ - dune build $@ - cp $(BUILDDIR)/$@ $@ +$(JSLIB): $(BUILDDIR)/$(JSLIB) + cp $< $@ + +$(BUILDDIR)/$(JSLIB): + dune build $(JSLIB) # Executing test suite From 665f1c201155958fb3a3e790834c886aa40d2c5d Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 25 Jul 2023 10:57:48 +0200 Subject: [PATCH 19/23] opam-release --- interpreter/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interpreter/Makefile b/interpreter/Makefile index 2c6d6e94b7..2bca80d644 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -88,6 +88,13 @@ install: dune build -p $(NAME) @install dune install +.PHONY: opam-release + +opam-release/%: + git tag opam-$* + git push --tags + opam publish + # Miscellaneous targets .PHONY: clean From 4078ca6688ac00303ef3a310538f3ff2f8b01397 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 25 Jul 2023 11:27:04 +0200 Subject: [PATCH 20/23] remove phony --- interpreter/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index 2bca80d644..5609c35fcb 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -88,8 +88,6 @@ install: dune build -p $(NAME) @install dune install -.PHONY: opam-release - opam-release/%: git tag opam-$* git push --tags From b35a792574af08eecd7d2da6b36d1ec73935eda9 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 25 Jul 2023 17:53:09 +0200 Subject: [PATCH 21/23] opam release --- interpreter/.gitignore | 1 + interpreter/Makefile | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/interpreter/.gitignore b/interpreter/.gitignore index 7ad4c8570c..ced4eafb60 100644 --- a/interpreter/.gitignore +++ b/interpreter/.gitignore @@ -3,3 +3,4 @@ wasm *.install *.js *.zip +opam diff --git a/interpreter/Makefile b/interpreter/Makefile index 5609c35fcb..465b962503 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -91,7 +91,17 @@ install: opam-release/%: git tag opam-$* git push --tags - opam publish + rm -f opam-$*.zip + wget https://github.com/WebAssembly/spec/archive/opam-$*.zip + cp wasm.opam opam + echo 'url {' >> opam + echo ' src: "https://github.com/WebAssembly/spec/archive/opam-@VERSION.zip"' >> opam + echo ' checksum: "md5=@MD5"' >> opam + echo '}' >> opam + sed -i ".tmp" s/@VERSION/$*/g opam + sed -i ".tmp" s/@MD5/`md5 -q opam-$*.zip`/g opam + rm opam.tmp opam-$*.zip + @echo Created file ./opam, submit to github opam-repository/packages/wasm/wasm.$*/opam # Miscellaneous targets From 5dca9fb41492c65f2df09dd2179fce466c319a04 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Wed, 26 Jul 2023 09:36:16 +0200 Subject: [PATCH 22/23] Update interpreter/Makefile Co-authored-by: Andreas Rossberg --- interpreter/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index 465b962503..d4652492a2 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -95,12 +95,10 @@ opam-release/%: wget https://github.com/WebAssembly/spec/archive/opam-$*.zip cp wasm.opam opam echo 'url {' >> opam - echo ' src: "https://github.com/WebAssembly/spec/archive/opam-@VERSION.zip"' >> opam - echo ' checksum: "md5=@MD5"' >> opam - echo '}' >> opam - sed -i ".tmp" s/@VERSION/$*/g opam - sed -i ".tmp" s/@MD5/`md5 -q opam-$*.zip`/g opam - rm opam.tmp opam-$*.zip + echo " src: \"https://github.com/WebAssembly/spec/archive/opam-$*.zip\"" >> opam + echo " checksum: \"md5=`md5 -q opam-$*.zip`\"" >> opam + echo "}" >> opam + rm opam-$*.zip @echo Created file ./opam, submit to github opam-repository/packages/wasm/wasm.$*/opam # Miscellaneous targets From df5be7cd19900ecba7820facb0db7f91c228e8fe Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Wed, 26 Jul 2023 12:25:26 +0200 Subject: [PATCH 23/23] makefile style --- interpreter/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreter/Makefile b/interpreter/Makefile index d4652492a2..d67882b294 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -94,7 +94,7 @@ opam-release/%: rm -f opam-$*.zip wget https://github.com/WebAssembly/spec/archive/opam-$*.zip cp wasm.opam opam - echo 'url {' >> opam + echo "url {" >> opam echo " src: \"https://github.com/WebAssembly/spec/archive/opam-$*.zip\"" >> opam echo " checksum: \"md5=`md5 -q opam-$*.zip`\"" >> opam echo "}" >> opam