Annotation of mandoc/Makefile, Revision 1.395.2.12
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.html .3.html .7.html .8.html
1.259 kristaps 5:
6: # Specify this if you want to hard-code the operating system to appear
7: # in the lower-left hand corner of -mdoc manuals.
1.375 kristaps 8: #
1.395.2.3 schwarze 9: # CFLAGS += -DOSNAME="\"OpenBSD 5.4\""
1.259 kristaps 10:
1.395.2.9 schwarze 11: VERSION = 1.12.3
12: VDATE = 31 December 2013
1.375 kristaps 13:
1.341 kristaps 14: # IFF your system supports multi-byte functions (setlocale(), wcwidth(),
15: # putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a
16: # UCS-4 value) should you define USE_WCHAR. If you define it and your
17: # system DOESN'T support this, -Tlocale will produce garbage.
18: # If you don't define it, -Tlocale is a synonym for -Tacsii.
1.375 kristaps 19: #
1.362 kristaps 20: CFLAGS += -DUSE_WCHAR
1.375 kristaps 21:
1.380 kristaps 22: # If your system has manpath(1), uncomment this. This is most any
23: # system that's not OpenBSD or NetBSD. If uncommented, apropos(1),
24: # mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH
25: # variable.
1.384 schwarze 26: #CFLAGS += -DUSE_MANPATH
1.383 kristaps 27:
1.395.2.4 schwarze 28: # If your system does not support static binaries, comment this,
29: # for example on Mac OS X.
1.386 kristaps 30: STATIC = -static
1.395.2.4 schwarze 31: # Linux requires -pthread to statically link with libdb.
32: #STATIC += -pthread
1.379 kristaps 33:
1.395.2.8 schwarze 34: CFLAGS += -g -DHAVE_CONFIG_H
1.319 kristaps 35: CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
36: PREFIX = /usr/local
1.387 kristaps 37: WWWPREFIX = /var/www
38: HTDOCDIR = $(WWWPREFIX)/htdocs
39: CGIBINDIR = $(WWWPREFIX)/cgi-bin
1.319 kristaps 40: BINDIR = $(PREFIX)/bin
1.321 kristaps 41: INCLUDEDIR = $(PREFIX)/include/mandoc
42: LIBDIR = $(PREFIX)/lib/mandoc
1.319 kristaps 43: MANDIR = $(PREFIX)/man
44: EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
45: INSTALL = install
46: INSTALL_PROGRAM = $(INSTALL) -m 0755
47: INSTALL_DATA = $(INSTALL) -m 0444
48: INSTALL_LIB = $(INSTALL) -m 0644
1.353 kristaps 49: INSTALL_SOURCE = $(INSTALL) -m 0644
1.319 kristaps 50: INSTALL_MAN = $(INSTALL_DATA)
51:
1.375 kristaps 52: # Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and
53: # apropos.
54: # However, if you don't have -ldb at all (or it's not native), then
55: # comment out apropos and mandocdb.
56: #
1.358 kristaps 57: #DBLIB = -ldb
1.383 kristaps 58: DBBIN = apropos mandocdb man.cgi catman whatis
59: DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln
1.358 kristaps 60:
1.375 kristaps 61: all: mandoc preconv demandoc $(DBBIN)
1.319 kristaps 62:
1.395.2.11 schwarze 63: TESTSRCS = test-betoh64.c \
64: test-fgetln.c \
65: test-getsubopt.c \
66: test-mmap.c \
67: test-strlcat.c \
68: test-strlcpy.c \
1.395.2.12! schwarze 69: test-strnlen.c \
1.395.2.11 schwarze 70: test-strptime.c
71:
1.319 kristaps 72: SRCS = Makefile \
1.395.2.5 schwarze 73: NEWS \
1.389 kristaps 74: TODO \
1.372 kristaps 75: apropos.1 \
76: apropos.c \
1.389 kristaps 77: apropos_db.c \
78: apropos_db.h \
1.319 kristaps 79: arch.c \
80: arch.in \
81: att.c \
82: att.in \
1.389 kristaps 83: catman.8 \
84: catman.c \
85: cgi.c \
1.319 kristaps 86: chars.c \
87: chars.in \
1.390 kristaps 88: compat_fgetln.c \
1.362 kristaps 89: compat_getsubopt.c \
1.395.2.10 schwarze 90: compat_strcasestr.c \
1.362 kristaps 91: compat_strlcat.c \
92: compat_strlcpy.c \
1.395.2.12! schwarze 93: compat_strnlen.c \
1.395.2.10 schwarze 94: compat_strsep.c \
1.319 kristaps 95: config.h.post \
96: config.h.pre \
1.389 kristaps 97: demandoc.1 \
1.369 kristaps 98: demandoc.c \
1.319 kristaps 99: eqn.7 \
100: eqn.c \
1.360 kristaps 101: eqn_html.c \
1.359 kristaps 102: eqn_term.c \
1.319 kristaps 103: example.style.css \
104: external.png \
1.395.2.3 schwarze 105: gmdiff \
1.319 kristaps 106: html.c \
107: html.h \
108: index.css \
109: index.sgml \
110: lib.c \
111: lib.in \
112: libman.h \
113: libmandoc.h \
114: libmdoc.h \
115: libroff.h \
116: main.c \
117: main.h \
118: man.7 \
119: man.c \
1.382 kristaps 120: man.cgi.7 \
1.391 kristaps 121: man-cgi.css \
1.389 kristaps 122: man.h \
1.319 kristaps 123: man_hash.c \
124: man_html.c \
125: man_macro.c \
126: man_term.c \
127: man_validate.c \
128: mandoc.1 \
129: mandoc.3 \
130: mandoc.c \
131: mandoc.h \
1.389 kristaps 132: mandoc_char.7 \
1.356 schwarze 133: mandocdb.8 \
1.355 kristaps 134: mandocdb.c \
1.378 schwarze 135: mandocdb.h \
1.380 kristaps 136: manpath.c \
137: manpath.h \
1.319 kristaps 138: mdoc.7 \
139: mdoc.c \
1.389 kristaps 140: mdoc.h \
1.319 kristaps 141: mdoc_argv.c \
142: mdoc_hash.c \
143: mdoc_html.c \
144: mdoc_macro.c \
1.371 schwarze 145: mdoc_man.c \
1.319 kristaps 146: mdoc_term.c \
147: mdoc_validate.c \
148: msec.c \
149: msec.in \
150: out.c \
151: out.h \
1.344 kristaps 152: preconv.1 \
153: preconv.c \
1.342 kristaps 154: predefs.in \
1.319 kristaps 155: read.c \
156: roff.7 \
157: roff.c \
158: st.c \
159: st.in \
160: style.css \
1.395.2.3 schwarze 161: tbl.3 \
1.319 kristaps 162: tbl.7 \
163: tbl.c \
164: tbl_data.c \
165: tbl_html.c \
166: tbl_layout.c \
167: tbl_opts.c \
168: tbl_term.c \
169: term.c \
170: term.h \
171: term_ascii.c \
172: term_ps.c \
173: tree.c \
174: vol.c \
1.389 kristaps 175: vol.in \
1.395.2.11 schwarze 176: whatis.1 \
177: $(TESTSRCS)
1.319 kristaps 178:
179: LIBMAN_OBJS = man.o \
180: man_hash.o \
181: man_macro.o \
182: man_validate.o
1.325 kristaps 183:
1.319 kristaps 184: LIBMDOC_OBJS = arch.o \
185: att.o \
186: lib.o \
187: mdoc.o \
188: mdoc_argv.o \
189: mdoc_hash.o \
190: mdoc_macro.o \
191: mdoc_validate.o \
192: st.o \
193: vol.o
1.325 kristaps 194:
1.319 kristaps 195: LIBROFF_OBJS = eqn.o \
196: roff.o \
197: tbl.o \
198: tbl_data.o \
199: tbl_layout.o \
200: tbl_opts.o
1.325 kristaps 201:
1.319 kristaps 202: LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
203: $(LIBMDOC_OBJS) \
204: $(LIBROFF_OBJS) \
1.333 kristaps 205: chars.o \
1.319 kristaps 206: mandoc.o \
1.385 schwarze 207: msec.o \
1.319 kristaps 208: read.o
1.325 kristaps 209:
1.390 kristaps 210: COMPAT_OBJS = compat_fgetln.o \
211: compat_getsubopt.o \
1.395.2.10 schwarze 212: compat_strcasestr.o \
1.362 kristaps 213: compat_strlcat.o \
1.395.2.10 schwarze 214: compat_strlcpy.o \
1.395.2.12! schwarze 215: compat_strnlen.o \
1.395.2.10 schwarze 216: compat_strsep.o
1.319 kristaps 217:
1.395.2.1 schwarze 218: arch.o: arch.in
219: att.o: att.in
220: chars.o: chars.in
221: lib.o: lib.in
222: msec.o: msec.in
223: roff.o: predefs.in
224: st.o: st.in
225: vol.o: vol.in
226:
227: $(LIBMAN_OBJS): libman.h
228: $(LIBMDOC_OBJS): libmdoc.h
229: $(LIBROFF_OBJS): libroff.h
230: $(LIBMANDOC_OBJS): mandoc.h mdoc.h man.h libmandoc.h config.h
231: $(COMPAT_OBJS): config.h
1.362 kristaps 232:
1.360 kristaps 233: MANDOC_HTML_OBJS = eqn_html.o \
234: html.o \
1.319 kristaps 235: man_html.o \
236: mdoc_html.o \
237: tbl_html.o
1.395.2.1 schwarze 238: $(MANDOC_HTML_OBJS): html.h
1.325 kristaps 239:
1.371 schwarze 240: MANDOC_MAN_OBJS = mdoc_man.o
241:
1.359 kristaps 242: MANDOC_TERM_OBJS = eqn_term.o \
243: man_term.o \
1.319 kristaps 244: mdoc_term.o \
245: term.o \
246: term_ascii.o \
247: term_ps.o \
248: tbl_term.o
1.395.2.1 schwarze 249: $(MANDOC_TERM_OBJS): term.h
1.325 kristaps 250:
1.319 kristaps 251: MANDOC_OBJS = $(MANDOC_HTML_OBJS) \
1.371 schwarze 252: $(MANDOC_MAN_OBJS) \
1.319 kristaps 253: $(MANDOC_TERM_OBJS) \
254: main.o \
255: out.o \
256: tree.o
1.395.2.1 schwarze 257: $(MANDOC_OBJS): main.h mandoc.h mdoc.h man.h config.h out.h
1.319 kristaps 258:
1.380 kristaps 259: MANDOCDB_OBJS = mandocdb.o manpath.o
1.395.2.1 schwarze 260: $(MANDOCDB_OBJS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h
1.326 kristaps 261:
1.343 kristaps 262: PRECONV_OBJS = preconv.o
1.395.2.1 schwarze 263: $(PRECONV_OBJS): config.h
1.343 kristaps 264:
1.380 kristaps 265: APROPOS_OBJS = apropos.o apropos_db.o manpath.o
1.395.2.1 schwarze 266: $(APROPOS_OBJS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h
1.376 kristaps 267:
1.383 kristaps 268: CGI_OBJS = $(MANDOC_HTML_OBJS) \
269: $(MANDOC_MAN_OBJS) \
270: $(MANDOC_TERM_OBJS) \
271: cgi.o \
272: apropos_db.o \
273: manpath.o \
274: out.o \
275: tree.o
1.395.2.1 schwarze 276: $(CGI_OBJS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h
1.381 kristaps 277:
1.383 kristaps 278: CATMAN_OBJS = catman.o manpath.o
1.395.2.1 schwarze 279: $(CATMAN_OBJS): config.h mandoc.h manpath.h mandocdb.h
1.381 kristaps 280:
1.369 kristaps 281: DEMANDOC_OBJS = demandoc.o
1.395.2.1 schwarze 282: $(DEMANDOC_OBJS): config.h
1.369 kristaps 283:
1.372 kristaps 284: INDEX_MANS = apropos.1.html \
1.390 kristaps 285: catman.8.html \
1.372 kristaps 286: demandoc.1.html \
1.369 kristaps 287: mandoc.1.html \
1.389 kristaps 288: whatis.1.html \
1.319 kristaps 289: mandoc.3.html \
1.395.2.3 schwarze 290: tbl.3.html \
1.319 kristaps 291: eqn.7.html \
292: man.7.html \
1.390 kristaps 293: man.cgi.7.html \
1.319 kristaps 294: mandoc_char.7.html \
295: mdoc.7.html \
1.344 kristaps 296: preconv.1.html \
1.319 kristaps 297: roff.7.html \
298: tbl.7.html \
1.395.2.2 schwarze 299: mandocdb.8.html
1.319 kristaps 300:
301: $(INDEX_MANS): mandoc
302:
303: INDEX_OBJS = $(INDEX_MANS) \
304: man.h.html \
305: mandoc.h.html \
306: mdoc.h.html \
307: mdocml.tar.gz \
308: mdocml.md5
1.132 kristaps 309:
1.319 kristaps 310: www: index.html
1.42 kristaps 311:
1.1 kristaps 312: clean:
1.319 kristaps 313: rm -f libmandoc.a $(LIBMANDOC_OBJS)
1.355 kristaps 314: rm -f mandocdb $(MANDOCDB_OBJS)
1.343 kristaps 315: rm -f preconv $(PRECONV_OBJS)
1.389 kristaps 316: rm -f apropos whatis $(APROPOS_OBJS)
1.376 kristaps 317: rm -f man.cgi $(CGI_OBJS)
1.383 kristaps 318: rm -f catman $(CATMAN_OBJS)
1.369 kristaps 319: rm -f demandoc $(DEMANDOC_OBJS)
1.319 kristaps 320: rm -f mandoc $(MANDOC_OBJS)
1.395.2.1 schwarze 321: rm -f config.h config.log $(COMPAT_OBJS)
322: rm -f mdocml.tar.gz
1.319 kristaps 323: rm -f index.html $(INDEX_OBJS)
1.395.2.1 schwarze 324: rm -rf *.dSYM
1.290 kristaps 325:
1.319 kristaps 326: install: all
1.270 joerg 327: mkdir -p $(DESTDIR)$(BINDIR)
328: mkdir -p $(DESTDIR)$(EXAMPLEDIR)
1.332 kristaps 329: mkdir -p $(DESTDIR)$(LIBDIR)
1.334 kristaps 330: mkdir -p $(DESTDIR)$(INCLUDEDIR)
1.270 joerg 331: mkdir -p $(DESTDIR)$(MANDIR)/man1
1.319 kristaps 332: mkdir -p $(DESTDIR)$(MANDIR)/man3
1.270 joerg 333: mkdir -p $(DESTDIR)$(MANDIR)/man7
1.369 kristaps 334: $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR)
1.324 kristaps 335: $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
1.352 kristaps 336: $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR)
1.369 kristaps 337: $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
1.395.2.3 schwarze 338: $(INSTALL_MAN) mandoc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3
1.311 kristaps 339: $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
1.270 joerg 340: $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
1.387 kristaps 341:
342: installcgi: all
343: mkdir -p $(DESTDIR)$(CGIBINDIR)
344: mkdir -p $(DESTDIR)$(HTDOCDIR)
345: $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR)
346: $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css
1.391 kristaps 347: $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR)
1.60 kristaps 348:
1.319 kristaps 349: installwww: www
350: mkdir -p $(PREFIX)/snapshots
1.363 kristaps 351: mkdir -p $(PREFIX)/binaries
1.320 kristaps 352: $(INSTALL_DATA) index.html external.png index.css $(PREFIX)
353: $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX)
1.319 kristaps 354: $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX)
355: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots
356: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots
357: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz
358: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5
359:
1.362 kristaps 360: libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
361: $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
1.319 kristaps 362:
363: mandoc: $(MANDOC_OBJS) libmandoc.a
1.368 kristaps 364: $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a
1.325 kristaps 365:
1.355 kristaps 366: mandocdb: $(MANDOCDB_OBJS) libmandoc.a
1.368 kristaps 367: $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB)
1.326 kristaps 368:
1.343 kristaps 369: preconv: $(PRECONV_OBJS)
1.368 kristaps 370: $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS)
1.343 kristaps 371:
1.383 kristaps 372: whatis: apropos
373: cp -f apropos whatis
374:
1.372 kristaps 375: apropos: $(APROPOS_OBJS) libmandoc.a
1.373 kristaps 376: $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB)
1.372 kristaps 377:
1.383 kristaps 378: catman: $(CATMAN_OBJS) libmandoc.a
379: $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB)
1.381 kristaps 380:
1.376 kristaps 381: man.cgi: $(CGI_OBJS) libmandoc.a
1.383 kristaps 382: $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB)
1.376 kristaps 383:
1.369 kristaps 384: demandoc: $(DEMANDOC_OBJS) libmandoc.a
385: $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a
386:
1.319 kristaps 387: mdocml.md5: mdocml.tar.gz
388: md5 mdocml.tar.gz >$@
389:
390: mdocml.tar.gz: $(SRCS)
391: mkdir -p .dist/mdocml-$(VERSION)/
1.353 kristaps 392: $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION)
1.319 kristaps 393: ( cd .dist/ && tar zcf ../$@ ./ )
1.60 kristaps 394: rm -rf .dist/
1.362 kristaps 395:
1.319 kristaps 396: index.html: $(INDEX_OBJS)
1.148 kristaps 397:
1.395.2.11 schwarze 398: config.h: configure config.h.pre config.h.post $(TESTSRCS)
1.319 kristaps 399: rm -f config.log
1.395.2.11 schwarze 400: CC="$(CC)" CFLAGS="$(CFLAGS)" VERSION="$(VERSION)" ./configure
1.60 kristaps 401:
1.319 kristaps 402: .h.h.html:
403: highlight -I $< >$@
1.168 kristaps 404:
1.356 schwarze 405: .1.1.html .3.3.html .7.7.html .8.8.html:
1.319 kristaps 406: ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@
1.212 kristaps 407:
1.319 kristaps 408: .sgml.html:
409: validate --warn $<
410: sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@
CVSweb