2025-11-06 19:24:23 +01:00
|
|
|
# Generated by mirage.v4.10.1
|
2025-10-30 15:51:03 +01:00
|
|
|
|
|
|
|
|
-include Makefile.user
|
2025-11-02 13:32:06 +01:00
|
|
|
BUILD_DIR = unikernel/
|
|
|
|
|
MIRAGE_DIR = unikernel/mirage
|
|
|
|
|
UNIKERNEL_NAME = mte-unix
|
2025-10-30 15:51:03 +01:00
|
|
|
OPAM = opam
|
|
|
|
|
|
|
|
|
|
all::
|
|
|
|
|
@$(MAKE) --no-print-directory depends
|
|
|
|
|
@$(MAKE) --no-print-directory build
|
|
|
|
|
|
|
|
|
|
.PHONY: all lock install-switch pull clean depend depends build repo-add repo-rm depext-lockfile
|
|
|
|
|
|
|
|
|
|
repo-add:
|
|
|
|
|
@printf "\033[2musing overlay repository mirage: [opam-overlays, mirage-overlays] \033[0m\n"
|
|
|
|
|
$(OPAM) repo add opam-overlays https://github.com/dune-universe/opam-overlays.git || $(OPAM) repo set-url opam-overlays https://github.com/dune-universe/opam-overlays.git
|
|
|
|
|
$(OPAM) repo add mirage-overlays https://github.com/dune-universe/mirage-opam-overlays.git || $(OPAM) repo set-url mirage-overlays https://github.com/dune-universe/mirage-opam-overlays.git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
repo-rm:
|
|
|
|
|
@printf "\033[2mremoving overlay repository [opam-overlays, mirage-overlays]\033[0m\n"
|
|
|
|
|
$(OPAM) repo remove opam-overlays https://github.com/dune-universe/opam-overlays.git
|
|
|
|
|
$(OPAM) repo remove mirage-overlays https://github.com/dune-universe/mirage-opam-overlays.git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
depext-lockfile: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked
|
|
|
|
|
echo " ↳ install external dependencies for monorepo"
|
|
|
|
|
env OPAMVAR_monorepo="opam-monorepo" $(OPAM) monorepo depext -y -l $<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam
|
|
|
|
|
@$(MAKE) -s repo-add
|
|
|
|
|
@echo " ↳ generate lockfile for monorepo dependencies"
|
|
|
|
|
@env OPAMVAR_monorepo="opam-monorepo" $(OPAM) monorepo lock --require-cross-compile --build-only $(UNIKERNEL_NAME) -l $@ --ocaml-version $(shell ocamlc --version); (ret=$$?; $(MAKE) -s repo-rm && exit $$ret)
|
|
|
|
|
|
|
|
|
|
lock::
|
|
|
|
|
@$(MAKE) -B $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked
|
|
|
|
|
@echo "The lock file has been generated. Run 'make pull' to retrieve the sources, or 'make install-switch' to install the host dependencies."
|
|
|
|
|
|
|
|
|
|
pull:: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam.locked
|
|
|
|
|
@echo " ↳ fetch monorepo dependencies in the duniverse folder"
|
|
|
|
|
@env OPAMVAR_monorepo="opam-monorepo" $(OPAM) monorepo pull -l $< -r $(abspath $(BUILD_DIR))
|
|
|
|
|
@echo "The sources have been pulled to the duniverse folder. Run 'make build' to build the unikernel."
|
|
|
|
|
|
|
|
|
|
install-switch:: $(MIRAGE_DIR)/$(UNIKERNEL_NAME).opam
|
|
|
|
|
@echo " ↳ opam install switch dependencies"
|
|
|
|
|
@$(OPAM) install $< --deps-only --yes
|
|
|
|
|
@$(MAKE) -s depext-lockfile
|
|
|
|
|
@echo "The dependencies have been installed. Run 'make build' to build the unikernel."
|
|
|
|
|
|
|
|
|
|
depends depend::
|
|
|
|
|
@$(MAKE) --no-print-directory lock
|
|
|
|
|
@$(MAKE) --no-print-directory install-switch
|
|
|
|
|
@$(MAKE) --no-print-directory pull
|
|
|
|
|
|
|
|
|
|
build::
|
|
|
|
|
dune build --profile release --root . $(BUILD_DIR)dist
|
2025-11-02 13:32:06 +01:00
|
|
|
@echo "Your unikernel binary is now ready in $(BUILD_DIR)dist/mte"
|
2025-10-30 15:51:03 +01:00
|
|
|
@echo "Execute the binary using solo5-hvt, solo5-spt, xl, ..."
|
|
|
|
|
|
|
|
|
|
clean::
|
|
|
|
|
mirage clean
|