mte/GNUmakefile

65 lines
2.6 KiB
Text
Raw Normal View History

2026-04-01 03:30:27 +02:00
storage=assets/secmod.fat
service=tap0
vendors_list := \
2026-03-11 14:17:52 +01:00
mkernel zarith bstr mnet mirage-crypto-rng-mkernel gmp digestif \
kdf utcp flux h1 httpcats mhttp multipart_form-miou prettym tls \
x509 vifu cachet mfat caqti \
base32 cohttp mirage-mtime mirage-ptime
check-kvm:
$(if $(wildcard /dev/kvm),,$(error KVM support not enabled))
2026-04-01 03:30:27 +02:00
pin-deps:
2026-03-21 16:31:11 +01:00
#opam pin --no-action --yes "git+https://github.com/robur-coop/mcrunch.git#682ed63c03e3be5664f96c469a260e1d9e9df011"
opam pin --no-action --yes "git+https://github.com/mirage/Zarith.git#zarith-1.14"
2026-04-01 03:30:27 +02:00
opam pin --no-action --yes add mhttp "git+https://github.com/robur-coop/mhttp.git#b2e55ae693b07ad3ef87c26c37c8f5d14c2e205c"
opam pin --no-action --yes add vif "git+https://github.com/swrup/vif.git#1b16040ba06c6af82019f02811e781e81084d269"
opam pin --no-action --yes add vifu "git+https://github.com/swrup/vif.git#1b16040ba06c6af82019f02811e781e81084d269"
2026-03-21 16:31:11 +01:00
opam pin --no-action --yes "git+https://github.com/robur-coop/mfat.git#5b1204d914e853f0139c6d2776511f530b753550"
opam pin --no-action --yes "git+https://github.com/swrup/mirage-mtime.git#6a6bb4dd25624a3c43e6417dcdf73f3c689946a7"
opam pin --no-action --yes add caqti "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes add caqti-miou "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes add caqti-mnet "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes add caqti-driver-pgx "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes "git+https://github.com/robur-coop/mnet.git#7e07437cda26f8efd3da0c4d14d76293d8fcbc78"
2026-03-21 16:31:11 +01:00
2026-04-01 03:30:27 +02:00
install-deps:
2026-03-11 14:17:52 +01:00
# opam install --yes mcrunch
2026-03-21 16:31:11 +01:00
opam install --yes dune utop merlin ocp-browser ocamlformat
2026-03-11 14:17:52 +01:00
opam install --yes crunch
opam install --yes sqlite3 # needed for caqti even if not used
opam install --yes caqti-driver-pgx
2026-04-01 03:30:27 +02:00
opam install --yes $(vendors_list)
2026-03-11 14:17:52 +01:00
.PHONY: vendors
vendors:
@mkdir -p vendors
2026-04-01 03:30:27 +02:00
@for v in $(vendors_list); do \
2026-03-11 14:17:52 +01:00
[ -d vendors/$$v ] || opam source $$v --dir vendors/$$v ; \
done
.PHONY: clean
clean:
rm -rf _build/
rm -rf vendors/
2026-03-21 16:31:11 +01:00
assets:
@cp default/assets ./
2026-04-01 03:30:27 +02:00
fat-image:
2026-03-11 14:17:52 +01:00
@mkdir -p assets
2026-04-01 03:30:27 +02:00
mfat make --sectors=2048 $(storage)
init: clean pin-deps install-deps vendors assets fat-image
2026-03-11 14:17:52 +01:00
manifest:
2026-03-21 16:31:11 +01:00
@dune exec src/mte.exe > src/manifest.json
2026-03-11 14:17:52 +01:00
2026-04-01 03:30:27 +02:00
build: manifest
2026-03-21 16:31:11 +01:00
@dune build @all
@dune build --workspace dune-workspace.solo5 src/mte.exe
2026-03-11 14:17:52 +01:00
run: build
2026-04-01 03:30:27 +02:00
@solo5-hvt --block:storage=$(storage) --net:service=$(service) -- ./_build/solo5/src/mte.exe