-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (65 loc) · 2.08 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
# Makefile for a Coq-Project including Coq-Equations
# Copyright (C) 2024 Max Ole Elliger, Philip Kaludercic
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Configuration
#TODO Change the following lines for configuration.
COMPONENTS := theories:CoMoProj
COQDOC_FLAGS = --utf8
all: coqdoc
define GENCoqDoc
BEGIN { RS="[[:space:]]"; FS=":" } \
{ \
dirname = $$1; \
cmd = "coqdep -f _CoqProject -sort " dirname; \
while ((cmd | getline) > 0) { \
if ($$0 ~ "^" dirname && !seen[$$0]) { \
print $$0; \
seen[$$0] = 1; \
} \
} \
close(cmd); \
}
endef
html: Makefile.coq
VFILES="$(shell echo $(COMPONENTS) | awk '$(GENCoqDoc)')" $(MAKE) -e -f Makefile.coq html
Makefile.coq: _CoqProject
coq_makefile -f $< -o $@
clean: Makefile.coq
$(MAKE) -f $< cleanall
rm -f Makefile.coq
rm -f Makefile.coq.conf
rm -f .Makefile.coq.d
rm -f _CoqProject
define GENCoqPr
BEGIN { RS="[[:space:]]"; FS=":" } \
{ \
dirname = $$1; \
libname = $$2; \
print "-R " dirname " " libname; \
system("find " dirname " -name \"*.v\""); \
} \
END { print "-docroot ." }
endef
define GENDirList
BEGIN { RS="[[:space:]]"; FS=":" } \
{ print $$1; }
endef
_CoqProject: Makefile $(shell echo $(COMPONENTS) | awk '$(GENDirList)')
echo $(COMPONENTS) | awk '$(GENCoqPr)' > $@
install: Makefile.coq
$(MAKE) -f Makefile.coq install
.PHONY: all html clean
COQMAKEFILE := Makefile # Do not change!
include coqdocjs/Makefile.doc