-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (63 loc) · 2.21 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
project_name = jsoo-css
DUNE = opam exec -- dune
opam_file = $(project_name).opam
.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: all
all: ## Install the packages on the system
$(DUNE) install --root .
$(DUNE) build --root . @install
.PHONY: create-switch
create-switch:
opam switch create . 4.12.0 --deps-only --locked --no-install -y
.PHONY: init
init: setupGitHooks pins install ## Configure everything to develop this repository in local
.PHONY: setupGitHooks
setupGitHooks: ## Configure git to point githooks in .githooks folder
git config core.hooksPath .githooks
.PHONY: pins
pins: ## Pin development dependencies
opam pin add jsoo-css.dev . --no-action
.PHONY: install
install: all ## Install development dependencies
opam install --deps-only --with-test --with-doc -y .
.PHONY: deps
deps: $(opam_file) ## Alias to update the opam file and install the needed deps
.PHONY: build
build: ## Build the project, including non installable libraries and executables
$(DUNE) build --root .
.PHONY: start
start: all ## Serve the application with a local HTTP server
cd demo && yarn start
.PHONY: test
test: ## Run the unit tests
$(DUNE) build --root . @test/runtest -f
.PHONY: test-wactch
test-watch: ## Run the unit tests in watch mode
$(DUNE) build --root . @test/runtest --watch
.PHONY: clean
clean: ## Clean build artifacts and other generated files
$(DUNE) clean --root .
.PHONY: doc
doc: ## Generate odoc documentation
$(DUNE) build --root . @doc
.PHONY: servedoc
servedoc: doc ## Open odoc documentation with default web browser
$(BROWSER) _build/default/_doc/_html/index.html
.PHONY: format
format: ## Format the codebase with ocamlformat
$(DUNE) build --root . --auto-promote @fmt
.PHONY: format-check
format-check: ## Checks if format is correct
$(DUNE) build @fmt
.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
$(DUNE) build --root . --watch
.PHONY: utop
utop: ## Run a REPL and link with the project's libraries
$(DUNE) utop --root . lib -- -implicit-bindings