-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (41 loc) · 1.36 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
SRC_DIRS := 'perennial' 'example' 'testdata/out'
ALL_VFILES := $(shell find $(SRC_DIRS) \
-not -path "perennial/external/coqutil/etc/coq-scripts/*" \
-not -path "perennial/new*/*" \
-name "*.v")
PROJ_VFILES := $(shell find 'example' -name "*.v")
# extract any global arguments for Coq from _CoqProject
COQPROJECT_ARGS := $(shell sed -E -e '/^\#/d' -e "s/'([^']*)'/\1/g" -e 's/-arg //g' _CoqProject)
# user configurable
Q:=@
COQ_ARGS := -noglob
COQC := coqc
default: vo
vo: $(PROJ_VFILES:.v=.vo)
vos: $(PROJ_VFILES:.v=.vos)
vok: $(PROJ_VFILES:.v=.vok)
all: vo
.coqdeps.d: $(ALL_VFILES) _CoqProject
@echo "COQDEP $@"
$(Q)coqdep -vos -f _CoqProject $(ALL_VFILES) > $@
# do not try to build dependencies if cleaning
ifeq ($(filter clean,$(MAKECMDGOALS)),)
-include .coqdeps.d
endif
%.vo: %.v _CoqProject | .coqdeps.d
@echo "COQC $<"
$(Q)$(COQC) $(COQPROJECT_ARGS) $(COQ_ARGS) -o $@ $<
%.vos: %.v _CoqProject | .coqdeps.d
@echo "COQC -vos $<"
$(Q)$(COQC) $(COQPROJECT_ARGS) -vos $(COQ_ARGS) $< -o $@
%.vok: %.v _CoqProject | .coqdeps.d
@echo "COQC -vok $<"
$(Q)$(COQC) $(COQPROJECT_ARGS) -vok $(COQ_ARGS) $< -o $@
clean:
@echo "CLEAN vo glob aux"
$(Q)find $(SRC_DIRS) \( -name "*.vo" -o -name "*.vo[sk]" \
-o -name ".*.aux" -o -name ".*.cache" -name "*.glob" \) -delete
$(Q)rm -f .timing.sqlite3
rm -f .coqdeps.d
.PHONY: default
.DELETE_ON_ERROR: