-
Notifications
You must be signed in to change notification settings - Fork 349
/
Makefile
64 lines (49 loc) · 1.58 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
55
56
57
58
59
60
61
62
63
64
DUNE = opam exec -- dune
.PHONY: help
help: ## Print this help message
@echo "List of available make commands";
@echo "";
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}';
@echo "";
.PHONY: build
build: ## Build the project, including non installable libraries and executables
@$(DUNE) build @all
.PHONY: build-prod
build-prod: ## Build for production (--profile=prod)
@$(DUNE) build --profile=prod @@default
.PHONY: dev
dev: ## Build in watch mode
@$(DUNE) build -w @@default
.PHONY: clean
clean: ## Clean artifacts
@$(DUNE) clean
.PHONY: jest
jest: ## Run the jest unit tests
@npx jest
.PHONY: jest-watch
jest-watch: ## Run the jest unit tests in watch mode
@npx jest --watch
.PHONY: test
test: ## Run the runtests from dune (snapshot)
@$(DUNE) build @runtest
.PHONY: test-watch
test-watch: ## Run the unit tests in watch mode
@$(DUNE) build @runtest -w
.PHONY: test-promote
test-promote: ## Updates snapshots and promotes it to correct
@$(DUNE) build @runtest --auto-promote
.PHONY: format
format: ## Format the codebase with ocamlformat
@$(DUNE) build @fmt --auto-promote
.PHONY: format-check
format-check: ## Checks if format is correct
@$(DUNE) build @fmt
.PHONY: install
install: ## Update the package dependencies when new deps are added to dune-project
@opam install . --deps-only --with-test
@npm install
.PHONY: init
create-switch: ## Create a local opam switch
@opam switch create . 5.2.0 --no-install
.PHONY: init
init: create-switch install ## Create a local opam switch, install deps