-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
54 lines (40 loc) · 1.26 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- Makefile -*-
# --------------------------------------------------------------------
OCAMLBUILD_JOBS ?= 2
OCAMLBUILD_BIN ?= ocamlbuild
OCAMLBUILD_EXTRA ?=
OCAMLBUILD_OPTS := -use-ocamlfind -j $(OCAMLBUILD_JOBS)
# In Emacs, use classic display to enable error jumping.
ifeq ($(shell echo $$TERM), dumb)
OCAMLBUILD_OPTS += -classic-display
endif
OCAMLBUILD_OPTS += $(OCAMLBUILD_EXTRA)
OCAMLBUILD := $(OCAMLBUILD_BIN) $(OCAMLBUILD_OPTS)
# --------------------------------------------------------------------
BINS := checker to_fstar
NAME := hacspec
INSTALL := scripts/install-sh
DESTDIR ?= /usr/local
# --------------------------------------------------------------------
.PHONY: all build install uninstall check test clean __force__
.PHONY: %.byte %.native %.ml %.mli %.inferred.mli
all: build
@true
build: $(BINS:%=%.native)
checker.%: __force__
$(OCAMLBUILD) src/$@
to_fstar.%: __force__
$(OCAMLBUILD) fstar-compiler/$@
install: $(BINS:%=%.native)
$(INSTALL) checker.native $(DESTDIR)/bin/hacs
$(INSTALL) to_fstar.native $(DESTDIR)/bin/to_fstar
uninstall:
rm -f $(DESTDIR)/$(NAME)
check:
make -C fstar-compiler/specs
test: check
@true
clean:
$(OCAMLBUILD) -clean
rm -f $(BINS:%=%.native) $(BINS:%=%.byte) *.fst
make -C fstar-compiler/specs clean