-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
24 lines (19 loc) · 1.01 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
all: extract cswap.exe cswap_impl.exe
cswap.exe: Spec.CSwap.fst
mkdir -p cswap-ml
fstar.exe --codegen OCaml --extract_module Spec.CSwap --odir cswap-ml $^
@echo '\n\nlet _ = test()' >> cswap-ml/Spec_CSwap.ml
# This assumes that FStar/bin is in the PATH.
OCAMLPATH="${PATH}" ocamlfind opt -package fstarlib -linkpkg -w -20-26-3-8-58 -w -8-20-26-28-10 -I cswap-ml cswap-ml/Spec_CSwap.ml -o cswap.exe
./cswap.exe
cswap_impl.exe: Impl.CSwap.fst
mkdir -p cswap-ml
fstar.exe --z3rlimit 50 --codegen OCaml --extract_module Impl.CSwap --odir cswap-ml $^
@echo '\n\nlet _ = test()' >> cswap-ml/Impl_CSwap.ml
# This assumes that FStar/bin is in the PATH.
OCAMLPATH="${PATH}" ocamlfind opt -package fstarlib -linkpkg -w -20-26-3-8-58 -w -8-20-26-28-10 -I cswap-ml cswap-ml/Impl_CSwap.ml -o cswap_ct.exe
./cswap_ct.exe
extract: cswap.exe cswap_impl.exe
krml -I . -skip-compilation -drop FStar,Prims,Spec.CSwap -fparentheses Impl.CSwap.fst
clean:
rm -rf cswap-ml cswap.exe cswap_ct.exe out.krml *.c *.h