Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mtzguido committed Oct 24, 2024
1 parent 48ba8d6 commit e1ad871
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ all: lib verify

# Find fstar.exe
ifdef FSTAR_HOME
FSTAR_EXE := $(FSTAR_HOME)/bin/fstar.exe
FSTAR_EXE ?= $(FSTAR_HOME)/bin/fstar.exe
endif
FSTAR_EXE ?= $(shell which fstar.exe)

ifeq (,$(FSTAR_EXE))
$(error "Did not find fstar.exe in PATH and FSTAR_EXE/FSTAR_HOME unset, aborting.")
endif
Expand Down
33 changes: 9 additions & 24 deletions share/steel/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,50 +1,35 @@
ifeq (,$(STEEL_HOME))
$(error STEEL_HOME should be defined in the enclosing Makefile as the prefix directory where Steel was installed, or the root directory of its source repository)
endif
include $(STEEL_HOME)/mk/common.mk
.DEFAULT_GOAL := verify

ifneq (,$(FSTAR_HOME))
FSTAR=$(FSTAR_HOME)/bin/fstar.exe
else
FSTAR=fstar.exe
FSTAR_EXE ?= $(FSTAR_HOME)/bin/fstar.exe
endif

FSTAR_EXE ?= $(shell which fstar.exe)

$(call need_exe,FSTAR_EXE)

# Add Steel to the OCaml (ocamlfind) search path
ifeq ($(OS),Windows_NT)
OCAMLPATH := $(shell cygpath -m $(STEEL_HOME)/lib);$(OCAMLPATH)
else
OCAMLPATH := $(STEEL_HOME)/lib:$(OCAMLPATH)
endif

# Find fstar.exe and the fstar.lib OCaml package
ifeq (,$(FSTAR_HOME))
_check_fstar := $(shell which fstar.exe)
ifeq ($(.SHELLSTATUS),0)
_fstar_home := $(realpath $(dir $(_check_fstar))/..)
ifeq ($(OS),Windows_NT)
OCAMLPATH := $(shell cygpath -m $(_fstar_home)/lib);$(OCAMLPATH)
else
OCAMLPATH := $(_fstar_home)/lib:$(OCAMLPATH)
endif
endif
else
ifeq ($(OS),Windows_NT)
OCAMLPATH := $(shell cygpath -m $(FSTAR_HOME)/lib);$(OCAMLPATH)
else
OCAMLPATH := $(FSTAR_HOME)/lib:$(OCAMLPATH)
endif
endif
export OCAMLPATH

FSTAR_FILES += $(filter-out $(EXCLUDE_FILES),$(wildcard *.fst *.fsti))
ADDITIONAL_INCLUDES ?=
FSTAR_OPTIONS += $(OTHERFLAGS) --cmi --cache_checked_modules --warn_error @241 --already_cached 'Prims,FStar,LowStar,Steel,C' --include $(STEEL_HOME)/lib/steel $(ADDITIONAL_INCLUDES) --load_cmxs steel
FSTAR_OPTIONS += --include $(STEEL_HOME)/build/plugin.checked

COMPAT_INDEXED_EFFECTS?=--compat_pre_typed_indexed_effects

# Used only for OCaml extraction, not krml extraction
FSTAR_ML_CODEGEN ?= OCaml

MY_FSTAR=$(RUNLIM) $(FSTAR) $(SIL) $(FSTAR_OPTIONS)
MY_FSTAR=$(RUNLIM) $(FSTAR_EXE) $(SIL) $(FSTAR_OPTIONS)

%.checked:
$(call msg, "CHECK", $(basename $(notdir $@)))
Expand Down
2 changes: 1 addition & 1 deletion share/steel/examples/steel/OWGCounter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include $(STEEL_HOME)/share/steel/Makefile.include
OUTPUT_EXE=_build/default/OWGCounterTest.exe

$(OUTPUT_EXE): $(OUTPUT_DIRECTORY)/OWGCounter.ml OWGCounterTest.ml
dune build
$(FSTAR_EXE) --ocamlenv dune build

counter: $(OUTPUT_EXE)
$<
Expand Down

0 comments on commit e1ad871

Please sign in to comment.