Annotation of mandoc/Makefile, Revision 1.395.2.11
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 \
! 69: test-strptime.c
! 70:
1.319 kristaps 71: SRCS = Makefile \
1.395.2.5 schwarze 72: NEWS \
1.389 kristaps 73: TODO \
1.372 kristaps 74: apropos.1 \
75: apropos.c \
1.389 kristaps 76: apropos_db.c \
77: apropos_db.h \
1.319 kristaps 78: arch.c \
79: arch.in \
80: att.c \
81: att.in \
1.389 kristaps 82: catman.8 \
83: catman.c \
84: cgi.c \
1.319 kristaps 85: chars.c \
86: chars.in \
1.390 kristaps 87: compat_fgetln.c \
1.362 kristaps 88: compat_getsubopt.c \
1.395.2.10 schwarze 89: compat_strcasestr.c \
1.362 kristaps 90: compat_strlcat.c \
91: compat_strlcpy.c \
1.395.2.10 schwarze 92: compat_strsep.c \
1.319 kristaps 93: config.h.post \
94: config.h.pre \
1.389 kristaps 95: demandoc.1 \
1.369 kristaps 96: demandoc.c \
1.319 kristaps 97: eqn.7 \
98: eqn.c \
1.360 kristaps 99: eqn_html.c \
1.359 kristaps 100: eqn_term.c \
1.319 kristaps 101: example.style.css \
102: external.png \
1.395.2.3 schwarze 103: gmdiff \
1.319 kristaps 104: html.c \
105: html.h \
106: index.css \
107: index.sgml \
108: lib.c \
109: lib.in \
110: libman.h \
111: libmandoc.h \
112: libmdoc.h \
113: libroff.h \
114: main.c \
115: main.h \
116: man.7 \
117: man.c \
1.382 kristaps 118: man.cgi.7 \
1.391 kristaps 119: man-cgi.css \
1.389 kristaps 120: man.h \
1.319 kristaps 121: man_hash.c \
122: man_html.c \
123: man_macro.c \
124: man_term.c \
125: man_validate.c \
126: mandoc.1 \
127: mandoc.3 \
128: mandoc.c \
129: mandoc.h \
1.389 kristaps 130: mandoc_char.7 \
1.356 schwarze 131: mandocdb.8 \
1.355 kristaps 132: mandocdb.c \
1.378 schwarze 133: mandocdb.h \
1.380 kristaps 134: manpath.c \
135: manpath.h \
1.319 kristaps 136: mdoc.7 \
137: mdoc.c \
1.389 kristaps 138: mdoc.h \
1.319 kristaps 139: mdoc_argv.c \
140: mdoc_hash.c \
141: mdoc_html.c \
142: mdoc_macro.c \
1.371 schwarze 143: mdoc_man.c \
1.319 kristaps 144: mdoc_term.c \
145: mdoc_validate.c \
146: msec.c \
147: msec.in \
148: out.c \
149: out.h \
1.344 kristaps 150: preconv.1 \
151: preconv.c \
1.342 kristaps 152: predefs.in \
1.319 kristaps 153: read.c \
154: roff.7 \
155: roff.c \
156: st.c \
157: st.in \
158: style.css \
1.395.2.3 schwarze 159: tbl.3 \
1.319 kristaps 160: tbl.7 \
161: tbl.c \
162: tbl_data.c \
163: tbl_html.c \
164: tbl_layout.c \
165: tbl_opts.c \
166: tbl_term.c \
167: term.c \
168: term.h \
169: term_ascii.c \
170: term_ps.c \
171: tree.c \
172: vol.c \
1.389 kristaps 173: vol.in \
1.395.2.11! schwarze 174: whatis.1 \
! 175: $(TESTSRCS)
1.319 kristaps 176:
177: LIBMAN_OBJS = man.o \
178: man_hash.o \
179: man_macro.o \
180: man_validate.o
1.325 kristaps 181:
1.319 kristaps 182: LIBMDOC_OBJS = arch.o \
183: att.o \
184: lib.o \
185: mdoc.o \
186: mdoc_argv.o \
187: mdoc_hash.o \
188: mdoc_macro.o \
189: mdoc_validate.o \
190: st.o \
191: vol.o
1.325 kristaps 192:
1.319 kristaps 193: LIBROFF_OBJS = eqn.o \
194: roff.o \
195: tbl.o \
196: tbl_data.o \
197: tbl_layout.o \
198: tbl_opts.o
1.325 kristaps 199:
1.319 kristaps 200: LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
201: $(LIBMDOC_OBJS) \
202: $(LIBROFF_OBJS) \
1.333 kristaps 203: chars.o \
1.319 kristaps 204: mandoc.o \
1.385 schwarze 205: msec.o \
1.319 kristaps 206: read.o
1.325 kristaps 207:
1.390 kristaps 208: COMPAT_OBJS = compat_fgetln.o \
209: compat_getsubopt.o \
1.395.2.10 schwarze 210: compat_strcasestr.o \
1.362 kristaps 211: compat_strlcat.o \
1.395.2.10 schwarze 212: compat_strlcpy.o \
213: compat_strsep.o
1.319 kristaps 214:
1.395.2.1 schwarze 215: arch.o: arch.in
216: att.o: att.in
217: chars.o: chars.in
218: lib.o: lib.in
219: msec.o: msec.in
220: roff.o: predefs.in
221: st.o: st.in
222: vol.o: vol.in
223:
224: $(LIBMAN_OBJS): libman.h
225: $(LIBMDOC_OBJS): libmdoc.h
226: $(LIBROFF_OBJS): libroff.h
227: $(LIBMANDOC_OBJS): mandoc.h mdoc.h man.h libmandoc.h config.h
228: $(COMPAT_OBJS): config.h
1.362 kristaps 229:
1.360 kristaps 230: MANDOC_HTML_OBJS = eqn_html.o \
231: html.o \
1.319 kristaps 232: man_html.o \
233: mdoc_html.o \
234: tbl_html.o
1.395.2.1 schwarze 235: $(MANDOC_HTML_OBJS): html.h
1.325 kristaps 236:
1.371 schwarze 237: MANDOC_MAN_OBJS = mdoc_man.o
238:
1.359 kristaps 239: MANDOC_TERM_OBJS = eqn_term.o \
240: man_term.o \
1.319 kristaps 241: mdoc_term.o \
242: term.o \
243: term_ascii.o \
244: term_ps.o \
245: tbl_term.o
1.395.2.1 schwarze 246: $(MANDOC_TERM_OBJS): term.h
1.325 kristaps 247:
1.319 kristaps 248: MANDOC_OBJS = $(MANDOC_HTML_OBJS) \
1.371 schwarze 249: $(MANDOC_MAN_OBJS) \
1.319 kristaps 250: $(MANDOC_TERM_OBJS) \
251: main.o \
252: out.o \
253: tree.o
1.395.2.1 schwarze 254: $(MANDOC_OBJS): main.h mandoc.h mdoc.h man.h config.h out.h
1.319 kristaps 255:
1.380 kristaps 256: MANDOCDB_OBJS = mandocdb.o manpath.o
1.395.2.1 schwarze 257: $(MANDOCDB_OBJS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h
1.326 kristaps 258:
1.343 kristaps 259: PRECONV_OBJS = preconv.o
1.395.2.1 schwarze 260: $(PRECONV_OBJS): config.h
1.343 kristaps 261:
1.380 kristaps 262: APROPOS_OBJS = apropos.o apropos_db.o manpath.o
1.395.2.1 schwarze 263: $(APROPOS_OBJS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h
1.376 kristaps 264:
1.383 kristaps 265: CGI_OBJS = $(MANDOC_HTML_OBJS) \
266: $(MANDOC_MAN_OBJS) \
267: $(MANDOC_TERM_OBJS) \
268: cgi.o \
269: apropos_db.o \
270: manpath.o \
271: out.o \
272: tree.o
1.395.2.1 schwarze 273: $(CGI_OBJS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h
1.381 kristaps 274:
1.383 kristaps 275: CATMAN_OBJS = catman.o manpath.o
1.395.2.1 schwarze 276: $(CATMAN_OBJS): config.h mandoc.h manpath.h mandocdb.h
1.381 kristaps 277:
1.369 kristaps 278: DEMANDOC_OBJS = demandoc.o
1.395.2.1 schwarze 279: $(DEMANDOC_OBJS): config.h
1.369 kristaps 280:
1.372 kristaps 281: INDEX_MANS = apropos.1.html \
1.390 kristaps 282: catman.8.html \
1.372 kristaps 283: demandoc.1.html \
1.369 kristaps 284: mandoc.1.html \
1.389 kristaps 285: whatis.1.html \
1.319 kristaps 286: mandoc.3.html \
1.395.2.3 schwarze 287: tbl.3.html \
1.319 kristaps 288: eqn.7.html \
289: man.7.html \
1.390 kristaps 290: man.cgi.7.html \
1.319 kristaps 291: mandoc_char.7.html \
292: mdoc.7.html \
1.344 kristaps 293: preconv.1.html \
1.319 kristaps 294: roff.7.html \
295: tbl.7.html \
1.395.2.2 schwarze 296: mandocdb.8.html
1.319 kristaps 297:
298: $(INDEX_MANS): mandoc
299:
300: INDEX_OBJS = $(INDEX_MANS) \
301: man.h.html \
302: mandoc.h.html \
303: mdoc.h.html \
304: mdocml.tar.gz \
305: mdocml.md5
1.132 kristaps 306:
1.319 kristaps 307: www: index.html
1.42 kristaps 308:
1.1 kristaps 309: clean:
1.319 kristaps 310: rm -f libmandoc.a $(LIBMANDOC_OBJS)
1.355 kristaps 311: rm -f mandocdb $(MANDOCDB_OBJS)
1.343 kristaps 312: rm -f preconv $(PRECONV_OBJS)
1.389 kristaps 313: rm -f apropos whatis $(APROPOS_OBJS)
1.376 kristaps 314: rm -f man.cgi $(CGI_OBJS)
1.383 kristaps 315: rm -f catman $(CATMAN_OBJS)
1.369 kristaps 316: rm -f demandoc $(DEMANDOC_OBJS)
1.319 kristaps 317: rm -f mandoc $(MANDOC_OBJS)
1.395.2.1 schwarze 318: rm -f config.h config.log $(COMPAT_OBJS)
319: rm -f mdocml.tar.gz
1.319 kristaps 320: rm -f index.html $(INDEX_OBJS)
1.395.2.1 schwarze 321: rm -rf *.dSYM
1.290 kristaps 322:
1.319 kristaps 323: install: all
1.270 joerg 324: mkdir -p $(DESTDIR)$(BINDIR)
325: mkdir -p $(DESTDIR)$(EXAMPLEDIR)
1.332 kristaps 326: mkdir -p $(DESTDIR)$(LIBDIR)
1.334 kristaps 327: mkdir -p $(DESTDIR)$(INCLUDEDIR)
1.270 joerg 328: mkdir -p $(DESTDIR)$(MANDIR)/man1
1.319 kristaps 329: mkdir -p $(DESTDIR)$(MANDIR)/man3
1.270 joerg 330: mkdir -p $(DESTDIR)$(MANDIR)/man7
1.369 kristaps 331: $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR)
1.324 kristaps 332: $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
1.352 kristaps 333: $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR)
1.369 kristaps 334: $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
1.395.2.3 schwarze 335: $(INSTALL_MAN) mandoc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3
1.311 kristaps 336: $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
1.270 joerg 337: $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
1.387 kristaps 338:
339: installcgi: all
340: mkdir -p $(DESTDIR)$(CGIBINDIR)
341: mkdir -p $(DESTDIR)$(HTDOCDIR)
342: $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR)
343: $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css
1.391 kristaps 344: $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR)
1.60 kristaps 345:
1.319 kristaps 346: installwww: www
347: mkdir -p $(PREFIX)/snapshots
1.363 kristaps 348: mkdir -p $(PREFIX)/binaries
1.320 kristaps 349: $(INSTALL_DATA) index.html external.png index.css $(PREFIX)
350: $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX)
1.319 kristaps 351: $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX)
352: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots
353: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots
354: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz
355: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5
356:
1.362 kristaps 357: libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
358: $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
1.319 kristaps 359:
360: mandoc: $(MANDOC_OBJS) libmandoc.a
1.368 kristaps 361: $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a
1.325 kristaps 362:
1.355 kristaps 363: mandocdb: $(MANDOCDB_OBJS) libmandoc.a
1.368 kristaps 364: $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB)
1.326 kristaps 365:
1.343 kristaps 366: preconv: $(PRECONV_OBJS)
1.368 kristaps 367: $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS)
1.343 kristaps 368:
1.383 kristaps 369: whatis: apropos
370: cp -f apropos whatis
371:
1.372 kristaps 372: apropos: $(APROPOS_OBJS) libmandoc.a
1.373 kristaps 373: $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB)
1.372 kristaps 374:
1.383 kristaps 375: catman: $(CATMAN_OBJS) libmandoc.a
376: $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB)
1.381 kristaps 377:
1.376 kristaps 378: man.cgi: $(CGI_OBJS) libmandoc.a
1.383 kristaps 379: $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB)
1.376 kristaps 380:
1.369 kristaps 381: demandoc: $(DEMANDOC_OBJS) libmandoc.a
382: $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a
383:
1.319 kristaps 384: mdocml.md5: mdocml.tar.gz
385: md5 mdocml.tar.gz >$@
386:
387: mdocml.tar.gz: $(SRCS)
388: mkdir -p .dist/mdocml-$(VERSION)/
1.353 kristaps 389: $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION)
1.319 kristaps 390: ( cd .dist/ && tar zcf ../$@ ./ )
1.60 kristaps 391: rm -rf .dist/
1.362 kristaps 392:
1.319 kristaps 393: index.html: $(INDEX_OBJS)
1.148 kristaps 394:
1.395.2.11! schwarze 395: config.h: configure config.h.pre config.h.post $(TESTSRCS)
1.319 kristaps 396: rm -f config.log
1.395.2.11! schwarze 397: CC="$(CC)" CFLAGS="$(CFLAGS)" VERSION="$(VERSION)" ./configure
1.60 kristaps 398:
1.319 kristaps 399: .h.h.html:
400: highlight -I $< >$@
1.168 kristaps 401:
1.356 schwarze 402: .1.1.html .3.3.html .7.7.html .8.8.html:
1.319 kristaps 403: ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@
1.212 kristaps 404:
1.319 kristaps 405: .sgml.html:
406: validate --warn $<
407: sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@
CVSweb