forked from rocq-community/rocq-lsp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (73 loc) · 1.82 KB
/
Copy pathMakefile
File metadata and controls
93 lines (73 loc) · 1.82 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
COQ_BUILD_CONTEXT=../_build/default/coq
PKG_SET= \
vendor/coq/coq-core.install \
vendor/coq/coq-stdlib.install \
vendor/coq-serapi/coq-serapi.install \
coq-lsp.install
# Get the ocamlformat version from the .ocamlformat file
OCAMLFORMAT=ocamlformat.$$(awk -F = '$$1 == "version" {print $$2}' .ocamlformat)
DEV_DEPS= \
dune \
$(OCAMLFORMAT) \
ocaml-lsp-server
.PHONY: build
build: coq_boot
dune build $(DUNEOPT) $(PKG_SET)
.PHONY: check
check: coq_boot
dune build $(DUNEOPT) @check
.PHONY: fmt format
fmt format:
dune fmt $(DUNEOPT)
.PHONY: watch
watch: coq_boot
dune build -w $(DUNEOPT) $(PKG_SET)
.PHONY: build-all
build-all: coq_boot
dune build $(DUNEOPT) @all
vendor/coq/config/coq_config.ml:
cd vendor/coq \
&& ./configure -no-ask -prefix $(shell pwd)/_build/install/default/ \
-native-compiler no \
&& cp theories/dune.disabled theories/dune \
&& cp user-contrib/Ltac2/dune.disabled user-contrib/Ltac2/dune
.PHONY: coq_boot
coq_boot: vendor/coq/config/coq_config.ml
.PHONY: clean
clean:
dune clean
# We first pin lablgtk3 as to avoid problems with parallel make
.PHONY: opam
opam:
opam pin add coq-lsp . --kind=path -y
opam install coq-lsp
# Create local opam switch
.PHONY: opam-switch
opam-switch:
opam switch create . --empty
# Install opam deps
.PHONY: opam-deps
opam-deps:
opam install ./coq-lsp.opam -y --deps-only
# Install opam deps
.PHONY: opam-dev-deps
opam-dev-deps:
opam install -y $(DEV_DEPS)
# Initialise submodules
.PHONY: submodules-init
submodules-init:
git submodule update --init
# Deinitialize submodules
.PHONY: submodules-deinit
submodules-deinit:
git submodule deinit -f --all
# Build the vscode extension
.PHONY: extension
extension:
cd editor/code && npm i && npm run vscode:prepublish
# Run prettier
.PHONY: ts-fmt
ts-fmt:
cd editor/code && npx prettier -w .
.PHONY: make-fmt
make-fmt: build fmt