-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
104 lines (86 loc) · 2.43 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
# include $(shell ocamlfind query visitors)/Makefile.preprocess
DEPENDENCIES = \
integers \
batteries \
ounit \
ansiterminal \
menhir \
ppx_deriving \
ppx_string_interpolation \
zarith \
visitors \
fileutils \
ppx_import \
core \
dune \
ocamlgraph \
angstrom \
yojson \
pyml \
pprint \
z3
DEV_DEPENDENCIES = \
merlin \
ocamlformat
.PHONY: test promote test-promote test-cc clean release-macos release-linux
default:
dune build src/bin/main.exe
cp -f _build/default/src/bin/main.exe dpt
dune build src/bin/compiler.exe
cp -f _build/default/src/bin/compiler.exe dptc
dune build src/bin/lucidcc.exe
cp -f _build/default/src/bin/lucidcc.exe lucidcc
macos-release:
./scripts/build_macos_release.sh
linux-release:
./scripts/build_linux_release.sh
all:
dune build src/bin/main.exe
cp -f _build/default/src/bin/main.exe dpt
dune build src/bin/compiler.exe
cp -f _build/default/src/bin/compiler.exe dptc
dune build src/bin/lucidcc.exe
cp -f _build/default/src/bin/lucidcc.exe lucidcc
mkdir -p bin
dune build src/bin/dockerUtils.exe
cp -f _build/default/src/bin/dockerUtils.exe bin/dockerUtils
dune build src/bin/dfgCompiler.exe
cp -f _build/default/src/bin/dfgCompiler.exe bin/dfgCompiler
dune build src/bin/eventParsers.exe
cp -f _build/default/src/bin/eventParsers.exe bin/eventParsers
generatedVisitors: src/lib/frontend/Syntax.processed.ml
test: default
python3 ./test/runtests.py
promote:
cp test/output/* test/expected/
test-promote: default
python3 ./test/runtests.py
cp test/output/* test/expected/
test-cc: default
python3 ./test/runtests.py --lucidcc
EXPECTED_SDE_VER := bf-sde-9.13.0
# cd into test/backend and then call ./runtests.sh
test_tofino: default
@if [ -z "$$SDE" ]; then \
echo "Error: P4studio SDE directory environment variable (\$$SDE) is not set"; \
exit 1; \
fi
@if [ ! -f "$$SDE/$(EXPECTED_SDE_VER).manifest" ]; then \
echo "Error: The Lucid-Tofino backend is only tested on SDE $(EXPECTED_SDE_VER), and your \$$SDE directory ($$SDE) does not have a manifest file indicating that the correct version is installed."; \
exit 1; \
fi
cd test/backend && ./runtests.sh
doc:
dune build @doc
format:
find src -type f -regex ".*\.mli*" -exec ocamlformat --inplace {} \;
find test -type f -regex ".*\.mli*" -exec ocamlformat --inplace {} \;
install-deps:
opam install -y $(DEPENDENCIES)
install-dev:
opam install -y $(DEV_DEPENDENCIES) $(DEPENDENCIES)
clean:
dune clean
rm -f dpt
rm -f dptc
rm -f test/testing.exe