-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (54 loc) · 1.62 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
SRC_DIRS := 'src' 'external'
ALL_VFILES := $(shell find $(SRC_DIRS) -name "*.v")
VFILES := $(shell find 'src' -name "*.v")
# extract any global arguments for Coq from _CoqProject
COQPROJECT_ARGS := $(shell sed -E -e '/^\#/d' -e 's/-arg ([^ ]*)/\1/g' _CoqProject)
COQ_ARGS := -noglob
Q:=@
# COQC := coqc
ifneq (,$(TIMING))
COQC := coqc
else ifeq ($(TIMED), 1)
COQC := time coqc
else
COQC := coqc
endif
# by default build all .vo files
default: $(VFILES:.v=.vo)
vos: src/ShouldBuild.vos
vok: $(QUICK_CHECK_FILES:.v=.vok)
.coqdeps.d: $(ALL_VFILES) _CoqProject
@echo "COQDEP $@"
$(Q)coqdep -vos -f _CoqProject $(ALL_VFILES) > $@
# do not try to build dependencies if cleaning or just building _CoqProject
ifeq ($(filter clean,$(MAKECMDGOALS)),)
include .coqdeps.d
endif
ifneq (,$(TIMING))
TIMING_ARGS=-time
TIMING_EXT?=timing
TIMING_EXTRA = > $<.$(TIMING_EXT)
endif
%.vo: %.v _CoqProject
@echo "COQC $<"
$(Q)$(COQC) $(COQPROJECT_ARGS) $(COQ_ARGS) $(TIMING_ARGS) -o $@ $< $(TIMING_EXTRA)
%.vos: %.v _CoqProject
@echo "COQC -vos $<"
$(Q)$(COQC) $(COQPROJECT_ARGS) -vos $(COQ_ARGS) $< -o $@
%.vok: %.v _CoqProject
@echo "COQC -vok $<"
$(Q)$(COQC) $(COQPROJECT_ARGS) $(TIMING_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 .lia.cache
rm -f .coqdeps.d
clean-local:
@echo "CLEAN vo glob aux"
$(Q)find src \( -name "*.vo" -o -name "*.vo[sk]" \
-o -name ".*.aux" -o -name ".*.cache" -name "*.glob" \) -delete
$(Q)rm -f .lia.cache
rm -f .coqdeps.d
.PHONY: default
.DELETE_ON_ERROR: