<commit_before>OCAMLC=ocamlfind ocamlc -thread -package batteries -linkpkg -g
OCAMLOPT=ocamlfind ocamlopt -thread -package batteries -linkpkg -g
OCAMLDEP=ocamldep
INCLUDES=                 # all relevant -I options here
OCAMLFLAGS=$(INCLUDES)    -w -8 # add other options for ocamlc here
OCAMLOPTFLAGS=$(INCLUDES) -w -8 # add other options for ocamlopt here

# always bump version for a release
VERSION=$(shell cat ../version.txt)

NAME=fstar_$(VERSION)_$(shell echo `uname`_`uname -m`)

# not using this any more
# REV=$(shell "git log --pretty=format:'%h' -n 1")

FSTAR_OBJS=support.cmx Microsoft_FStar_Options.cmx Microsoft_FStar_Absyn_Syntax.cmx Microsoft_FStar_Absyn_Const.cmx Microsoft_FStar_Absyn_Visit.cmx Microsoft_FStar_Absyn_Util.cmx Microsoft_FStar_Absyn_Print.cmx Microsoft_FStar_Absyn_SSyntax.cmx Microsoft_FStar_Tc_Env.cmx Microsoft_FStar_Tc_Recheck.cmx Microsoft_FStar_Tc_Normalize.cmx Microsoft_FStar_Tc_Errors.cmx Microsoft_FStar_Tc_Rel.cmx Microsoft_FStar_Tc_Util.cmx Microsoft_FStar_Tc_Tc.cmx Microsoft_FStar_Parser_AST.cmx Microsoft_FStar_Parser_DesugarEnv.cmx Microsoft_FStar_Parser_Desugar.cmx Microsoft_FStar_Parser_Parse.cmx Microsoft_FStar_Parser_Lexhelp.cmx Microsoft_FStar_Parser_LexFStar.cmx Microsoft_FStar_Parser_ParseIt.cmx Microsoft_FStar_Parser_Driver.cmx Microsoft_FStar_ToSMT_Term.cmx Microsoft_FStar_ToSMT_Z3.cmx Microsoft_FStar_ToSMT_SplitQueryCases.cmx Microsoft_FStar_ToSMT_Encode.cmx FSharp_Format.cmx Microsoft_FStar_Extraction_ML_Syntax.cmx Microsoft_FStar_Extraction_ML_Env.cmx Microsoft_FStar_Extraction_ML_Util.cmx Microsoft_FStar_Extraction_OCaml_Code.cmx Microsoft_FStar_Extraction_ML_Code.cmx Microsoft_FStar_Extraction_ML_ExtractTyp.cmx Microsoft_FStar_Extraction_ML_ExtractExp.cmx Microsoft_FStar_Extraction_ML_ExtractMod.cmx Microsoft_FStar_FStar.cmx

# The part of the parser that's generated by the `parser` target here
PARSER_MLS=Microsoft_FStar_Parser_LexFStar.ml Microsoft_FStar_Parser_Parse.ml Microsoft_FStar_Parser_ParseIt.ml parse.ml parse.mli

all: fstar.exe

# the `fexport` function takes a path relative to the top of the F* repo
# and exports the contents of that directory to the `fstar` dir
fexport = cd ../.. && git archive "--format=tar" "--prefix=$(1)/" HEAD:$(1)/ | tar -x -C src/ocaml-output/fstar

