-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (63 loc) · 1.64 KB
/
Makefile
File metadata and controls
77 lines (63 loc) · 1.64 KB
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
# Checking for required tools.
ifeq (,$(shell command -v dune 2> /dev/null))
$(error "Compilation requires [dune].")
endif
# GNU vs BSD
ifeq (GNU,$(shell sed --version 2>&1 > /dev/null && echo GNU))
SEDI = sed -i
else
SEDI = sed -i ''
endif
PROFILE := dev
# Trick to avoid printing the commands.
# To enable the printing of commands, use [make Q= ...],
Q = @
.PHONY: default
default: cn
.PHONY: all
all: cn cn-coq
.PHONY: full-build
full-build:
@echo "[DUNE] full-build"
$(Q)dune build --profile=$(PROFILE)
.PHONY: cn
cn:
@echo "[DUNE] $@"
$(Q)dune build cn.install --profile=$(PROFILE)
.PHONY: clean
clean:
$(Q)rm -f cn-coq.install cn.install
$(Q)rm -f coq/*.{glob,vo,vok}
$(Q)rm -rf _build/
.PHONY: install
install: cn
@echo "[DUNE] install cn"
$(Q)dune install cn --profile=$(PROFILE)
.PHONY: uninstall
uninstall:
@echo "[DUNE] uninstall cn"
$(Q)dune uninstall cn
.PHONY: cn-coq
cn-coq:
@echo "[DUNE] cn-coq"
$(Q)dune build cn-coq.install --profile=$(PROFILE)
.PHONY: cn-coq-install
cn-coq-install: cn-coq
@echo "[DUNE] install cn-coq"
$(Q)dune install cn-coq --profile=$(PROFILE)
.PHONY: cn-with-coq
cn-with-coq:
@echo "[DUNE] cn,cn-coq"
$(Q)dune build cn.install cn-coq.install --profile=$(PROFILE)
# Development target to watch for changes in cn/lib and rebuild
# e.g. to be used with vscode IDE
.PHONY: cn-dev-watch
cn-dev-watch:
@echo "[DUNE] cn-dev-watch"
$(Q)dune build --watch cn.install cn-coq.install --profile=$(PROFILE)
.PHONY: format
format:
@echo "[DUNE] format"
$(Q)dune fmt || exit 0
@echo "[CLANG] format"
$(Q)find runtime/libcn/ -iname '*.h' -o -iname '*.c' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i