-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
49 lines (38 loc) · 1005 Bytes
/
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
project_name = ppx-by-example
DUNE = opam exec -- dune
opam_file = $(project_name).opam
.PHONY: help
help:
@echo "";
@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-dev
dev:
$(DUNE) build -w @all
.PHONY: clean
clean: ## Clean artifacts
$(DUNE) clean
.PHONY: exec
exec: ## Run the project
$(DUNE) exec $(demo)
.PHONY: format
format:
DUNE_CONFIG__GLOBAL_LOCK=disabled $(DUNE) build @fmt --auto-promote
.PHONY: format-check
format-check:
$(DUNE) build @fmt
.PHONY: create-switch
create-switch: ## Create opam switch
opam switch create . 5.1.1 --deps-only --with-test -y
.PHONY: install
install:
$(DUNE) build @install
opam install . --deps-only --with-test
cd demo && yarn install
.PHONY: init
init: create-switch install
.PHONY: $(TARGET)
demo-%:
DUNE_CONFIG__GLOBAL_LOCK=disabled opam exec -- dune exec $*_demo