Annotation of mandoc/Makefile, Revision 1.399
1.319 kristaps 1: .PHONY: clean install installwww
2: .SUFFIXES: .sgml .html .md5 .h .h.html
1.356 schwarze 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
1.259 kristaps 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.
1.375 kristaps 12: #
1.319 kristaps 13: # CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
1.259 kristaps 14:
1.395 kristaps 15: VERSION = 1.12.1
16: VDATE = 23 March 2012
1.375 kristaps 17:
1.341 kristaps 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.
1.375 kristaps 23: #
1.362 kristaps 24: CFLAGS += -DUSE_WCHAR
1.375 kristaps 25:
1.380 kristaps 26: # If your system has manpath(1), uncomment this. This is most any
1.396 kristaps 27: # system that's not OpenBSD or NetBSD. If uncommented, manpage(1) and
28: # mandocdb(8) will use manpath(1) to get the MANPATH variable.
1.399 ! kristaps 29: #CFLAGS += -DUSE_MANPATH
1.383 kristaps 30:
1.390 kristaps 31: # If your system supports static binaries only, uncomment this. This
32: # appears only to be BSD UNIX systems (Mac OS X has no support and Linux
33: # requires -pthreads for static libdb).
1.386 kristaps 34: STATIC = -static
1.379 kristaps 35:
1.396 kristaps 36: CFLAGS += -I/usr/local/include -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\""
1.319 kristaps 37: CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
38: PREFIX = /usr/local
1.387 kristaps 39: WWWPREFIX = /var/www
40: HTDOCDIR = $(WWWPREFIX)/htdocs
41: CGIBINDIR = $(WWWPREFIX)/cgi-bin
1.319 kristaps 42: BINDIR = $(PREFIX)/bin
1.321 kristaps 43: INCLUDEDIR = $(PREFIX)/include/mandoc
44: LIBDIR = $(PREFIX)/lib/mandoc
1.319 kristaps 45: MANDIR = $(PREFIX)/man
46: EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
47: INSTALL = install
48: INSTALL_PROGRAM = $(INSTALL) -m 0755
49: INSTALL_DATA = $(INSTALL) -m 0444
50: INSTALL_LIB = $(INSTALL) -m 0644
1.353 kristaps 51: INSTALL_SOURCE = $(INSTALL) -m 0644
1.319 kristaps 52: INSTALL_MAN = $(INSTALL_DATA)
53:
1.396 kristaps 54: DBLIB = -L/usr/local/lib -lsqlite3
55: DBBIN = mandocdb manpage apropos
1.358 kristaps 56:
1.375 kristaps 57: all: mandoc preconv demandoc $(DBBIN)
1.319 kristaps 58:
59: SRCS = Makefile \
1.389 kristaps 60: TODO \
1.319 kristaps 61: arch.c \
62: arch.in \
63: att.c \
64: att.in \
1.389 kristaps 65: cgi.c \
1.319 kristaps 66: chars.c \
67: chars.in \
1.390 kristaps 68: compat_fgetln.c \
1.362 kristaps 69: compat_getsubopt.c \
70: compat_strlcat.c \
71: compat_strlcpy.c \
1.319 kristaps 72: config.h.post \
73: config.h.pre \
1.389 kristaps 74: demandoc.1 \
1.369 kristaps 75: demandoc.c \
1.319 kristaps 76: eqn.7 \
77: eqn.c \
1.360 kristaps 78: eqn_html.c \
1.359 kristaps 79: eqn_term.c \
1.319 kristaps 80: example.style.css \
81: external.png \
82: html.c \
83: html.h \
84: index.css \
85: index.sgml \
86: lib.c \
87: lib.in \
88: libman.h \
89: libmandoc.h \
90: libmdoc.h \
91: libroff.h \
92: main.c \
93: main.h \
94: man.7 \
95: man.c \
1.391 kristaps 96: man-cgi.css \
1.389 kristaps 97: man.h \
1.319 kristaps 98: man_hash.c \
99: man_html.c \
100: man_macro.c \
101: man_term.c \
102: man_validate.c \
103: mandoc.1 \
104: mandoc.3 \
105: mandoc.c \
106: mandoc.h \
1.389 kristaps 107: mandoc_char.7 \
1.356 schwarze 108: mandocdb.8 \
1.355 kristaps 109: mandocdb.c \
1.380 kristaps 110: manpath.c \
111: manpath.h \
1.319 kristaps 112: mdoc.7 \
113: mdoc.c \
1.389 kristaps 114: mdoc.h \
1.319 kristaps 115: mdoc_argv.c \
116: mdoc_hash.c \
117: mdoc_html.c \
118: mdoc_macro.c \
1.371 schwarze 119: mdoc_man.c \
1.319 kristaps 120: mdoc_term.c \
121: mdoc_validate.c \
122: msec.c \
123: msec.in \
124: out.c \
125: out.h \
1.344 kristaps 126: preconv.1 \
127: preconv.c \
1.342 kristaps 128: predefs.in \
1.319 kristaps 129: read.c \
130: roff.7 \
131: roff.c \
132: st.c \
133: st.in \
134: style.css \
135: tbl.7 \
136: tbl.c \
137: tbl_data.c \
138: tbl_html.c \
139: tbl_layout.c \
140: tbl_opts.c \
141: tbl_term.c \
142: term.c \
143: term.h \
144: term_ascii.c \
145: term_ps.c \
1.390 kristaps 146: test-fgetln.c \
1.365 kristaps 147: test-getsubopt.c \
1.347 kristaps 148: test-mmap.c \
1.397 kristaps 149: test-ohash.c \
1.319 kristaps 150: test-strlcat.c \
151: test-strlcpy.c \
1.365 kristaps 152: test-strptime.c \
1.319 kristaps 153: tree.c \
154: vol.c \
1.396 kristaps 155: vol.in
1.319 kristaps 156:
157: LIBMAN_OBJS = man.o \
158: man_hash.o \
159: man_macro.o \
160: man_validate.o
1.325 kristaps 161:
1.319 kristaps 162: LIBMDOC_OBJS = arch.o \
163: att.o \
164: lib.o \
165: mdoc.o \
166: mdoc_argv.o \
167: mdoc_hash.o \
168: mdoc_macro.o \
169: mdoc_validate.o \
170: st.o \
171: vol.o
1.325 kristaps 172:
1.319 kristaps 173: LIBROFF_OBJS = eqn.o \
174: roff.o \
175: tbl.o \
176: tbl_data.o \
177: tbl_layout.o \
178: tbl_opts.o
1.325 kristaps 179:
1.319 kristaps 180: LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
181: $(LIBMDOC_OBJS) \
182: $(LIBROFF_OBJS) \
1.333 kristaps 183: chars.o \
1.319 kristaps 184: mandoc.o \
1.385 schwarze 185: msec.o \
1.319 kristaps 186: read.o
1.325 kristaps 187:
1.390 kristaps 188: COMPAT_OBJS = compat_fgetln.o \
189: compat_getsubopt.o \
1.397 kristaps 190: compat_ohash.o \
1.362 kristaps 191: compat_strlcat.o \
192: compat_strlcpy.o
1.319 kristaps 193:
1.396 kristaps 194: arch.o: arch.in
195: att.o: att.in
196: chars.o: chars.in
197: lib.o: lib.in
198: msec.o: msec.in
199: roff.o: predefs.in
200: st.o: st.in
201: vol.o: vol.in
202:
203: $(LIBMAN_OBJS): libman.h
204: $(LIBMDOC_OBJS): libmdoc.h
205: $(LIBROFF_OBJS): libroff.h
206: $(LIBMANDOC_OBJS): mandoc.h mdoc.h man.h libmandoc.h config.h
1.397 kristaps 207: $(COMPAT_OBJS): config.h compat_ohash.h
1.362 kristaps 208:
1.360 kristaps 209: MANDOC_HTML_OBJS = eqn_html.o \
210: html.o \
1.319 kristaps 211: man_html.o \
212: mdoc_html.o \
213: tbl_html.o
1.396 kristaps 214: $(MANDOC_HTML_OBJS): html.h
1.325 kristaps 215:
1.371 schwarze 216: MANDOC_MAN_OBJS = mdoc_man.o
217:
1.359 kristaps 218: MANDOC_TERM_OBJS = eqn_term.o \
219: man_term.o \
1.319 kristaps 220: mdoc_term.o \
221: term.o \
222: term_ascii.o \
223: term_ps.o \
224: tbl_term.o
1.396 kristaps 225: $(MANDOC_TERM_OBJS): term.h
1.325 kristaps 226:
1.319 kristaps 227: MANDOC_OBJS = $(MANDOC_HTML_OBJS) \
1.371 schwarze 228: $(MANDOC_MAN_OBJS) \
1.319 kristaps 229: $(MANDOC_TERM_OBJS) \
230: main.o \
231: out.o \
232: tree.o
1.396 kristaps 233: $(MANDOC_OBJS): main.h mandoc.h mdoc.h man.h config.h out.h
1.319 kristaps 234:
1.380 kristaps 235: MANDOCDB_OBJS = mandocdb.o manpath.o
1.399 ! kristaps 236: $(MANDOCDB_OBJS): mansearch.h mandoc.h mdoc.h man.h config.h manpath.h
1.326 kristaps 237:
1.343 kristaps 238: PRECONV_OBJS = preconv.o
1.396 kristaps 239: $(PRECONV_OBJS): config.h
1.376 kristaps 240:
1.396 kristaps 241: APROPOS_OBJS = apropos.o mansearch.o manpath.o
1.399 ! kristaps 242: $(APROPOS_OBJS): config.h manpath.h mansearch.h
1.372 kristaps 243:
1.396 kristaps 244: MANPAGE_OBJS = manpage.o mansearch.o manpath.o
1.399 ! kristaps 245: $(MANPAGE_OBJS): config.h manpath.h mansearch.h
1.381 kristaps 246:
1.369 kristaps 247: DEMANDOC_OBJS = demandoc.o
1.396 kristaps 248: $(DEMANDOC_OBJS): config.h
1.369 kristaps 249:
1.396 kristaps 250: INDEX_MANS = demandoc.1.html \
1.369 kristaps 251: demandoc.1.xhtml \
252: demandoc.1.ps \
253: demandoc.1.pdf \
254: demandoc.1.txt \
255: mandoc.1.html \
1.319 kristaps 256: mandoc.1.xhtml \
257: mandoc.1.ps \
258: mandoc.1.pdf \
259: mandoc.1.txt \
260: mandoc.3.html \
261: mandoc.3.xhtml \
262: mandoc.3.ps \
263: mandoc.3.pdf \
264: mandoc.3.txt \
265: eqn.7.html \
266: eqn.7.xhtml \
267: eqn.7.ps \
268: eqn.7.pdf \
269: eqn.7.txt \
270: man.7.html \
271: man.7.xhtml \
272: man.7.ps \
273: man.7.pdf \
274: man.7.txt \
275: mandoc_char.7.html \
276: mandoc_char.7.xhtml \
277: mandoc_char.7.ps \
278: mandoc_char.7.pdf \
279: mandoc_char.7.txt \
280: mdoc.7.html \
281: mdoc.7.xhtml \
282: mdoc.7.ps \
283: mdoc.7.pdf \
284: mdoc.7.txt \
1.344 kristaps 285: preconv.1.html \
286: preconv.1.xhtml \
287: preconv.1.ps \
288: preconv.1.pdf \
289: preconv.1.txt \
1.319 kristaps 290: roff.7.html \
291: roff.7.xhtml \
292: roff.7.ps \
293: roff.7.pdf \
294: roff.7.txt \
295: tbl.7.html \
296: tbl.7.xhtml \
297: tbl.7.ps \
298: tbl.7.pdf \
1.356 schwarze 299: tbl.7.txt \
300: mandocdb.8.html \
301: mandocdb.8.xhtml \
302: mandocdb.8.ps \
303: mandocdb.8.pdf \
304: mandocdb.8.txt
1.319 kristaps 305:
306: $(INDEX_MANS): mandoc
307:
308: INDEX_OBJS = $(INDEX_MANS) \
309: man.h.html \
310: mandoc.h.html \
311: mdoc.h.html \
312: mdocml.tar.gz \
313: mdocml.md5
1.132 kristaps 314:
1.319 kristaps 315: www: index.html
1.42 kristaps 316:
1.1 kristaps 317: clean:
1.319 kristaps 318: rm -f libmandoc.a $(LIBMANDOC_OBJS)
1.396 kristaps 319: rm -f apropos $(APROPOS_OBJS)
1.355 kristaps 320: rm -f mandocdb $(MANDOCDB_OBJS)
1.343 kristaps 321: rm -f preconv $(PRECONV_OBJS)
1.396 kristaps 322: rm -f manpage $(MANPAGE_OBJS)
1.369 kristaps 323: rm -f demandoc $(DEMANDOC_OBJS)
1.319 kristaps 324: rm -f mandoc $(MANDOC_OBJS)
1.396 kristaps 325: rm -f config.h config.log $(COMPAT_OBJS)
326: rm -f mdocml.tar.gz
1.319 kristaps 327: rm -f index.html $(INDEX_OBJS)
1.396 kristaps 328: rm -rf *.dSYM
1.290 kristaps 329:
1.319 kristaps 330: install: all
1.270 joerg 331: mkdir -p $(DESTDIR)$(BINDIR)
332: mkdir -p $(DESTDIR)$(EXAMPLEDIR)
1.332 kristaps 333: mkdir -p $(DESTDIR)$(LIBDIR)
1.334 kristaps 334: mkdir -p $(DESTDIR)$(INCLUDEDIR)
1.270 joerg 335: mkdir -p $(DESTDIR)$(MANDIR)/man1
1.319 kristaps 336: mkdir -p $(DESTDIR)$(MANDIR)/man3
1.270 joerg 337: mkdir -p $(DESTDIR)$(MANDIR)/man7
1.369 kristaps 338: $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR)
1.324 kristaps 339: $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
1.352 kristaps 340: $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR)
1.369 kristaps 341: $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
1.319 kristaps 342: $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3
1.311 kristaps 343: $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
1.270 joerg 344: $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
1.387 kristaps 345:
346: installcgi: all
347: mkdir -p $(DESTDIR)$(CGIBINDIR)
348: mkdir -p $(DESTDIR)$(HTDOCDIR)
1.396 kristaps 349: #$(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR)
1.387 kristaps 350: $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css
1.391 kristaps 351: $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR)
1.60 kristaps 352:
1.319 kristaps 353: installwww: www
354: mkdir -p $(PREFIX)/snapshots
1.363 kristaps 355: mkdir -p $(PREFIX)/binaries
1.320 kristaps 356: $(INSTALL_DATA) index.html external.png index.css $(PREFIX)
357: $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX)
1.319 kristaps 358: $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX)
359: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots
360: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots
361: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz
362: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5
363:
1.362 kristaps 364: libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
365: $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
1.319 kristaps 366:
367: mandoc: $(MANDOC_OBJS) libmandoc.a
1.368 kristaps 368: $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a
1.325 kristaps 369:
1.355 kristaps 370: mandocdb: $(MANDOCDB_OBJS) libmandoc.a
1.368 kristaps 371: $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB)
1.326 kristaps 372:
1.343 kristaps 373: preconv: $(PRECONV_OBJS)
1.368 kristaps 374: $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS)
1.343 kristaps 375:
1.396 kristaps 376: manpage: $(MANPAGE_OBJS) libmandoc.a
377: $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB)
1.383 kristaps 378:
1.372 kristaps 379: apropos: $(APROPOS_OBJS) libmandoc.a
1.373 kristaps 380: $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB)
1.372 kristaps 381:
1.369 kristaps 382: demandoc: $(DEMANDOC_OBJS) libmandoc.a
383: $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a
384:
1.319 kristaps 385: mdocml.md5: mdocml.tar.gz
386: md5 mdocml.tar.gz >$@
387:
388: mdocml.tar.gz: $(SRCS)
389: mkdir -p .dist/mdocml-$(VERSION)/
1.353 kristaps 390: $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION)
1.319 kristaps 391: ( cd .dist/ && tar zcf ../$@ ./ )
1.60 kristaps 392: rm -rf .dist/
1.362 kristaps 393:
1.319 kristaps 394: index.html: $(INDEX_OBJS)
1.148 kristaps 395:
1.319 kristaps 396: config.h: config.h.pre config.h.post
397: rm -f config.log
398: ( cat config.h.pre; \
399: echo; \
1.397 kristaps 400: if $(CC) $(CFLAGS) -Werror -o test-ohash test-ohash.c >> config.log 2>&1; then \
401: echo '#define HAVE_OHASH'; \
402: rm test-ohash; \
403: fi; \
1.390 kristaps 404: if $(CC) $(CFLAGS) -Werror -o test-fgetln test-fgetln.c >> config.log 2>&1; then \
405: echo '#define HAVE_FGETLN'; \
406: rm test-fgetln; \
407: fi; \
1.362 kristaps 408: if $(CC) $(CFLAGS) -Werror -o test-strptime test-strptime.c >> config.log 2>&1; then \
409: echo '#define HAVE_STRPTIME'; \
410: rm test-strptime; \
411: fi; \
412: if $(CC) $(CFLAGS) -Werror -o test-getsubopt test-getsubopt.c >> config.log 2>&1; then \
413: echo '#define HAVE_GETSUBOPT'; \
414: rm test-getsubopt; \
415: fi; \
1.319 kristaps 416: if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \
417: echo '#define HAVE_STRLCAT'; \
418: rm test-strlcat; \
1.347 kristaps 419: fi; \
420: if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \
421: echo '#define HAVE_MMAP'; \
422: rm test-mmap; \
1.319 kristaps 423: fi; \
424: if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \
425: echo '#define HAVE_STRLCPY'; \
426: rm test-strlcpy; \
427: fi; \
428: echo; \
429: cat config.h.post \
430: ) > $@
1.60 kristaps 431:
1.319 kristaps 432: .h.h.html:
433: highlight -I $< >$@
1.168 kristaps 434:
1.356 schwarze 435: .1.1.txt .3.3.txt .7.7.txt .8.8.txt:
1.319 kristaps 436: ./mandoc -Tascii -Wall,stop $< | col -b >$@
1.168 kristaps 437:
1.356 schwarze 438: .1.1.html .3.3.html .7.7.html .8.8.html:
1.319 kristaps 439: ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@
1.277 kristaps 440:
1.356 schwarze 441: .1.1.ps .3.3.ps .7.7.ps .8.8.ps:
1.319 kristaps 442: ./mandoc -Tps -Wall,stop $< >$@
1.297 kristaps 443:
1.356 schwarze 444: .1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml:
1.319 kristaps 445: ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@
1.290 kristaps 446:
1.356 schwarze 447: .1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf:
1.319 kristaps 448: ./mandoc -Tpdf -Wall,stop $< >$@
1.212 kristaps 449:
1.319 kristaps 450: .sgml.html:
451: validate --warn $<
452: sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@
CVSweb