diff --git a/GNUmakefile b/GNUmakefile index 7acecb82..09b192bb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,8 +1,9 @@ storage=./keys/secmod.fat service=tap0 -setup-switch: +switch: opam switch create mte ocaml.5.4.1 + eval $$(opam env) opam update opam install --yes . --deps-only @@ -10,14 +11,21 @@ vendors: source.sh @mkdir -p vendors @./source.sh -.PHONY: clean -clean: - rm -rf _build/ - rm -rf vendors/ +assets: + @cp -r default/assets ./ + +build: vendors + @dune build @all + @dune build --workspace dune-workspace.solo5 src/mte.exe + +manifest.json: + @dune exec src/mte.exe > src/manifest.json keys: @mkdir -p keys @dune exec tools/offline.exe -- generate-eddsa-key --output ./keys/master + +postgres_password: @read -sp "Enter postgres password: " POSTGRES_PASSWORD; \ echo; \ printf $${POSTGRES_PASSWORD} > ./keys/postgres_password @@ -25,19 +33,26 @@ keys: secmod.fat: mfat make --sectors=2048 $(storage) -assets: - @cp -r default/assets ./ - config: @sed "s/%%MASTER_PUBLIC_KEY%%/$$(cat ./keys/master.pub)/" -i assets/mte.conf -src/manifest.json: - @dune exec src/mte.exe > src/manifest.json - -build: vendors - @dune build @all - @dune build --workspace dune-workspace.solo5 src/mte.exe - run: build @solo5-hvt --block:storage=$(storage) --net:service=$(service) -- ./_build/solo5/src/mte.exe \ --postgres-password=$$(cat ./keys/postgres_password) + +clean-switch: + opam switch remove mte + +clean-vendors: + rm -rf vendors/ + +clean-build: + rm -rf _build/ + +clean-assets: + rm -rf assets/ + +clean-keys: + rm -rf keys/ + +clean-all: clean-switch clean-vendors clean-build clean-assets clean-keys diff --git a/README.md b/README.md index 621ec0ac..913e7550 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ MTE use the opam package manager and the dune build system. Create a dedicated opam switch, pin libraries to the required version and install them. ``` -make setup-switch +make switch ``` For compilation to a solo5 unikernel, we also need to "vendor" some libraries. diff --git a/mte.opam b/mte.opam index 97af4543..1fb3eb8c 100644 --- a/mte.opam +++ b/mte.opam @@ -48,12 +48,16 @@ depends: [ "caqti-mnet" "caqti-driver-pgx" "pgx" + "mkernel" + "utcp" ] build: [ [make "build"] ] pin-depends: [ [ "zarith.dev" "git+https://github.com/mirage/Zarith.git#df8969d9bb95cffca13e31a615189ab27ada0684" ] + [ "mkernel.dev" "git+https://github.com/robur-coop/mkernel.git#v0.0.2" ] + [ "utcp.dev" "git+https://github.com/robur-coop/utcp.git#0.0.2" ] [ "mnet.dev" "git+https://github.com/robur-coop/mnet.git#v0.0.2" ] [ "mnet-tls.dev" "git+https://github.com/robur-coop/mnet.git#v0.0.2" ] [ "mnet-happy-eyeballs.dev" "git+https://github.com/robur-coop/mnet.git#v0.0.2" ]