-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
47 lines (35 loc) · 1.27 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
SRC_DIRS := 'theories'
EXT_DIRS := 'external'
ALL_VFILES := $(shell find $(EXT_DIRS) $(SRC_DIRS) -name '*.v' -a '!' -name '*'.\#'*')
BUILD_DIRS := $(SRC_DIRS)
VFILES := $(shell find $(BUILD_DIRS) -name '*.v' -a '!' -name '*'.\#'*')
COQC := coqc
Q:=@
# extract global arguments for Coq from _CoqProject
COQPROJECT_ARGS := $(shell sed -E -e '/^\#/d' -e 's/-arg ([^ ]*)/\1/g' _CoqProject)
all: $(VFILES:.v=.vo)
.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
%.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 $(EXT_DIRS) $(SRC_DIRS) \( -name "*.vo" -o -name "*.vo[sk]" \
-o -name ".*.aux" -o -name ".*.cache" -o -name "*.glob" \) -delete
$(Q)rm -f .lia.cache
rm -f .coqdeps.d
tar:
git archive --format=tar.gz -o coq-clutch.tar.gz HEAD
.PHONY: clean zip