summaryrefslogtreecommitdiff
path: root/tests/fstar-split/Makefile.template
diff options
context:
space:
mode:
authorSon Ho2023-12-22 19:17:44 +0100
committerSon Ho2023-12-22 19:17:44 +0100
commit2171c01c6101958d3d12734ad970132b78d500d7 (patch)
treee79a75b12cbe7e1c3dff37727713fda722e0ad7f /tests/fstar-split/Makefile.template
parent29f358f4072ee4c6530b4c523a1754d4c0723893 (diff)
Start pushing files from the fstar-split test folder
Diffstat (limited to 'tests/fstar-split/Makefile.template')
-rw-r--r--tests/fstar-split/Makefile.template48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/fstar-split/Makefile.template b/tests/fstar-split/Makefile.template
new file mode 100644
index 00000000..14790d6d
--- /dev/null
+++ b/tests/fstar-split/Makefile.template
@@ -0,0 +1,48 @@
+INCLUDE_DIRS = .
+
+FSTAR_INCLUDES = $(addprefix --include ,$(INCLUDE_DIRS))
+
+FSTAR_HINTS ?= --use_hints --use_hint_hashes --record_hints
+
+FSTAR_OPTIONS = $(FSTAR_HINTS) \
+ --cache_checked_modules $(FSTAR_INCLUDES) --cmi \
+ --warn_error '+241@247+285-274' \
+
+FSTAR_EXE ?= fstar.exe
+FSTAR_NO_FLAGS = $(FSTAR_EXE) --already_cached 'Prims FStar LowStar Steel' --odir obj --cache_dir obj
+
+FSTAR = $(FSTAR_NO_FLAGS) $(FSTAR_OPTIONS)
+
+# The F* roots are used to compute the dependency graph, and generate the .depend file
+FSTAR_ROOTS ?= $(wildcard *.fst *.fsti)
+
+# Build all the files
+all: $(addprefix obj/,$(addsuffix .checked,$(FSTAR_ROOTS)))
+
+# This is the right way to ensure the .depend file always gets re-built.
+ifeq (,$(filter %-in,$(MAKECMDGOALS)))
+ifndef NODEPEND
+ifndef MAKE_RESTARTS
+.depend: .FORCE
+ $(FSTAR_NO_FLAGS) --dep full $(notdir $(FSTAR_ROOTS)) > $@
+
+.PHONY: .FORCE
+.FORCE:
+endif
+endif
+
+include .depend
+endif
+
+# For the interactive mode
+%.fst-in %.fsti-in:
+ @echo $(FSTAR_OPTIONS)
+
+# Generete the .checked files in batch mode
+%.checked:
+ $(FSTAR) $(FSTAR_OPTIONS) $< && \
+ touch -c $@
+
+.PHONY: clean
+clean:
+ rm -f obj/*