forked from plclub/metalib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
125 lines (97 loc) · 2.83 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
############################################################################
#
# Primary targets:
# all - the default target; synonym for 'coq'
# coq - builds all .vo files
# doc - synonym for 'documentation'
# documentation - builds all html documentation
# clean - removes generated files
#
# Other targets (intended to be used by the developers of this library):
# gens - builds generated .v files on demand
# dist - builds a zip file for distribution
#
############################################################################
## Paths to executables. Do not include options here.
## Modify these to suit your Coq installation, if necessary.
COQC = coqc
COQDEP = coqdep
COQDOC = coqdoc
## Include directories, one per line.
INCDIRS = \
.
## Directory where generated HTML documentation should go.
DOCDIR = doc/html
## List of files to be compiled and documented.
FILES = \
AssocList \
CoqEqDec \
CoqFSetDecide \
CoqFSetInterface \
CoqListFacts \
CoqUniquenessTac \
CoqUniquenessTacEx \
FSetExtra \
FSetWeakNotin \
LibDefaultSimp \
LibLNgen \
LibTactics \
\
MetatheoryAtom \
Metatheory \
\
AssumeList \
MetatheoryAlt \
\
Fsub_LetSum_Definitions \
Fsub_LetSum_Infrastructure \
Fsub_LetSum_Lemmas \
Fsub_LetSum_Soundness \
\
CoqIntro \
STLCsol \
## Lists calculated from the above.
VFILES = $(foreach i, $(FILES), $(i).v)
VOFILES = $(foreach i, $(FILES), $(i).vo)
INCFLAGS = $(foreach i, $(INCDIRS), -I $(i))
############################################################################
.PHONY: all clean coq dist doc documentation gens
.SUFFIXES: .v .vo
all: Metatheory.vo MetatheoryAlt.vo LibLNgen.vo
coq: $(VOFILES)
doc:
+make documentation
documentation: $(DOCDIR) $(VOFILES)
$(COQDOC) -g --quiet --noindex --html -d $(DOCDIR) $(VFILES)
cp -f custom.css $(DOCDIR)/coqdoc.css
clean:
rm -f *.vo *.glob *.cmi *.cmx *.o
rm -rf $(DOCDIR)
############################################################################
%.vo: %.v Makefile
$(COQC) -q $(INCFLAGS) $<
$(DOCDIR):
mkdir -p $(DOCDIR)
############################################################################
.depend: $(VFILES) Makefile
$(COQDEP) $(INCFLAGS) $(VFILES) > .depend
include .depend
############################################################################
DATE = $(shell date +%Y%m%d)
DIR = metalib-$(DATE)
COQSPLIT = ../../books/sf/tools/coqsplit
STLC = ../../books/coqbook/stlc/STLC.v
gens:
make -C ../../books/sf tools/coqsplit
$(COQSPLIT) < $(STLC) > STLC.v
$(COQSPLIT) -solutions < $(STLC) > STLCsol.v
dist:
svn export . $(DIR)
(cd $(DIR); $(MAKE) documentation)
rm -f $(DIR)/*.vo $(DIR)/*.glob
rm -f $(DIR)/TODO.txt
echo Release $(DATE) / svn revision `svnversion .` >> $(DIR)/VERSION
zip -r $(DIR).zip $(DIR)
@echo
@echo Done.
@echo See $(DIR) and $(DIR).zip.