Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .DEFAULT_GOAL := all
  2. .PHONY: all
  3. all:
  4. opam exec -- dune build --root . @install
  5. .PHONY: deps
  6. deps: ## Install development dependencies
  7. opam install -y dune-release ocamlformat utop ocaml-lsp-server
  8. opam install --deps-only --with-test --with-doc -y .
  9. .PHONY: create_switch
  10. create_switch: ## Create an opam switch without any dependency
  11. opam switch create . --no-install -y
  12. .PHONY: switch
  13. switch: ## Create an opam switch and install development dependencies
  14. opam install . --deps-only --with-doc --with-test
  15. opam install -y dune-release ocamlformat utop ocaml-lsp-server
  16. .PHONY: build
  17. build: ## Build the project, including non installable libraries and executables
  18. opam exec -- dune build --root .
  19. .PHONY: test
  20. test: ## Run the unit tests
  21. opam exec -- dune runtest --root .
  22. .PHONY: clean
  23. clean: ## Clean build artifacts and other generated files
  24. opam exec -- dune clean --root .
  25. .PHONY: doc
  26. doc: ## Generate odoc documentation
  27. opam exec -- dune build --root . @doc
  28. .PHONY: fmt
  29. fmt: ## Format the codebase with ocamlformat
  30. opam exec -- dune build --root . --auto-promote @fmt
  31. .PHONY: watch
  32. watch: ## Watch for the filesystem and rebuild on every change
  33. opam exec -- dune build --root . --watch