-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile
147 lines (122 loc) · 3.03 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#
# Makefile for developer's convenience.
# Build logic is implemented with dune.
#
DUNE ?= dune
# Build everything. Should only require OCaml libraries and tools installable
# via opam.
.PHONY: all
all:
$(MAKE) -C atdpy clean-for-dune
$(MAKE) -C atdd clean-for-dune
$(MAKE) -C atdcpp clean-for-dune
$(MAKE) -C atdts clean-for-dune
$(DUNE) build
# Install the OCaml dependencies for the build.
.PHONY: setup
setup:
opam update
./scripts/install-opam-dependencies
# Build and test everything in a Docker container, producing an
# image named 'atd'.
# This is split into two steps because installing the dependencies takes
# forever each time.
.PHONY: docker
docker:
$(MAKE) docker-deps
$(MAKE) docker-build
# This takes a while and has nothing to do with atd.
.PHONY: docker-deps
docker-deps:
docker build -t atd-deps -f dockerfiles/atd-deps.dockerfile .
.PHONY: docker-build
docker-build:
docker build -t atd -f dockerfiles/atd.dockerfile .
############################# Testing #####################################
# Test everything. Requires external non-OCaml compilers and libraries
# to support all the target languages.
.PHONY: test
test:
$(MAKE) test-ocaml
$(MAKE) test-scala
$(MAKE) test-java
$(MAKE) test-python
$(MAKE) test-ts
$(MAKE) test-d
$(MAKE) test-cpp
# Test the OCaml code used by all the backends
test-common:
$(MAKE) -C atd test
$(MAKE) -C atdcat test
$(MAKE) -C atddiff test
# Test only the OCaml backends
.PHONY: test-ocaml
test-ocaml:
$(MAKE) test-common
$(MAKE) -C atdgen-runtime test
$(MAKE) -C atdgen test
# Test only the Scala backend
.PHONY: test-scala
test-scala:
$(MAKE) test-common
$(MAKE) -C atds test
# Test only the Java backend
.PHONY: test-java
test-java:
$(MAKE) test-common
$(MAKE) -C atdj test
# Test only the Python backend
.PHONY: test-python
test-python:
$(MAKE) test-common
$(MAKE) -C atdpy test
# Test only the TypeScript backend
.PHONY: test-ts
test-ts:
$(MAKE) test-common
$(MAKE) -C atdts test
.PHONY: test-d
test-d:
$(MAKE) test-common
$(MAKE) -C atdd test
.PHONY: test-cpp
test-cpp:
$(MAKE) test-common
$(MAKE) -C atdcpp test
############################################################################
.PHONY: js
js:
$(DUNE) build atdgen/bin/ag_main.bc.js
.PHONY: clean
clean:
$(DUNE) clean
$(MAKE) -C atdpy clean
rm -rf tmp
.PHONY: all-supported-ocaml-versions
all-supported-ocaml-versions:
$(DUNE) runtest --workspace dune-workspace.dev
.PHONY: doc
doc:
cd doc && sphinx-build . _build
# Run documentation server.
# See setup instructions in CONTRIBUTING.md
.PHONY: livedoc
livedoc:
$(MAKE) doc
python3 -m http.server 8888 --directory doc/_build
# Prepare the opam files for a release. They're derived from 'dune-project'
# and from the template specified in the root 'dune' file..
#
.PHONY: opam-files
opam-files:
$(DUNE) build *.opam
# This is only part of the release process.
# See complete release instructions in CONTRIBUTING.md.
#
.PHONY: opam-release
opam-release:
dune-release tag
dune-release distrib
dune-release publish
dune-release opam pkg
dune-release opam submit