]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
If no man.cgi `whatis' results are found, offer a quick link to the apropos
[mandoc.git] / Makefile
1 .PHONY: clean install installwww
2 .SUFFIXES: .sgml .html .md5 .h .h.html
3 .SUFFIXES: .1 .3 .7 .8
4 .SUFFIXES: .1.txt .3.txt .7.txt .8.txt
5 .SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf
6 .SUFFIXES: .1.ps .3.ps .7.ps .8.ps
7 .SUFFIXES: .1.html .3.html .7.html .8.html
8 .SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml
9
10 # Specify this if you want to hard-code the operating system to appear
11 # in the lower-left hand corner of -mdoc manuals.
12 #
13 # CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
14
15 VERSION = 1.12.0
16 VDATE = 8 October 2011
17
18 # IFF your system supports multi-byte functions (setlocale(), wcwidth(),
19 # putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a
20 # UCS-4 value) should you define USE_WCHAR. If you define it and your
21 # system DOESN'T support this, -Tlocale will produce garbage.
22 # If you don't define it, -Tlocale is a synonym for -Tacsii.
23 #
24 CFLAGS += -DUSE_WCHAR
25
26 # If your system has manpath(1), uncomment this. This is most any
27 # system that's not OpenBSD or NetBSD. If uncommented, apropos(1),
28 # mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH
29 # variable.
30 #CFLAGS += -DUSE_MANPATH
31
32 # If your system supports static binaries only, uncomment this.
33 STATIC = -static
34
35 CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\""
36 CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
37 PREFIX = /usr/local
38 WWWPREFIX = /var/www
39 HTDOCDIR = $(WWWPREFIX)/htdocs
40 CGIBINDIR = $(WWWPREFIX)/cgi-bin
41 BINDIR = $(PREFIX)/bin
42 INCLUDEDIR = $(PREFIX)/include/mandoc
43 LIBDIR = $(PREFIX)/lib/mandoc
44 MANDIR = $(PREFIX)/man
45 EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
46 INSTALL = install
47 INSTALL_PROGRAM = $(INSTALL) -m 0755
48 INSTALL_DATA = $(INSTALL) -m 0444
49 INSTALL_LIB = $(INSTALL) -m 0644
50 INSTALL_SOURCE = $(INSTALL) -m 0644
51 INSTALL_MAN = $(INSTALL_DATA)
52
53 # Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and
54 # apropos.
55 # However, if you don't have -ldb at all (or it's not native), then
56 # comment out apropos and mandocdb.
57 #
58 #DBLIB = -ldb
59 DBBIN = apropos mandocdb man.cgi catman whatis
60 DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln
61
62 all: mandoc preconv demandoc $(DBBIN)
63
64 SRCS = Makefile \
65 apropos.1 \
66 apropos.c \
67 arch.c \
68 arch.in \
69 att.c \
70 att.in \
71 chars.c \
72 chars.in \
73 compat_getsubopt.c \
74 compat_strlcat.c \
75 compat_strlcpy.c \
76 config.h.post \
77 config.h.pre \
78 demandoc.c \
79 demandoc.1 \
80 eqn.7 \
81 eqn.c \
82 eqn_html.c \
83 eqn_term.c \
84 example.style.css \
85 external.png \
86 html.c \
87 html.h \
88 index.css \
89 index.sgml \
90 lib.c \
91 lib.in \
92 libman.h \
93 libmandoc.h \
94 libmdoc.h \
95 libroff.h \
96 main.c \
97 main.h \
98 man.h \
99 man.7 \
100 man.c \
101 man.cgi.7 \
102 man_hash.c \
103 man_html.c \
104 man_macro.c \
105 man_term.c \
106 man_validate.c \
107 mandoc.1 \
108 mandoc.3 \
109 mandoc.c \
110 mandoc.h \
111 mandocdb.8 \
112 mandocdb.c \
113 mandocdb.h \
114 mandoc_char.7 \
115 manpath.c \
116 manpath.h \
117 catman.c \
118 catman.8 \
119 mdoc.h \
120 mdoc.7 \
121 mdoc.c \
122 mdoc_argv.c \
123 mdoc_hash.c \
124 mdoc_html.c \
125 mdoc_macro.c \
126 mdoc_man.c \
127 mdoc_term.c \
128 mdoc_validate.c \
129 msec.c \
130 msec.in \
131 out.c \
132 out.h \
133 preconv.1 \
134 preconv.c \
135 predefs.in \
136 read.c \
137 roff.7 \
138 roff.c \
139 st.c \
140 st.in \
141 style.css \
142 tbl.7 \
143 tbl.c \
144 tbl_data.c \
145 tbl_html.c \
146 tbl_layout.c \
147 tbl_opts.c \
148 tbl_term.c \
149 term.c \
150 term.h \
151 term_ascii.c \
152 term_ps.c \
153 test-getsubopt.c \
154 test-mmap.c \
155 test-strlcat.c \
156 test-strlcpy.c \
157 test-strptime.c \
158 tree.c \
159 vol.c \
160 vol.in
161
162 LIBMAN_OBJS = man.o \
163 man_hash.o \
164 man_macro.o \
165 man_validate.o
166 LIBMAN_LNS = man.ln \
167 man_hash.ln \
168 man_macro.ln \
169 man_validate.ln
170
171 LIBMDOC_OBJS = arch.o \
172 att.o \
173 lib.o \
174 mdoc.o \
175 mdoc_argv.o \
176 mdoc_hash.o \
177 mdoc_macro.o \
178 mdoc_validate.o \
179 st.o \
180 vol.o
181 LIBMDOC_LNS = arch.ln \
182 att.ln \
183 lib.ln \
184 mdoc.ln \
185 mdoc_argv.ln \
186 mdoc_hash.ln \
187 mdoc_macro.ln \
188 mdoc_validate.ln \
189 st.ln \
190 vol.ln
191
192 LIBROFF_OBJS = eqn.o \
193 roff.o \
194 tbl.o \
195 tbl_data.o \
196 tbl_layout.o \
197 tbl_opts.o
198 LIBROFF_LNS = eqn.ln \
199 roff.ln \
200 tbl.ln \
201 tbl_data.ln \
202 tbl_layout.ln \
203 tbl_opts.ln
204
205 LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
206 $(LIBMDOC_OBJS) \
207 $(LIBROFF_OBJS) \
208 chars.o \
209 mandoc.o \
210 msec.o \
211 read.o
212 LIBMANDOC_LNS = $(LIBMAN_LNS) \
213 $(LIBMDOC_LNS) \
214 $(LIBROFF_LNS) \
215 chars.ln \
216 mandoc.ln \
217 msec.ln \
218 read.ln
219
220 COMPAT_OBJS = compat_getsubopt.o \
221 compat_strlcat.o \
222 compat_strlcpy.o
223 COMPAT_LNS = compat_getsubopt.ln \
224 compat_strlcat.ln \
225 compat_strlcpy.ln
226
227 arch.o arch.ln: arch.in
228 att.o att.ln: att.in
229 chars.o chars.ln: chars.in
230 lib.o lib.ln: lib.in
231 msec.o msec.ln: msec.in
232 roff.o roff.ln: predefs.in
233 st.o st.ln: st.in
234 vol.o vol.ln: vol.in
235
236 $(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h
237 $(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h
238 $(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h
239 $(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h
240
241 $(COMPAT_OBJS) $(COMPAT_LNS): config.h
242
243 MANDOC_HTML_OBJS = eqn_html.o \
244 html.o \
245 man_html.o \
246 mdoc_html.o \
247 tbl_html.o
248 MANDOC_HTML_LNS = eqn_html.ln \
249 html.ln \
250 man_html.ln \
251 mdoc_html.ln \
252 tbl_html.ln
253
254 MANDOC_MAN_OBJS = mdoc_man.o
255 MANDOC_MAN_LNS = mdoc_man.ln
256
257 MANDOC_TERM_OBJS = eqn_term.o \
258 man_term.o \
259 mdoc_term.o \
260 term.o \
261 term_ascii.o \
262 term_ps.o \
263 tbl_term.o
264 MANDOC_TERM_LNS = eqn_term.ln \
265 man_term.ln \
266 mdoc_term.ln \
267 term.ln \
268 term_ascii.ln \
269 term_ps.ln \
270 tbl_term.ln
271
272 MANDOC_OBJS = $(MANDOC_HTML_OBJS) \
273 $(MANDOC_MAN_OBJS) \
274 $(MANDOC_TERM_OBJS) \
275 main.o \
276 out.o \
277 tree.o
278 MANDOC_LNS = $(MANDOC_HTML_LNS) \
279 $(MANDOC_MAN_LNS) \
280 $(MANDOC_TERM_LNS) \
281 main.ln \
282 out.ln \
283 tree.ln
284
285 $(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h
286 $(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h
287 $(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h
288
289 MANDOCDB_OBJS = mandocdb.o manpath.o
290 MANDOCDB_LNS = mandocdb.ln manpath.ln
291
292 $(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h
293
294 PRECONV_OBJS = preconv.o
295 PRECONV_LNS = preconv.ln
296
297 $(PRECONV_OBJS) $(PRECONV_LNS): config.h
298
299 APROPOS_OBJS = apropos.o apropos_db.o manpath.o
300 APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln
301
302 $(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h
303
304 CGI_OBJS = $(MANDOC_HTML_OBJS) \
305 $(MANDOC_MAN_OBJS) \
306 $(MANDOC_TERM_OBJS) \
307 cgi.o \
308 apropos_db.o \
309 manpath.o \
310 out.o \
311 tree.o
312
313 CGI_LNS = $(MANDOC_HTML_LNS) \
314 $(MANDOC_MAN_LNS) \
315 $(MANDOC_TERM_LNS) \
316 cgi.ln \
317 apropos_db.ln \
318 manpath.ln \
319 out.ln \
320 tree.ln
321
322 $(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h
323
324 CATMAN_OBJS = catman.o manpath.o
325 CATMAN_LNS = catman.ln manpath.ln
326
327 $(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h
328
329 DEMANDOC_OBJS = demandoc.o
330 DEMANDOC_LNS = demandoc.ln
331
332 $(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h
333
334 INDEX_MANS = apropos.1.html \
335 apropos.1.xhtml \
336 apropos.1.ps \
337 apropos.1.pdf \
338 apropos.1.txt \
339 demandoc.1.html \
340 demandoc.1.xhtml \
341 demandoc.1.ps \
342 demandoc.1.pdf \
343 demandoc.1.txt \
344 mandoc.1.html \
345 mandoc.1.xhtml \
346 mandoc.1.ps \
347 mandoc.1.pdf \
348 mandoc.1.txt \
349 mandoc.3.html \
350 mandoc.3.xhtml \
351 mandoc.3.ps \
352 mandoc.3.pdf \
353 mandoc.3.txt \
354 eqn.7.html \
355 eqn.7.xhtml \
356 eqn.7.ps \
357 eqn.7.pdf \
358 eqn.7.txt \
359 man.7.html \
360 man.7.xhtml \
361 man.7.ps \
362 man.7.pdf \
363 man.7.txt \
364 mandoc_char.7.html \
365 mandoc_char.7.xhtml \
366 mandoc_char.7.ps \
367 mandoc_char.7.pdf \
368 mandoc_char.7.txt \
369 mdoc.7.html \
370 mdoc.7.xhtml \
371 mdoc.7.ps \
372 mdoc.7.pdf \
373 mdoc.7.txt \
374 preconv.1.html \
375 preconv.1.xhtml \
376 preconv.1.ps \
377 preconv.1.pdf \
378 preconv.1.txt \
379 roff.7.html \
380 roff.7.xhtml \
381 roff.7.ps \
382 roff.7.pdf \
383 roff.7.txt \
384 tbl.7.html \
385 tbl.7.xhtml \
386 tbl.7.ps \
387 tbl.7.pdf \
388 tbl.7.txt \
389 mandocdb.8.html \
390 mandocdb.8.xhtml \
391 mandocdb.8.ps \
392 mandocdb.8.pdf \
393 mandocdb.8.txt
394
395 $(INDEX_MANS): mandoc
396
397 INDEX_OBJS = $(INDEX_MANS) \
398 man.h.html \
399 mandoc.h.html \
400 mdoc.h.html \
401 mdocml.tar.gz \
402 mdocml.md5
403
404 www: index.html
405
406 lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN)
407
408 clean:
409 rm -f libmandoc.a $(LIBMANDOC_OBJS)
410 rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS)
411 rm -f mandocdb $(MANDOCDB_OBJS)
412 rm -f llib-lmandocdb.ln $(MANDOCDB_LNS)
413 rm -f preconv $(PRECONV_OBJS)
414 rm -f llib-lpreconv.ln $(PRECONV_LNS)
415 rm -f apropos $(APROPOS_OBJS)
416 rm -f llib-lapropos.ln $(APROPOS_LNS)
417 rm -f man.cgi $(CGI_OBJS)
418 rm -f llib-lman.cgi.ln $(CGI_LNS)
419 rm -f catman $(CATMAN_OBJS)
420 rm -f llib-lcatman.ln $(CATMAN_LNS)
421 rm -f demandoc $(DEMANDOC_OBJS)
422 rm -f llib-ldemandoc.ln $(DEMANDOC_LNS)
423 rm -f mandoc $(MANDOC_OBJS)
424 rm -f llib-lmandoc.ln $(MANDOC_LNS)
425 rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS)
426 rm -f mdocml.tar.gz mdocml-win32.zip mdocml-win64.zip mdocml-macosx.zip
427 rm -f index.html $(INDEX_OBJS)
428 rm -rf test-strlcpy.DSYM
429 rm -rf test-strlcat.DSYM
430 rm -rf test-strptime.DSYM
431 rm -rf test-mmap.DSYM
432 rm -rf test-getsubopt.DSYM
433
434 install: all
435 mkdir -p $(DESTDIR)$(BINDIR)
436 mkdir -p $(DESTDIR)$(EXAMPLEDIR)
437 mkdir -p $(DESTDIR)$(LIBDIR)
438 mkdir -p $(DESTDIR)$(INCLUDEDIR)
439 mkdir -p $(DESTDIR)$(MANDIR)/man1
440 mkdir -p $(DESTDIR)$(MANDIR)/man3
441 mkdir -p $(DESTDIR)$(MANDIR)/man7
442 mkdir -p $(DESTDIR)$(MANDIR)/man8
443 $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR)
444 $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
445 $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR)
446 $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
447 $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3
448 $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
449 $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
450
451 installcgi: all
452 mkdir -p $(DESTDIR)$(CGIBINDIR)
453 mkdir -p $(DESTDIR)$(HTDOCDIR)
454 $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR)
455 $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css
456 $(INSTALL_DATA) man.cgi.css $(DESTDIR)$(HTDOCDIR)
457
458 installwww: www
459 mkdir -p $(PREFIX)/snapshots
460 mkdir -p $(PREFIX)/binaries
461 $(INSTALL_DATA) index.html external.png index.css $(PREFIX)
462 $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX)
463 $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX)
464 $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots
465 $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots
466 $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz
467 $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5
468
469 libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
470 $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
471
472 llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS)
473 $(LINT) $(LINTFLAGS) -Clibmandoc $(COMPAT_LNS) $(LIBMANDOC_LNS)
474
475 mandoc: $(MANDOC_OBJS) libmandoc.a
476 $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a
477
478 llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln
479 $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln
480
481 mandocdb: $(MANDOCDB_OBJS) libmandoc.a
482 $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB)
483
484 llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln
485 $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln
486
487 preconv: $(PRECONV_OBJS)
488 $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS)
489
490 llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln
491 $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln
492
493 whatis: apropos
494 cp -f apropos whatis
495
496 apropos: $(APROPOS_OBJS) libmandoc.a
497 $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB)
498
499 llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln
500 $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln
501
502 catman: $(CATMAN_OBJS) libmandoc.a
503 $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB)
504
505 llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln
506 $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln
507
508 man.cgi: $(CGI_OBJS) libmandoc.a
509 $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB)
510
511 llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln
512 $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln
513
514 demandoc: $(DEMANDOC_OBJS) libmandoc.a
515 $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a
516
517 llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln
518 $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln
519
520 mdocml.md5: mdocml.tar.gz
521 md5 mdocml.tar.gz >$@
522
523 mdocml.tar.gz: $(SRCS)
524 mkdir -p .dist/mdocml-$(VERSION)/
525 $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION)
526 ( cd .dist/ && tar zcf ../$@ ./ )
527 rm -rf .dist/
528
529 mdocml-win32.zip: $(SRCS)
530 mkdir -p .win32/mdocml-$(VERSION)/
531 $(INSTALL_SOURCE) $(SRCS) .win32
532 cp .win32/Makefile .win32/Makefile.old
533 egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile
534 ( cd .win32; \
535 CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \
536 make install PREFIX=mdocml-$(VERSION) ; \
537 zip -r ../$@ mdocml-$(VERSION) )
538 rm -rf .win32
539
540 mdocml-win64.zip: $(SRCS)
541 mkdir -p .win64/mdocml-$(VERSION)/
542 $(INSTALL_SOURCE) $(SRCS) .win64
543 cp .win64/Makefile .win64/Makefile.old
544 egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile
545 ( cd .win64; \
546 CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \
547 make install PREFIX=mdocml-$(VERSION) ; \
548 zip -r ../$@ mdocml-$(VERSION) )
549 rm -rf .win64
550
551 mdocml-macosx.zip: $(SRCS)
552 mkdir -p .macosx/mdocml-$(VERSION)/
553 $(INSTALL_SOURCE) $(SRCS) .macosx
554 ( cd .macosx; \
555 CFLAGS="-arch i386 -arch x86_64 -arch ppc" LDFLAGS="-arch i386 -arch x86_64 -arch ppc" make; \
556 make install PREFIX=mdocml-$(VERSION) ; \
557 zip -r ../$@ mdocml-$(VERSION) )
558 rm -rf .macosx
559
560 index.html: $(INDEX_OBJS)
561
562 config.h: config.h.pre config.h.post
563 rm -f config.log
564 ( cat config.h.pre; \
565 echo; \
566 if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \
567 echo '#define HAVE_STRPTIME'; \
568 rm test-strptime; \
569 fi; \
570 if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \
571 echo '#define HAVE_GETSUBOPT'; \
572 rm test-getsubopt; \
573 fi; \
574 if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \
575 echo '#define HAVE_STRLCAT'; \
576 rm test-strlcat; \
577 fi; \
578 if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \
579 echo '#define HAVE_MMAP'; \
580 rm test-mmap; \
581 fi; \
582 if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \
583 echo '#define HAVE_STRLCPY'; \
584 rm test-strlcpy; \
585 fi; \
586 echo; \
587 cat config.h.post \
588 ) > $@
589
590 .h.h.html:
591 highlight -I $< >$@
592
593 .1.1.txt .3.3.txt .7.7.txt .8.8.txt:
594 ./mandoc -Tascii -Wall,stop $< | col -b >$@
595
596 .1.1.html .3.3.html .7.7.html .8.8.html:
597 ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@
598
599 .1.1.ps .3.3.ps .7.7.ps .8.8.ps:
600 ./mandoc -Tps -Wall,stop $< >$@
601
602 .1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml:
603 ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@
604
605 .1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf:
606 ./mandoc -Tpdf -Wall,stop $< >$@
607
608 .sgml.html:
609 validate --warn $<
610 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@