forked from rikimasan/bs-luxon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (41 loc) · 1.24 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
project_name = bs-luxon
DUNE = opam exec -- dune
.DEFAULT_GOAL := help
.PHONY: help
help: ## Print this help message
@echo "List of available make commands";
@echo "";
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}';
@echo "";
.PHONY: create-switch
create-switch: ## Create opam switch
opam switch create . -y --deps-only
.PHONY: init
init: create-switch install ## Configure everything to develop this repository in local
.PHONY: generate-opam
generate-opam: ## Generate the opam file
$(DUNE) build $(project_name).opam
.PHONY: install
install: generate-opam ## Install development dependencies
yarn install
opam update
opam install -y . --deps-only --with-test
opam exec opam-check-npm-deps
.PHONY: build
build: ## Build the project
$(DUNE) build @main
.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
$(DUNE) build --watch @main
.PHONY: test
test:
yarn test
.PHONY: clean
clean: ## Clean build artifacts and other generated files
$(DUNE) clean
.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