-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
83 lines (62 loc) · 1.92 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
OS_TYPE=$(patsubst CYGWIN%,Cygwin,$(shell uname))
ifeq ($(OS_TYPE),Linux)
HOST_OS=linux-gnu
endif
ifeq ($(OS_TYPE),Darwin)
HOST_OS=darwin
endif
ifeq ($(OS_TYPE),Cygwin)
HOST_OS=cygwin
endif
HOST_CPU=$(shell uname -m)
RELEASE_NAME=tlaps-$$RELEASE_VERSION-$(HOST_CPU)-$(HOST_OS)
RELEASE_FILE=$(RELEASE_NAME).tar.gz
PREFIX=$(OPAM_SWITCH_PREFIX)
all: build
opam-update: # Update the package lists and install updates.
opam update
opam upgrade
opam-deps:
opam install ./ --deps-only --yes --working-dir
opam-deps-opt:
opam install --yes eio_main lsp
opam-deps-dev:
opam install --yes ocamlformat ocaml-lsp-server earlybird
build:
dune build
check: test
test:
dune runtest
test-inline:
dune runtest src
test-fast:
make -C test fast
test-fast-basic:
make -C test fast/basic
fmt:
# Only the LSP part is not formatted automatically.
cd lsp && dune fmt
install:
dune install --prefix=$(PREFIX)
make -C $(PREFIX)/lib/tlapm/ -f Makefile.post-install
release:
rm -rf _build/tlaps-release-dir _build/tlaps-release-version
dune install --relocatable --prefix _build/tlaps-release-dir
make -C _build/tlaps-release-dir/lib/tlapm -f Makefile.post-install
cd test && env \
USE_TLAPM=../_build/tlaps-release-dir/bin/tlapm \
USE_LIB=../_build/tlaps-release-dir/lib/tlapm/stdlib \
./TOOLS/do_tests fast/basic
RELEASE_VERSION="$$(_build/tlaps-release-dir/bin/tlapm --version)" \
&& rm -rf _build/$(RELEASE_FILE) \
&& mv _build/tlaps-release-dir _build/$(RELEASE_NAME) \
&& (cd _build/ && tar -czf $(RELEASE_FILE) $(RELEASE_NAME)) \
&& rm -rf _build/$(RELEASE_NAME) \
&& echo $$RELEASE_VERSION > _build/tlaps-release-version
release-print-version:
@cat _build/tlaps-release-version
release-print-file:
@RELEASE_VERSION="$$(cat _build/tlaps-release-version)" && echo $(RELEASE_FILE)
clean:
dune clean
.PHONY: all build check test test-inline test-fast test-fast-basic install release release-print-version release-print-file clean