-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.in
227 lines (180 loc) · 6.1 KB
/
Makefile.in
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
##
## prooftree --- proof tree display for Proof General
##
## Copyright (C) 2011 - 2024 Hendrik Tews
##
## This file is part of "prooftree".
##
## "prooftree" 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.
##
## "prooftree" 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 in file COPYING in this or one of the parent
## directories for more details.
##
## You should have received a copy of the GNU General Public License
## along with "prooftree". If not, see <http://www.gnu.org/licenses/>.
##
## Commentary: Makefile
##
#############################################################################
##
## CONFIGURATION SECTION
##
#############################################################################
# The following variables are normally set by the configure script.
# If this fails for some reason you can also rename Makefile.in to Makefile
# and set these variables manually.
# BINDIR: Directory where binaries are to be instelled.
BINDIR:=@BINDIR@
# MANDIR: Directory where the man page is to be installed.
MANDIR:=@MANDIR@
# Should be ``prooftree.opt'' if you have ocamlopt.opt available.
# Should be ``prooftree.byte'' if you only have ocamlc.
prooftree: @PROOFTREE@
# ocaml compiler: should be ``ocamlopt.opt'' if available, ``ocamlc'' otherwise
OCAMLC:=@OCAMLC@
# ocaml dependency analyzer
# should be ``ocamldep.opt'' if available, ``ocamldep'' otherwise
# for native compilation add option -native
OCAMLDEP:=@OCAMLDEP@
# ocaml documentation generator
# should be ``ocamldoc.opt'' if available, ``ocamldep'' otherwise
OCAMLDOC:=@OCAMLDOC@
# location of the lablgtk2 library
LABLGTKDIR:=@LABLGTKDIR@
#############################################################################
##
## END OF CONFIGURATION SECTION
##
#############################################################################
ODOC_CHECK:=/home/tews/src/odoc-check/odoc_check.cmxs
ODOC_XREF:=/home/tews/src/odoc-xref/odoc_xref.cmxs
LABLGTKURL:=/usr/share/doc/liblablgtk2-ocaml-doc/html/api
.PHONY: all
all: prooftree
# handwritten sources with full documentation
ML_SOURCES_1:=\
version.ml \
util.ml \
gtk_ext.ml \
configuration.ml \
draw_tree.ml \
tree_layers.ml \
about_window.ml \
help_window.ml \
node_window.ml \
ext_dialog.ml \
emacs_commands.ml \
proof_window.ml \
evar_types.ml \
proof_tree.ml
# lex/yacc generated sources with no documentation
ML_SOURCES_2:=\
coq_evar_parser.ml \
coq_evar_lexer.ml
# handwritten sources with full documentation
ML_SOURCES_3:=\
input.ml \
main.ml
# handwritten sources with full documentation
MLI_SOURCES_1:=\
version.mli \
proof_tree.mli
# lex/yacc generated sources with no documentation
MLI_SOURCES_2:=\
coq_evar_parser.mli
# handwritten sources with full documentation
MLI_SOURCES_3:=\
input.mli
MLI_SOURCES:=$(MLI_SOURCES_1) $(MLI_SOURCES_2) $(MLI_SOURCES_3)
ML_SOURCES:=$(ML_SOURCES_1) $(ML_SOURCES_2) $(ML_SOURCES_3)
SOURCES:=$(MLI_SOURCES) $(ML_SOURCES)
HAND_SOURCES:=$(MLI_SOURCES_1) $(MLI_SOURCES_3) $(ML_SOURCES_1) $(ML_SOURCES_3)
GEN_SOURCES:= $(MLI_SOURCES_2) $(ML_SOURCES_2)
CMO_OBJECTS:=$(ML_SOURCES:.ml=.cmo)
CMX_OBJECTS:=$(ML_SOURCES:.ml=.cmx)
TOCLEAN+=Makefile.deps
Makefile.deps : $(SOURCES)
$(OCAMLDEP) $^ > Makefile.deps
include Makefile.deps
OCAMLFLAGS:=-safe-string -w +A-4-7-48-70 -g -I $(LABLGTKDIR)
%.cmx: %.ml
$(OCAMLC) -c $(OCAMLFLAGS) $<
%.cmo: %.ml
$(OCAMLC) -c $(OCAMLFLAGS) $<
%.cmi: %.mli
$(OCAMLC) -c $(OCAMLFLAGS) $<
TOCLEAN+=prooftree
.PHONY: prooftree.opt
prooftree.opt: $(CMX_OBJECTS)
$(OCAMLC) -g -I $(LABLGTKDIR) -o prooftree \
unix.cmxa lablgtk.cmxa gtkInit.cmx $^
.PHONY: prooftree.byte
prooftree.byte: $(CMO_OBJECTS)
$(OCAMLC) -g -I $(LABLGTKDIR) -o prooftree \
unix.cma lablgtk.cma gtkInit.cmo $^
TOCLEAN+=coq_evar_parser.ml coq_evar_parser.mli coq_evar_parser.output
coq_evar_parser.ml coq_evar_parser.mli: coq_evar_parser.mly
ocamlyacc coq_evar_parser.mly
TOCLEAN+=coq_evar_lexer.ml
coq_evar_lexer.ml: coq_evar_lexer.mll
ocamllex coq_evar_lexer.mll
TOCLEAN+=version.ml
version.ml: version.txt
echo '(* This file is automatically generated from version.txt *)' > $@
echo '(* DO NOT EDIT! *)' >> $@
echo '(** Prooftree version module, generated by make *)' >> $@
echo >> $@
echo '(** Prooftree version, generated from [version.txt] *)' >> $@
echo "let version = \"`head -1 version.txt`\"" >> $@
.PHONY: install
install:
mkdir -p $(DESTDIR)$(BINDIR)
cp prooftree $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp prooftree.1 $(DESTDIR)$(MANDIR)/man1
TOCLEAN+=hand_dump.odoc-dump
hand_dump.odoc-dump: $(CMX_OBJECTS)
$(OCAMLDOC) -I $(LABLGTKDIR) -d doc \
-inv-merge-ml-mli -m A -dump $@ $(HAND_SOURCES)
TOCLEAN+=gen_dump.odoc-dump
gen_dump.odoc-dump: $(CMX_OBJECTS)
$(OCAMLDOC) -I $(LABLGTKDIR) -d doc \
-dump $@ $(GEN_SOURCES)
.PHONY: doc
doc: hand_dump.odoc-dump gen_dump.odoc-dump
rm -rf doc
mkdir doc
$(OCAMLDOC) -I $(LABLGTKDIR) -d doc \
-g $(ODOC_XREF) -libxref lablgtk $(LABLGTKURL) \
-inv-merge-ml-mli -m A \
-load hand_dump.odoc-dump -load gen_dump.odoc-dump
$(OCAMLDOC) -I $(LABLGTKURL) -dot -dot-reduce \
-o doc/dependencies.dot \
-load hand_dump.odoc-dump -load gen_dump.odoc-dump
dot -Tpdf doc/dependencies.dot > doc/dependencies.pdf
.PHONY: check-doc
check-doc: hand_dump.odoc-dump
$(OCAMLDOC) -g $(ODOC_CHECK) -load hand_dump.odoc-dump -check-all fcd
clean:
rm -f $(TOCLEAN)
rm -f *.cmi *.cmo *.cmx *.o *.cma *.cmxa *.a
TAGS: $(SOURCES)
otags $(SOURCES)
prooftree.man.txt: prooftree.1
nroff -man $< > $@
prooftree.man.html: prooftree.1
man2html $< | \
tail -n +3 |\
sed -e 's|<A HREF=".*Return to Main Contents</A>||' \
-e 's|/cgi-bin/man/man2html?1.\([^"]*\)|http://www.linuxmanpages.com/man1/\1.1.php|' \
-e 's|HREF="/cgi-bin/man/man2html">man2html|HREF="http://www.nongnu.org/man2html/">man2html|' \
> $@
.PHONY: sloc
sloc:
wc $(SOURCES) | sort -n