]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
Added mail archive periodically generated by hypermail.
[mandoc.git] / Makefile
1 .SUFFIXES: .html .xml .sgml .1 .3 .7 .md5 .tar.gz .1.txt .3.txt .7.txt .1.sgml .3.sgml .7.sgml .h .h.html .1.ps .3.ps .7.ps .1.pdf .3.pdf .7.pdf
2
3 PREFIX = /usr/local
4 BINDIR = $(PREFIX)/bin
5 INCLUDEDIR = $(PREFIX)/include
6 LIBDIR = $(PREFIX)/lib
7 MANDIR = $(PREFIX)/man
8 EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
9 INSTALL = install
10 INSTALL_PROGRAM = $(INSTALL) -m 0755
11 INSTALL_DATA = $(INSTALL) -m 0444
12 INSTALL_LIB = $(INSTALL) -m 0644
13 INSTALL_MAN = $(INSTALL_DATA)
14
15 VERSION = 1.10.5
16 VDATE = 27 July 2010
17
18 VFLAGS = -DVERSION="\"$(VERSION)\""
19 WFLAGS = -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
20 CFLAGS += -g $(WFLAGS) $(VFLAGS) -DHAVE_CONFIG_H
21
22 # Specify this if you want to hard-code the operating system to appear
23 # in the lower-left hand corner of -mdoc manuals.
24 # CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
25
26 LINTFLAGS += $(VFLAGS)
27
28 ROFFLNS = roff.ln
29
30 ROFFSRCS = roff.c
31
32 ROFFOBJS = roff.o
33
34 MANDOCLNS = mandoc.ln
35
36 MANDOCSRCS = mandoc.c
37
38 MANDOCOBJS = mandoc.o
39
40 MDOCLNS = mdoc_macro.ln mdoc.ln mdoc_hash.ln mdoc_strings.ln \
41 mdoc_argv.ln mdoc_validate.ln mdoc_action.ln \
42 lib.ln att.ln arch.ln vol.ln msec.ln st.ln
43
44 MDOCOBJS = mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \
45 mdoc_argv.o mdoc_validate.o mdoc_action.o lib.o att.o \
46 arch.o vol.o msec.o st.o
47
48 MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \
49 mdoc_argv.c mdoc_validate.c mdoc_action.c lib.c att.c \
50 arch.c vol.c msec.c st.c
51
52 MANLNS = man_macro.ln man.ln man_hash.ln man_validate.ln \
53 man_action.ln man_argv.ln
54
55 MANOBJS = man_macro.o man.o man_hash.o man_validate.o \
56 man_action.o man_argv.o
57 MANSRCS = man_macro.c man.c man_hash.c man_validate.c \
58 man_action.c man_argv.c
59
60 MAINLNS = main.ln mdoc_term.ln chars.ln term.ln tree.ln \
61 compat.ln man_term.ln html.ln mdoc_html.ln \
62 man_html.ln out.ln term_ps.ln term_ascii.ln
63
64 MAINOBJS = main.o mdoc_term.o chars.o term.o tree.o compat.o \
65 man_term.o html.o mdoc_html.o man_html.o out.o \
66 term_ps.o term_ascii.o
67
68 MAINSRCS = main.c mdoc_term.c chars.c term.c tree.c compat.c \
69 man_term.c html.c mdoc_html.c man_html.c out.c \
70 term_ps.c term_ascii.c
71
72 LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln \
73 llib-llibmandoc.ln llib-llibroff.ln
74
75 LNS = $(MAINLNS) $(MDOCLNS) $(MANLNS) \
76 $(MANDOCLNS) $(ROFFLNS)
77
78 LIBS = libmdoc.a libman.a libmandoc.a libroff.a
79
80 OBJS = $(MDOCOBJS) $(MAINOBJS) $(MANOBJS) \
81 $(MANDOCOBJS) $(ROFFOBJS)
82
83 SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS) \
84 $(MANDOCSRCS) $(ROFFSRCS)
85
86 DATAS = arch.in att.in lib.in msec.in st.in \
87 vol.in chars.in
88
89 HEADS = mdoc.h libmdoc.h man.h libman.h term.h \
90 libmandoc.h html.h chars.h out.h main.h roff.h \
91 mandoc.h
92
93 GSGMLS = mandoc.1.sgml mdoc.3.sgml mdoc.7.sgml \
94 mandoc_char.7.sgml man.7.sgml man.3.sgml roff.7.sgml \
95 roff.3.sgml
96
97 SGMLS = index.sgml
98
99 HTMLS = ChangeLog.html index.html man.h.html mdoc.h.html \
100 mandoc.h.html roff.h.html mandoc.1.html mdoc.3.html \
101 man.3.html mdoc.7.html man.7.html mandoc_char.7.html \
102 roff.7.html roff.3.html
103
104 PSS = mandoc.1.ps mdoc.3.ps man.3.ps mdoc.7.ps man.7.ps \
105 mandoc_char.7.ps roff.7.ps roff.3.ps
106
107 PDFS = mandoc.1.pdf mdoc.3.pdf man.3.pdf mdoc.7.pdf man.7.pdf \
108 mandoc_char.7.pdf roff.7.pdf roff.3.pdf
109
110 XSLS = ChangeLog.xsl
111
112 TEXTS = mandoc.1.txt mdoc.3.txt man.3.txt mdoc.7.txt man.7.txt \
113 mandoc_char.7.txt ChangeLog.txt \
114 roff.7.txt roff.3.txt
115
116 EXAMPLES = example.style.css
117
118 XMLS = ChangeLog.xml
119
120 STATICS = index.css style.css external.png
121
122 MD5S = mdocml-$(VERSION).md5
123
124 TARGZS = mdocml-$(VERSION).tar.gz
125
126 MANS = mandoc.1 mdoc.3 mdoc.7 mandoc_char.7 man.7 \
127 man.3 roff.7 roff.3
128
129 BINS = mandoc
130
131 TESTS = test-strlcat.c test-strlcpy.c
132
133 CONFIGS = config.h.pre config.h.post
134
135 DOCLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
136 $(TARGZS) tags $(MD5S) $(XMLS) $(TEXTS) $(GSGMLS) \
137 config.h config.log $(PSS) $(PDFS)
138
139 DOINSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
140 $(DATAS) $(XSLS) $(EXAMPLES) $(TESTS) $(CONFIGS)
141
142 all: $(BINS)
143
144 lint: $(LLNS)
145
146 clean:
147 rm -f $(DOCLEAN)
148
149 dist: mdocml-$(VERSION).tar.gz
150
151 www: all $(GSGMLS) $(HTMLS) $(TEXTS) $(MD5S) $(TARGZS) $(PSS) $(PDFS)
152
153 ps: $(PSS)
154
155 pdf: $(PDFS)
156
157 installwww: www
158 $(INSTALL_DATA) $(HTMLS) $(PSS) $(PDFS) $(TEXTS) $(STATICS) $(DESTDIR)$(PREFIX)/
159 $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(DESTDIR)$(PREFIX)/snapshots/
160 $(INSTALL_DATA) mdocml-$(VERSION).md5 $(DESTDIR)$(PREFIX)/snapshots/
161 $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(DESTDIR)$(PREFIX)/snapshots/mdocml.tar.gz
162 $(INSTALL_DATA) mdocml-$(VERSION).md5 $(DESTDIR)$(PREFIX)/snapshots/mdocml.md5
163
164 install:
165 mkdir -p $(DESTDIR)$(BINDIR)
166 mkdir -p $(DESTDIR)$(EXAMPLEDIR)
167 mkdir -p $(DESTDIR)$(MANDIR)/man1
168 mkdir -p $(DESTDIR)$(MANDIR)/man7
169 $(INSTALL_PROGRAM) mandoc $(DESTDIR)$(BINDIR)
170 $(INSTALL_MAN) mandoc.1 $(DESTDIR)$(MANDIR)/man1
171 $(INSTALL_MAN) man.7 mdoc.7 roff.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
172 $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
173
174 uninstall:
175 rm -f $(DESTDIR)$(BINDIR)/mandoc
176 rm -f $(DESTDIR)$(MANDIR)/man1/mandoc.1
177 rm -f $(DESTDIR)$(MANDIR)/man7/mdoc.7
178 rm -f $(DESTDIR)$(MANDIR)/man7/roff.7
179 rm -f $(DESTDIR)$(MANDIR)/man7/man.7
180 rm -f $(DESTDIR)$(MANDIR)/man7/mandoc_char.7
181 rm -f $(DESTDIR)$(EXAMPLEDIR)/example.style.css
182
183 $(OBJS): config.h
184
185 $(LNS): config.h
186
187 man_macro.ln man_macro.o: man_macro.c libman.h
188
189 lib.ln lib.o: lib.c lib.in libmdoc.h
190
191 att.ln att.o: att.c att.in libmdoc.h
192
193 arch.ln arch.o: arch.c arch.in libmdoc.h
194
195 vol.ln vol.o: vol.c vol.in libmdoc.h
196
197 chars.ln chars.o: chars.c chars.in chars.h
198
199 msec.ln msec.o: msec.c msec.in libmdoc.h
200
201 st.ln st.o: st.c st.in libmdoc.h
202
203 mdoc_macro.ln mdoc_macro.o: mdoc_macro.c libmdoc.h
204
205 mdoc_term.ln mdoc_term.o: mdoc_term.c term.h mdoc.h
206
207 mdoc_strings.ln mdoc_strings.o: mdoc_strings.c libmdoc.h
208
209 man_hash.ln man_hash.o: man_hash.c libman.h
210
211 mdoc_hash.ln mdoc_hash.o: mdoc_hash.c libmdoc.h
212
213 mdoc.ln mdoc.o: mdoc.c libmdoc.h
214
215 man.ln man.o: man.c libman.h
216
217 main.ln main.o: main.c mdoc.h man.h roff.h
218
219 compat.ln compat.o: compat.c
220
221 term.ln term.o: term.c term.h man.h mdoc.h chars.h
222
223 term_ps.ln term_ps.o: term_ps.c term.h main.h
224
225 term_ascii.ln term_ascii.o: term_ascii.c term.h main.h
226
227 html.ln html.o: html.c html.h chars.h
228
229 mdoc_html.ln mdoc_html.o: mdoc_html.c html.h mdoc.h
230
231 man_html.ln man_html.o: man_html.c html.h man.h out.h
232
233 out.ln out.o: out.c out.h
234
235 mandoc.ln mandoc.o: mandoc.c libmandoc.h
236
237 tree.ln tree.o: tree.c man.h mdoc.h
238
239 mdoc_argv.ln mdoc_argv.o: mdoc_argv.c libmdoc.h
240
241 man_argv.ln man_argv.o: man_argv.c libman.h
242
243 man_validate.ln man_validate.o: man_validate.c libman.h
244
245 mdoc_validate.ln mdoc_validate.o: mdoc_validate.c libmdoc.h
246
247 mdoc_action.ln mdoc_action.o: mdoc_action.c libmdoc.h
248
249 libmdoc.h: mdoc.h
250
251 ChangeLog.xml:
252 cvs2cl --xml --xml-encoding iso-8859-15 -t --noxmlns -f $@
253
254 ChangeLog.txt:
255 cvs2cl -t -f $@
256
257 ChangeLog.html: ChangeLog.xml ChangeLog.xsl
258 xsltproc -o $@ ChangeLog.xsl ChangeLog.xml
259
260 mdocml-$(VERSION).tar.gz: $(DOINSTALL)
261 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
262 cp -f $(DOINSTALL) .dist/mdocml/mdocml-$(VERSION)/
263 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
264 rm -rf .dist/
265
266 llib-llibmdoc.ln: $(MDOCLNS)
267 $(LINT) -Clibmdoc $(MDOCLNS)
268
269 llib-llibman.ln: $(MANLNS)
270 $(LINT) -Clibman $(MANLNS)
271
272 llib-llibmandoc.ln: $(MANDOCLNS)
273 $(LINT) -Clibmandoc $(MANDOCLNS)
274
275 llib-llibroff.ln: $(ROFFLNS)
276 $(LINT) -Clibroff $(ROFFLNS)
277
278 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln llib-llibroff.ln
279 $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln llib-llibroff.ln
280
281 libmdoc.a: $(MDOCOBJS)
282 $(AR) rs $@ $(MDOCOBJS)
283
284 libman.a: $(MANOBJS)
285 $(AR) rs $@ $(MANOBJS)
286
287 libmandoc.a: $(MANDOCOBJS)
288 $(AR) rs $@ $(MANDOCOBJS)
289
290 libroff.a: $(ROFFOBJS)
291 $(AR) rs $@ $(ROFFOBJS)
292
293 mandoc: $(MAINOBJS) libroff.a libmdoc.a libman.a libmandoc.a
294 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libroff.a libmdoc.a libman.a libmandoc.a
295
296 .sgml.html:
297 validate --warn $<
298 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
299
300 .1.1.txt .3.3.txt .7.7.txt:
301 ./mandoc -Tascii -Wall,error -fstrict $< | col -b > $@
302
303 .1.1.sgml .3.3.sgml .7.7.sgml:
304 ./mandoc -Thtml -Wall,error -fstrict -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< > $@
305
306 .1.1.ps .3.3.ps .7.7.ps:
307 ./mandoc -Tps -Wall,error -fstrict $< > $@
308
309 .1.1.pdf .3.3.pdf .7.7.pdf:
310 ./mandoc -Tpdf -Wall,error -fstrict $< > $@
311
312 .tar.gz.md5:
313 md5 $< > $@
314
315 .h.h.html:
316 highlight -I $< >$@
317
318 config.h: config.h.pre config.h.post
319 rm -f config.log
320 ( cat config.h.pre; \
321 echo; \
322 if $(CC) $(CFLAGS) -Werror -c test-strlcat.c >> config.log 2>&1; then \
323 echo '#define HAVE_STRLCAT'; \
324 rm test-strlcat.o; \
325 fi; \
326 if $(CC) $(CFLAGS) -Werror -c test-strlcpy.c >> config.log 2>&1; then \
327 echo '#define HAVE_STRLCPY'; \
328 rm test-strlcpy.o; \
329 fi; \
330 echo; \
331 cat config.h.post \
332 ) > $@