-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
98 lines (72 loc) · 2.06 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Steel's `Makefile`s rely on recent GNU Make's "shortest stem" rule,
# so we need to rule out older `make`s.
ifeq (3.81,$(MAKE_VERSION))
$(error You seem to be using the OSX antiquated Make version. Hint: brew \
install make, then invoke gmake instead of make)
endif
# Define the Steel root directory. We need to fix it to use the Windows path convention on Windows+Cygwin.
export STEEL_HOME := $(CURDIR)
include $(STEEL_HOME)/mk/common.mk
.DEFAULT_GOAL := all
FSTAR_EXE ?= fstar.exe
all: lib verify
.PHONY: .force
.force:
plugin: plugin.src extraction.src
cd src/ocaml && $(FSTAR_EXE) --ocamlenv dune build
cd src/ocaml && dune install --prefix=$(STEEL_HOME)
plugin.src: .force
$(MAKE) -f mk/plugin.mk
extraction.src: .force
$(MAKE) -f mk/extraction.mk
.PHONY: lib
lib:
+$(MAKE) -C src/c
.PHONY: verify-steel
verify-steel: plugin
+$(MAKE) -C lib/steel steel
.PHONY: verify-steelc
verify-steelc: verify-steel
+$(MAKE) -C lib/steel/c steelc
.PHONY: verify
verify: verify-steel verify-steelc
clean: clean_ocaml
+$(MAKE) -C lib/steel clean ; true
rm -rf build/plugin.checked
rm -rf build/plugin.ml
clean_ocaml:
cd src/ocaml && { dune uninstall --prefix=$(STEEL_HOME) ; dune clean ; true ; }
.PHONY: test
test: all
+$(MAKE) -C share/steel
PREFIX ?= /usr/local
override PREFIX:=$(abspath $(PREFIX))
ifeq ($(OS),Windows_NT)
STEEL_INSTALL_PREFIX=$(shell cygpath -m $(PREFIX))
else
STEEL_INSTALL_PREFIX=$(PREFIX)
endif
export STEEL_INSTALL_PREFIX
INSTALL := $(shell ginstall --version 2>/dev/null | cut -c -8 | head -n 1)
ifdef INSTALL
INSTALL := ginstall
else
INSTALL := install
endif
export INSTALL
.PHONY: install install-ocaml install-lib install-include install-share
install-ocaml:
cd src/ocaml && dune install --prefix=$(STEEL_INSTALL_PREFIX)
install-src-c:
+$(MAKE) -C src/c install
install-lib:
+$(MAKE) -C lib/steel install
install-include:
+$(MAKE) -C include/steel install
install-share:
+$(MAKE) -C share/steel install
install: install-ocaml install-lib install-include install-share install-src-c
.PHONY: ci
ci:
+$(MAKE) all
+$(MAKE) test