-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (41 loc) · 1.45 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.DEFAULT_GOAL := all
EXE=mcompc
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(ARGS):;@:)
.PHONY: all
all:
opam exec -- dune build --root .
.PHONY: deps
deps: ## Install development dependencies
opam install -y dune ocamlformat utop ocaml-lsp-server
opam install --deps-only --with-test --with-doc -y .
.PHONY: build
build: ## Build the project, including non installable libraries and executables
opam exec -- dune build --root .
.PHONY: start
start: all ## Run the produced executable
opam exec -- dune exec --root . bin/$(EXE).exe $(ARGS)
.PHONY: clean
clean: ## Clean build artifacts and other generated files
opam exec -- dune clean --root .
.PHONY: doc
doc: ## Generate odoc documentation
opam exec -- dune build --root . @doc
.PHONY: servedoc
servedoc: doc ## Open odoc documentation with default web browser
open _build/default/_doc/_html/index.html
.PHONY: fmt
fmt: ## Format the codebase with ocamlformat
opam exec -- dune build --root . --auto-promote @fmt
.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
opam exec -- dune build --root . --watch
.PHONY: utop
utop: ## Run a REPL and link with the project's libraries
opam exec -- dune utop --root . lib -- -implicit-bindings
.PHONY: test_semant
test_semant: ## Run a test utility for the semantic phase
python3 test/test.py --phase 1
.PHONY: test_parser
test_parser: ## Run a test utility for the parser phase
python3 test/test.py --phase 0