package: parser fstar.exe
	rm -f $(NAME).zip $(NAME).tar.gz
	rm -dfr fstar && mkdir fstar
	cp ../../README.md ../../LICENSE ../../setenv.sh fstar/
	cp README fstar/
	mkdir fstar/bin
	cp fstar.exe fstar/bin/fstar.exe
	@cp ../../bin/*z3* fstar/bin > /dev/null || cp `which z3` fstar/bin > /dev/null || echo " ********** WARNING: you don't have Z3 in \\$FSTAR_HOME/bin or in your \\$PATH, skipped from package ************** "
	$(call fexport,lib)
	$(call fexport,examples)
	$(call fexport,contrib)
	$(call fexport,doc/tutorial)
	cd fstar/doc/tutorial; make
ifeq ($(OS),Windows_NT)
	zip -r -9 $(NAME).zip fstar
else
	tar czf $(NAME).tar.gz fstar
endif

parser:
	cat ../parser/parse.fsy | sed 's/^[/][/].*//g' | sed 's/^[#].*//g' | sed 's/^open .*//g' > parse.mly
	ocamlyacc parse.mly
	rm -f Microsoft_FStar_Parser_Parse.ml
	echo "open Support.Microsoft.FStar.Util" > Microsoft_FStar_Parser_Parse.ml
	echo "open Support.Microsoft.FStar.Range" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Options" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Absyn_Syntax" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Absyn_Const" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Absyn_Util" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Parser_AST" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Support.Microsoft.FStar.Parser.Util" >> Microsoft_FStar_Parser_Parse.ml
	cat parse.ml >> Microsoft_FStar_Parser_Parse.ml
#	cp ../support/ocaml/fstar-lang/src/FSLangLexer.mll lex.mll
	ocamllex ../lex.mll -o Microsoft_FStar_Parser_LexFStar.ml
	cp ../parseit.ml Microsoft_FStar_Parser_ParseIt.ml
	$(OCAMLDEP) $(INCLUDES) *.ml > .depend
	dos2unix parse.mly
	unix2dos $(PARSER_MLS)

support.ml: ../support/ocaml/fstar-lib/src/support.ml
	cp $^ $@

fstarml.ml: ../main.ml
	cp $^ $@

fstar.exe: $(FSTAR_OBJS) fstarml.ml
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -o fstar.exe $^
	cp fstar.exe ../../bin/fstar.exe

# Common rules
.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.mli.cmi:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.ml.cmx:<commit_msg>One more change to make strider happy<commit_after>OCAMLC=ocamlfind ocamlc -thread -package batteries -linkpkg -g
OCAMLOPT=ocamlfind ocamlopt -thread -package batteries -linkpkg -g
OCAMLDEP=ocamldep
INCLUDES=                 # all relevant -I options here
OCAMLFLAGS=$(INCLUDES)    -w -8 # add other options for ocamlc here
OCAMLOPTFLAGS=$(INCLUDES) -w -8 # add other options for ocamlopt here

# always bump version for a release
VERSION=$(shell cat ../version.txt)

NAME=fstar_$(VERSION)_$(shell echo `uname`_`uname -m`)

# not using this any more
# REV=$(shell "git log --pretty=format:'%h' -n 1")

FSTAR_OBJS=support.cmx Microsoft_FStar_Options.cmx Microsoft_FStar_Absyn_Syntax.cmx Microsoft_FStar_Absyn_Const.cmx Microsoft_FStar_Absyn_Visit.cmx Microsoft_FStar_Absyn_Util.cmx Microsoft_FStar_Absyn_Print.cmx Microsoft_FStar_Absyn_SSyntax.cmx Microsoft_FStar_Tc_Env.cmx Microsoft_FStar_Tc_Recheck.cmx Microsoft_FStar_Tc_Normalize.cmx Microsoft_FStar_Tc_Errors.cmx Microsoft_FStar_Tc_Rel.cmx Microsoft_FStar_Tc_Util.cmx Microsoft_FStar_Tc_Tc.cmx Microsoft_FStar_Parser_AST.cmx Microsoft_FStar_Parser_DesugarEnv.cmx Microsoft_FStar_Parser_Desugar.cmx Microsoft_FStar_Parser_Parse.cmx Microsoft_FStar_Parser_Lexhelp.cmx Microsoft_FStar_Parser_LexFStar.cmx Microsoft_FStar_Parser_ParseIt.cmx Microsoft_FStar_Parser_Driver.cmx Microsoft_FStar_ToSMT_Term.cmx Microsoft_FStar_ToSMT_Z3.cmx Microsoft_FStar_ToSMT_SplitQueryCases.cmx Microsoft_FStar_ToSMT_Encode.cmx FSharp_Format.cmx Microsoft_FStar_Extraction_ML_Syntax.cmx Microsoft_FStar_Extraction_ML_Env.cmx Microsoft_FStar_Extraction_ML_Util.cmx Microsoft_FStar_Extraction_OCaml_Code.cmx Microsoft_FStar_Extraction_ML_Code.cmx Microsoft_FStar_Extraction_ML_ExtractTyp.cmx Microsoft_FStar_Extraction_ML_ExtractExp.cmx Microsoft_FStar_Extraction_ML_ExtractMod.cmx Microsoft_FStar_FStar.cmx

# The part of the parser that's generated by the `parser` target here
PARSER_MLS=Microsoft_FStar_Parser_LexFStar.ml Microsoft_FStar_Parser_Parse.ml Microsoft_FStar_Parser_ParseIt.ml parse.ml parse.mli

all: fstar.exe

# the `fexport` function takes a path relative to the top of the F* repo
# and exports the contents of that directory to the `fstar` dir
fexport = cd ../.. && git archive "--format=tar" "--prefix=$(1)/" HEAD:$(1)/ | tar -x -C src/ocaml-output/fstar

package: parser fstar.exe
	rm -f $(NAME).zip $(NAME).tar.gz
	rm -dfr fstar && mkdir fstar
	cp ../../README.md ../../LICENSE ../../setenv.sh fstar/
	cp README fstar/
	mkdir fstar/bin
	cp fstar.exe fstar/bin/fstar.exe
	@cp ../../bin/*z3* fstar/bin > /dev/null || cp `which z3` fstar/bin > /dev/null || echo " ********** WARNING: you don't have Z3 in \\$FSTAR_HOME/bin or in your \\$PATH, skipped from package ************** "
	$(call fexport,lib)
	$(call fexport,examples)
	$(call fexport,contrib)
	$(call fexport,doc/tutorial)
	cd fstar/doc/tutorial; make
ifeq ($(OS),Windows_NT)
	zip -r -9 $(NAME).zip fstar
else
	tar czf $(NAME).tar.gz fstar
endif

parser:
	cat ../parser/parse.fsy | sed 's/^[/][/].*//g' | sed 's/^[#].*//g' | sed 's/^open .*//g' > parse.mly
	ocamlyacc parse.mly
	rm -f Microsoft_FStar_Parser_Parse.ml
	echo "open Support.Microsoft.FStar.Util" > Microsoft_FStar_Parser_Parse.ml
	echo "open Support.Microsoft.FStar.Range" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Options" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Absyn_Syntax" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Absyn_Const" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Absyn_Util" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Microsoft_FStar_Parser_AST" >> Microsoft_FStar_Parser_Parse.ml
	echo "open Support.Microsoft.FStar.Parser.Util" >> Microsoft_FStar_Parser_Parse.ml
	cat parse.ml >> Microsoft_FStar_Parser_Parse.ml
#	cp ../support/ocaml/fstar-lang/src/FSLangLexer.mll lex.mll
	ocamllex ../lex.mll -o Microsoft_FStar_Parser_LexFStar.ml
	cp ../parseit.ml Microsoft_FStar_Parser_ParseIt.ml
	$(OCAMLDEP) $(INCLUDES) *.ml > .depend
ifeq (, $(shell which dos2unix))
	dos2unix parse.mly
endif
ifeq (, $(shell which unix2dos))
	unix2dos $(PARSER_MLS)
endif

support.ml: ../support/ocaml/fstar-lib/src/support.ml
	cp $^ $@

fstarml.ml: ../main.ml
	cp $^ $@

fstar.exe: $(FSTAR_OBJS) fstarml.ml
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -o fstar.exe $^
	cp fstar.exe ../../bin/fstar.exe

# Common rules
.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.mli.cmi:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.ml.cmx:
{'fraction_non_alphanumeric': 0.11823104693140794, 'fraction_numerical': 0.0029332129963898917, 'mean_word_length': 5.300639658848614, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4979543', 'n_tokens_mistral': 3503, 'n_tokens_neox': 3347, 'n_words': 675}