forked from hacl-star/hacl-star
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile: simplifying F* detection (of library, ocaml files, etc)
- Loading branch information
Showing
3 changed files
with
35 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Find fstar.exe and set FSTAR_EXE to its absolute path. | ||
|
||
# If FSTAR_EXE is already externally set, we just use it. Note the use | ||
# of ?= everywhere below. | ||
|
||
# If FSTAR_HOME is set, we honor it and pick that F*. | ||
ifdef FSTAR_HOME | ||
FSTAR_EXE ?= $(abspath $(FSTAR_HOME)/bin/fstar.exe) | ||
endif | ||
|
||
# Otherwise we try to find it from the PATH. | ||
|
||
# Bash's 'type -P' is essentially 'which'. This relies on having bash | ||
# around, but does not require 'which'. | ||
FSTAR_EXE ?= $(shell bash -c 'type -P fstar.exe') | ||
|
||
# Force eval | ||
FSTAR_EXE := $(FSTAR_EXE) | ||
|
||
# Don't fail if we're cleaning | ||
ifneq ($(MAKECMDGOALS),clean) | ||
ifeq (,$(FSTAR_EXE)) | ||
$(error "Did not find fstar.exe in PATH and FSTAR_EXE/FSTAR_HOME unset, aborting.") | ||
endif | ||
endif | ||
|
||
export FSTAR_EXE |