forked from FStarLang/FStar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
144 lines (109 loc) · 3.73 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
.PHONY: all package clean boot 1 2 3 hints bench output install uninstall package
include .common.mk
all: dune
DUNE_SNAPSHOT ?= $(call maybe_cygwin_path,$(CURDIR)/ocaml)
# The directory where we install files when doing "make install".
# Overridden via the command-line by the OPAM invocation.
PREFIX ?= /usr/local
# On Cygwin, the `--prefix` option to dune only
# supports Windows paths.
FSTAR_CURDIR=$(call maybe_cygwin_path,$(CURDIR))
.PHONY: dune dune-fstar verify-ulib
FSTAR_BUILD_PROFILE ?= release
dune-fstar:
$(Q)cp version.txt $(DUNE_SNAPSHOT)/
@# Call Dune to build the snapshot.
@echo " DUNE BUILD"
$(Q)cd $(DUNE_SNAPSHOT) && dune build --profile=$(FSTAR_BUILD_PROFILE)
@echo " DUNE INSTALL"
$(Q)cd $(DUNE_SNAPSHOT) && dune install --profile=$(FSTAR_BUILD_PROFILE) --prefix=$(FSTAR_CURDIR)
verify-ulib:
+$(MAKE) -C ulib
dune: dune-fstar
+$(MAKE) verify-ulib
.PHONY: clean-dune-snapshot
# Removes all generated files (including the whole generated snapshot,
# and .checked files), except the object files, so that the snapshot
# can be rebuilt with an existing fstar.exe
clean-dune-snapshot: clean-intermediate
cd $(DUNE_SNAPSHOT) && { dune clean || true ; }
rm -rf $(DUNE_SNAPSHOT)/fstar-lib/generated/*
rm -rf $(DUNE_SNAPSHOT)/fstar-lib/dynamic/*
.PHONY: dune-extract-all
dune-extract-all:
+$(MAKE) -C src/ocaml-output dune-snapshot
# This rule is not incremental, by design.
dune-full-bootstrap:
+$(MAKE) dune-fstar
+$(MAKE) clean-dune-snapshot
+$(MAKE) dune-bootstrap
.PHONY: dune-bootstrap
dune-bootstrap:
+$(MAKE) dune-extract-all
+$(MAKE) dune
.PHONY: boot
boot:
+$(MAKE) dune-extract-all
$(Q)cp version.txt $(DUNE_SNAPSHOT)/
@# Call Dune to build the snapshot.
@echo " DUNE BUILD"
$(Q)cd $(DUNE_SNAPSHOT) && dune build --profile release
@echo " RAW INSTALL"
$(Q)cp ocaml/_build/default/fstar/main.exe $(FSTAR_CURDIR)/bin/fstar.exe
install:
$(Q)+$(MAKE) -C src/ocaml-output install
# The `uninstall` rule is only necessary for users who manually ran
# `make install`. It is not needed if F* was installed with opam,
# since `opam remove` can uninstall packages automatically with its
# own way.
uninstall:
rm -rf \
$(PREFIX)/lib/fstar \
$(PREFIX)/bin/fstar_tests.exe \
$(PREFIX)/bin/fstar.exe \
$(PREFIX)/share/fstar
package: all
$(Q)+$(MAKE) -C src/ocaml-output package
.PHONY: clean-intermediate
# Removes everything created by `make all`. MUST NOT be used when
# bootstrapping.
clean: clean-intermediate
cd $(DUNE_SNAPSHOT) && { dune uninstall --prefix=$(FSTAR_CURDIR) || true ; } && { dune clean || true ; }
# Removes all .checked files and other intermediate files
# Does not remove the object files from the dune snapshot,
# because otherwise dune can't uninstall properly
clean-intermediate:
$(Q)+$(MAKE) -C ulib clean
$(Q)+$(MAKE) -C src clean
# Regenerate all hints for the standard library and regression test suite
hints:
+$(Q)OTHERFLAGS=--record_hints $(MAKE) -C ulib/
+$(Q)OTHERFLAGS=--record_hints $(MAKE) ci-uregressions
bench:
./bin/run_benchmark.sh
# Regenerate and accept expected output tests. Should be manually
# reviewed before checking in.
output:
$(Q)+$(MAKE) -C tests/error-messages accept
$(Q)+$(MAKE) -C tests/ide/emacs accept
$(Q)+$(MAKE) -C tests/bug-reports output-accept
.PHONY: ci-utest-prelude
ci-utest-prelude:
$(Q)+$(MAKE) dune FSTAR_BUILD_PROFILE=test
$(Q)+$(MAKE) dune-bootstrap
$(Q)+$(MAKE) -C src ocaml-unit-tests
$(Q)+$(MAKE) -C ulib ulib-in-fsharp #build ulibfs
.PHONY: ci-uregressions ci-uregressions-ulong
ci-uregressions:
$(Q)+$(MAKE) -C src uregressions
ci-uregressions-ulong:
$(Q)+$(MAKE) -C src uregressions-ulong
# Shortcuts:
1: dune-fstar
2:
+$(MAKE) -C src/ocaml-output generated-files
+$(MAKE) -C src ocaml
+$(MAKE) dune-fstar
3:
+$(MAKE) 1
+$(MAKE) 2