-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.benchmark.coq.local
79 lines (62 loc) · 2.4 KB
/
Makefile.benchmark.coq.local
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
# Workaround for the issue that building the benchmark programs require two
# versions of OCaml.
OCAML_OPAMSWITCH?=
ifeq (,$(OCAML_OPAMSWITCH))
DUNE?= dune
else
DUNE?= opam exec --switch $(OCAML_OPAMSWITCH) -- dune
endif
HSDIR := benchmark/haskell
MLDIR := benchmark/ocaml
EXTRACTED_HS_FILES := \
$(HSDIR)/MergesortCoqCbn.hs \
$(HSDIR)/MergesortCoqCbnAcc.hs \
$(HSDIR)/MergesortCoqCbv.hs \
$(HSDIR)/MergesortCoqCbvAcc.hs
HS_FLAGS := -with-rtsopts="-T -I0 -A8G -G1 -m1" -O2
EXTRACTED_ML_FILES := \
$(MLDIR)/mergesort_coq_cbn.ml \
$(MLDIR)/mergesort_coq_cbnacc.ml \
$(MLDIR)/mergesort_coq_cbv.ml \
$(MLDIR)/mergesort_coq_cbvacc.ml \
$(MLDIR)/mergesort_coq_cbn_tmc.ml \
$(MLDIR)/mergesort_coq_cbnacc_tmc.ml
EXTRACTED_BINARIES := \
$(HSDIR)/Benchmark $(HSDIR)/BenchmarkExp \
$(MLDIR)/benchmark $(MLDIR)/benchmark_exp
$(HSDIR)/Benchmark: $(HSDIR)/Benchmark.hs $(HSDIR)/Benchlib.hs \
$(EXTRACTED_HS_FILES)
cd $(HSDIR) && stack ghc Benchmark.hs -- $(HS_FLAGS)
$(HSDIR)/BenchmarkExp: $(HSDIR)/BenchmarkExp.hs $(HSDIR)/Benchlib.hs \
$(EXTRACTED_HS_FILES)
cd $(HSDIR) && stack ghc BenchmarkExp.hs -- $(HS_FLAGS)
$(MLDIR)/benchmark: $(MLDIR)/benchmark.ml $(MLDIR)/benchlib.ml \
$(EXTRACTED_ML_FILES) $(EXTRACTED_ML_FILES:.ml=.mli)
cd $(MLDIR) && \
$(DUNE) build benchmark.exe && \
ln -s _build/default/benchmark.exe benchmark
$(MLDIR)/benchmark_exp: $(MLDIR)/benchmark_exp.ml $(MLDIR)/benchlib.ml \
$(EXTRACTED_ML_FILES) $(EXTRACTED_ML_FILES:.ml=.mli)
cd $(MLDIR) && \
$(DUNE) build benchmark_exp.exe && \
ln -s _build/default/benchmark_exp.exe benchmark_exp
$(HSDIR)/MergesortCoqCbn.hs $(MLDIR)/mergesort_coq_cbn.ml: \
benchmark/extraction_cbn.vo
$(HSDIR)/MergesortCoqCbnAcc.hs $(MLDIR)/mergesort_coq_cbnacc.ml: \
benchmark/extraction_cbnacc.vo
$(HSDIR)/MergesortCoqCbv.hs $(MLDIR)/mergesort_coq_cbv.ml: \
benchmark/extraction_cbv.vo
$(HSDIR)/MergesortCoqCbvAcc.hs $(MLDIR)/mergesort_coq_cbvacc.ml: \
benchmark/extraction_cbvacc.vo
$(MLDIR)/%_tmc.ml: $(MLDIR)/%.ml $(MLDIR)/%_tmc.patch
patch $^ -o $@
$(MLDIR)/%_tmc.mli: $(MLDIR)/%.mli
cp $< $@
post-all:: $(EXTRACTED_BINARIES)
clean::
$(HIDE)rm -f $(EXTRACTED_HS_FILES)
$(HIDE)rm -f $(HS_FILES:.hs=.hi)
$(HIDE)rm -f $(HS_FILES:.hs=.o)
$(HIDE)rm -f $(EXTRACTED_ML_FILES)
$(HIDE)rm -f $(EXTRACTED_ML_FILES:.ml=.mli)
$(HIDE)rm -f $(EXTRACTED_BINARIES)