Something went wrong. Try again.
READ-ONLY MIRROR of the previous soteria repo
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174# [versionsync: OCAML_VERSION=5.4.0]OCAML_VERSION=5.4.0# [versionsync: OCAMLFORMAT_VERSION=0.28.1]OCAMLFORMAT_VERSION=0.28.1
OPAM=opamOPAMX=$(OPAM) exec --DUNE=$(OPAMX) duneWHICHX=$(DUNE) exec -- which
YARN=yarn
DYLIB_LIST_FILE=packaging/soteria-c/macOS_dylibs.txtPACKAGING_BIN=$(DUNE) exec -- packaging/soteria-c/package.exeSOTERIA_C_BIN=_build/install/default/bin/soteria-cVSCODE_BC_JS=vscode/src/soteria_vscode.bc.js
SOTERIA_RUST_DYLIB_LIST_FILE=packaging/soteria-rust/macOS_dylibs.txtSOTERIA_RUST_PACKAGING_BIN=$(DUNE) exec -- packaging/soteria-rust/package.exeSOTERIA_RUST_BIN=_build/install/default/bin/soteria-rust
SOTERIA_C_PACKAGE=packages/soteria-cSOTERIA_RUST_PACKAGE=packages/soteria-rustVSCODE_DIST=dist
##### Normal ocaml stuff #####.PHONY: ocamlocaml: $(DUNE) build
.PHONY: ocaml-format-checkocaml-format-check: $(DUNE) build @fmt
.PHONY: check-opam-filescheck-opam-files: @git diff --name-only HEAD | grep -q '\.opam$$' && echo "Error: .opam files have changed since last commit" && exit 1 || exit 0
.PHONY: ocaml-testocaml-test: $(DUNE) test
.PHONY: ocaml-slow-testsocaml-slow-tests: $(DUNE) build @slow-tests
.PHONY: ocaml-very-slow-testsocaml-very-slow-tests: $(DUNE) build @very-slow-tests
.PHONY: docdoc: $(DUNE) build @doc chmod u+w _build/default/_doc/_html/odoc.support/odoc.css cp doc/odoc-theme/odoc.css _build/default/_doc/_html/odoc.support/odoc.css
##### Packaging soteria-c #####
# From inside the package folder one can run:# SOTERIA_Z3_PATH=./bin/z3 DYLD_LIBRARY_PATH=./lib:$DYLD_LIBRARY_PATH ./bin/soteria-c exec-main file.c.PHONY: packagepackage: package-soteria-c package-soteria-rust
.PHONY: package-soteria-cpackage-soteria-c: ocaml packaging/soteria-c/bin-locations.txt packaging/soteria-c/macOS_dylibs.txt $(DUNE) build @soteria-c-dylist-file $(PACKAGING_BIN) copy-files $(DYLIB_LIST_FILE) $(SOTERIA_C_PACKAGE)/lib $(PACKAGING_BIN) copy-files packaging/soteria-c/bin-locations.txt $(SOTERIA_C_PACKAGE)/bin mkdir -p $(SOTERIA_C_PACKAGE)/lib $(PACKAGING_BIN) copy-cerb-runtime $(SOTERIA_C_PACKAGE)/lib $(PACKAGING_BIN) copy-soteria-c-auto-includes $(SOTERIA_C_PACKAGE)/lib/
packaging/soteria-c/bin-locations.txt: $(WHICHX) soteria-c > $@ $(WHICHX) z3 >> $@ 2>/dev/null || true
packaging/soteria-c/macOS_dylibs.txt: $(PACKAGING_BIN) infer-dylibs $(SOTERIA_C_BIN) > $@
##### Packaging soteria-rust #####
# From inside the package folder one can run:# SOTERIA_Z3_PATH=./bin/z3 SOTERIA_OBOL_PATH=./bin/obol SOTERIA_CHARON_PATH=./bin/charon \# SOTERIA_RUST_PLUGINS=./plugins DYLD_LIBRARY_PATH=./lib:$DYLD_LIBRARY_PATH ./bin/soteria-rust exec ..PHONY: package-soteria-rustpackage-soteria-rust: ocaml packaging/soteria-rust/bin-locations.txt packaging/soteria-rust/macOS_dylibs.txt $(DUNE) build @soteria-rust-dylist-file $(SOTERIA_RUST_PACKAGING_BIN) copy-files $(SOTERIA_RUST_DYLIB_LIST_FILE) $(SOTERIA_RUST_PACKAGE)/lib $(SOTERIA_RUST_PACKAGING_BIN) copy-files packaging/soteria-rust/bin-locations.txt $(SOTERIA_RUST_PACKAGE)/bin $(SOTERIA_RUST_PACKAGING_BIN) copy-soteria-rust-plugins $(SOTERIA_RUST_PACKAGE)/plugins
packaging/soteria-rust/bin-locations.txt: $(WHICHX) soteria-rust > $@ $(WHICHX) z3 >> $@ 2>/dev/null || true which obol >> $@ 2>/dev/null || true which charon >> $@ 2>/dev/null || true which obol-driver >> $@ 2>/dev/null || true which charon-driver >> $@ 2>/dev/null || true
packaging/soteria-rust/macOS_dylibs.txt: $(SOTERIA_RUST_PACKAGING_BIN) infer-dylibs $(SOTERIA_RUST_BIN) > $@
##### Switch creation / dependency setup #####
.PHONY: switchswitch: $(OPAM) switch create . ocaml-base-compiler.$(OCAML_VERSION) --deps-only --with-test --with-doc -y $(OPAM) install ocaml-lsp-server odig ocamlformat.$(OCAMLFORMAT_VERSION) -y
.PHONY: glob-switchglob-switch: $(OPAM) switch create soteria-install ocaml-base-compiler.$(OCAML_VERSION) -y $(OPAM) switch soteria-install
.PHONY: installinstall: $(OPAM) install . -y
.PHONY: soteria-core-depssoteria-core-deps: $(OPAM) install ./soteria.opam --deps-only --with-test
.PHONY: ocaml-depsocaml-deps: $(OPAM) install . --deps-only --with-test --with-doc $(OPAM) install ocamlformat.$(OCAMLFORMAT_VERSION) $(OPAM) install sherlodoc
##### JavaScript stuff #####
.PHONY: npm-depsnpm-deps: $(YARN) install --immutable
.PHONY: vscode-reinstall-devvscode-reinstall-dev: vscode-package $(YARN) install-ext
.PHONY: vscode-packagevscode-package: vscode $(YARN) package
.PHONY: vscodevscode: js-bundle
.PHONY: js-bundlejs-bundle: vscode-ocaml $(YARN) compile
.PHONY: vscode-ocamlvscode-ocaml: $(DUNE) build $(VSCODE_BC_JS)
.PHONY: for-localfor-local: ocaml vscode
.PHONY: cleanclean: $(DUNE) clean rm -rf packages rm -rf $(VSCODE_DIST) rm -rf packaging/soteria-c/bin-locations.txt packaging/soteria-c/macOS_dylibs.txt rm -rf packaging/soteria-rust/bin-locations.txt packaging/soteria-rust/macOS_dylibs.txt rm -f soteria-vscode.vsix
license-check: reuse lint
.PHONY: license license-lint