-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (44 loc) · 1.49 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
# !!! Only for contributors & maintainers !!!
# The commands in this file are only necessary to maintain the repository examples
# Each example project in `./examples` contains its own Makefile with specific
# commands for it.
project_name = melange-examples
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 . 5.1.0 -y --deps-only --no-install
.PHONY: init
init: create-switch install ## Configure everything to develop this repository in local
.PHONY: install
install: ## Install development dependencies
make -C examples/1-node install
make -C examples/2-react install
make -C examples/3-vite install
.PHONY: build
build: ## Build all examples
make -C examples/1-node build
make -C examples/2-react build
make -C examples/3-vite build
.PHONY: test
test: ## Test all examples
make -C examples/1-node test
make -C examples/2-react test
make -C examples/3-vite test
.PHONY: clean
clean: ## Clean all examples
make -C examples/1-node clean
make -C examples/2-react clean
make -C examples/3-vite 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