Annotation of mandoc/Makefile, Revision 1.358
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.319 kristaps 12: # CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
1.259 kristaps 13:
1.354 kristaps 14: VERSION = 1.11.4
15: VDATE = 12 July 2011
1.341 kristaps 16: # IFF your system supports multi-byte functions (setlocale(), wcwidth(),
17: # putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a
18: # UCS-4 value) should you define USE_WCHAR. If you define it and your
19: # system DOESN'T support this, -Tlocale will produce garbage.
20: # If you don't define it, -Tlocale is a synonym for -Tacsii.
1.339 kristaps 21: CFLAGS += -g -DUSE_WCHAR -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\""
1.319 kristaps 22: CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
23: PREFIX = /usr/local
24: BINDIR = $(PREFIX)/bin
1.321 kristaps 25: INCLUDEDIR = $(PREFIX)/include/mandoc
26: LIBDIR = $(PREFIX)/lib/mandoc
1.319 kristaps 27: MANDIR = $(PREFIX)/man
28: EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
29: INSTALL = install
30: INSTALL_PROGRAM = $(INSTALL) -m 0755
31: INSTALL_DATA = $(INSTALL) -m 0444
32: INSTALL_LIB = $(INSTALL) -m 0644
1.353 kristaps 33: INSTALL_SOURCE = $(INSTALL) -m 0644
1.319 kristaps 34: INSTALL_MAN = $(INSTALL_DATA)
35:
1.358 ! kristaps 36: # Linux needs -ldb to compile mandocdb.
! 37: #DBLIB = -ldb
! 38:
1.345 kristaps 39: all: mandoc preconv
1.319 kristaps 40:
41: SRCS = Makefile \
42: arch.c \
43: arch.in \
44: att.c \
45: att.in \
46: chars.c \
47: chars.in \
48: compat.c \
49: config.h.post \
50: config.h.pre \
51: eqn.7 \
52: eqn.c \
53: example.style.css \
54: external.png \
55: html.c \
56: html.h \
57: index.css \
58: index.sgml \
59: lib.c \
60: lib.in \
61: libman.h \
62: libmandoc.h \
63: libmdoc.h \
64: libroff.h \
65: main.c \
66: main.h \
1.331 kristaps 67: man.h \
1.319 kristaps 68: man.7 \
69: man.c \
70: man_hash.c \
71: man_html.c \
72: man_macro.c \
73: man_term.c \
74: man_validate.c \
75: mandoc.1 \
76: mandoc.3 \
77: mandoc.c \
78: mandoc.h \
1.356 schwarze 79: mandocdb.8 \
1.355 kristaps 80: mandocdb.c \
1.319 kristaps 81: mandoc_char.7 \
1.331 kristaps 82: mdoc.h \
1.319 kristaps 83: mdoc.7 \
84: mdoc.c \
85: mdoc_argv.c \
86: mdoc_hash.c \
87: mdoc_html.c \
88: mdoc_macro.c \
89: mdoc_term.c \
90: mdoc_validate.c \
91: msec.c \
92: msec.in \
93: out.c \
94: out.h \
1.344 kristaps 95: preconv.1 \
96: preconv.c \
1.342 kristaps 97: predefs.in \
1.319 kristaps 98: read.c \
99: roff.7 \
100: roff.c \
101: st.c \
102: st.in \
103: style.css \
104: tbl.7 \
105: tbl.c \
106: tbl_data.c \
107: tbl_html.c \
108: tbl_layout.c \
109: tbl_opts.c \
110: tbl_term.c \
111: term.c \
112: term.h \
113: term_ascii.c \
114: term_ps.c \
1.347 kristaps 115: test-mmap.c \
1.319 kristaps 116: test-strlcat.c \
117: test-strlcpy.c \
118: tree.c \
119: vol.c \
120: vol.in
121:
122: LIBMAN_OBJS = man.o \
123: man_hash.o \
124: man_macro.o \
125: man_validate.o
1.325 kristaps 126: LIBMAN_LNS = man.ln \
127: man_hash.ln \
128: man_macro.ln \
129: man_validate.ln
130:
1.319 kristaps 131: LIBMDOC_OBJS = arch.o \
132: att.o \
133: lib.o \
134: mdoc.o \
135: mdoc_argv.o \
136: mdoc_hash.o \
137: mdoc_macro.o \
138: mdoc_validate.o \
139: msec.o \
140: st.o \
141: vol.o
1.325 kristaps 142: LIBMDOC_LNS = arch.ln \
143: att.ln \
144: lib.ln \
145: mdoc.ln \
146: mdoc_argv.ln \
147: mdoc_hash.ln \
148: mdoc_macro.ln \
149: mdoc_validate.ln \
150: msec.ln \
151: st.ln \
152: vol.ln
153:
1.319 kristaps 154: LIBROFF_OBJS = eqn.o \
155: roff.o \
156: tbl.o \
157: tbl_data.o \
158: tbl_layout.o \
159: tbl_opts.o
1.325 kristaps 160: LIBROFF_LNS = eqn.ln \
161: roff.ln \
162: tbl.ln \
163: tbl_data.ln \
164: tbl_layout.ln \
165: tbl_opts.ln
166:
1.319 kristaps 167: LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
168: $(LIBMDOC_OBJS) \
169: $(LIBROFF_OBJS) \
1.333 kristaps 170: chars.o \
1.319 kristaps 171: mandoc.o \
172: read.o
1.325 kristaps 173: LIBMANDOC_LNS = $(LIBMAN_LNS) \
174: $(LIBMDOC_LNS) \
175: $(LIBROFF_LNS) \
1.333 kristaps 176: chars.ln \
1.325 kristaps 177: mandoc.ln \
178: read.ln
179:
180: arch.o arch.ln: arch.in
181: att.o att.ln: att.in
1.333 kristaps 182: chars.o chars.ln: chars.in
1.325 kristaps 183: lib.o lib.ln: lib.in
184: msec.o msec.ln: msec.in
1.342 kristaps 185: roff.o roff.ln: predefs.in
1.325 kristaps 186: st.o st.ln: st.in
187: vol.o vol.ln: vol.in
188:
189: $(LIBMAN_OBJS) $(LIBMAN_LNS): libman.h
190: $(LIBMDOC_OBJS) $(LIBMDOC_LNS): libmdoc.h
191: $(LIBROFF_OBJS) $(LIBROFF_LNS): libroff.h
192: $(LIBMANDOC_OBJS) $(LIBMANDOC_LNS): mandoc.h mdoc.h man.h libmandoc.h config.h
1.319 kristaps 193:
194: MANDOC_HTML_OBJS = html.o \
195: man_html.o \
196: mdoc_html.o \
197: tbl_html.o
1.325 kristaps 198: MANDOC_HTML_LNS = html.ln \
199: man_html.ln \
200: mdoc_html.ln \
201: tbl_html.ln
202:
1.319 kristaps 203: MANDOC_TERM_OBJS = man_term.o \
204: mdoc_term.o \
205: term.o \
206: term_ascii.o \
207: term_ps.o \
208: tbl_term.o
1.325 kristaps 209: MANDOC_TERM_LNS = man_term.ln \
210: mdoc_term.ln \
211: term.ln \
212: term_ascii.ln \
213: term_ps.ln \
214: tbl_term.ln
215:
1.319 kristaps 216: MANDOC_OBJS = $(MANDOC_HTML_OBJS) \
217: $(MANDOC_TERM_OBJS) \
218: main.o \
219: out.o \
220: tree.o
1.325 kristaps 221: MANDOC_LNS = $(MANDOC_HTML_LNS) \
222: $(MANDOC_TERM_LNS) \
223: main.ln \
224: out.ln \
225: tree.ln
226:
227: $(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h
228: $(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h
229: $(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h
1.319 kristaps 230:
1.325 kristaps 231: compat.o compat.ln: config.h
1.319 kristaps 232:
1.355 kristaps 233: MANDOCDB_OBJS = mandocdb.o
234: MANDOCDB_LNS = mandocdb.ln
1.326 kristaps 235:
1.355 kristaps 236: $(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandoc.h mdoc.h man.h config.h
1.326 kristaps 237:
1.343 kristaps 238: PRECONV_OBJS = preconv.o
239: PRECONV_LNS = preconv.ln
240:
241: $(PRECONV_OBJS) $(PRECONV_LNS): config.h
242:
1.356 schwarze 243: INDEX_MANS = mandoc.1.html \
1.319 kristaps 244: mandoc.1.xhtml \
245: mandoc.1.ps \
246: mandoc.1.pdf \
247: mandoc.1.txt \
248: mandoc.3.html \
249: mandoc.3.xhtml \
250: mandoc.3.ps \
251: mandoc.3.pdf \
252: mandoc.3.txt \
253: eqn.7.html \
254: eqn.7.xhtml \
255: eqn.7.ps \
256: eqn.7.pdf \
257: eqn.7.txt \
258: man.7.html \
259: man.7.xhtml \
260: man.7.ps \
261: man.7.pdf \
262: man.7.txt \
263: mandoc_char.7.html \
264: mandoc_char.7.xhtml \
265: mandoc_char.7.ps \
266: mandoc_char.7.pdf \
267: mandoc_char.7.txt \
268: mdoc.7.html \
269: mdoc.7.xhtml \
270: mdoc.7.ps \
271: mdoc.7.pdf \
272: mdoc.7.txt \
1.344 kristaps 273: preconv.1.html \
274: preconv.1.xhtml \
275: preconv.1.ps \
276: preconv.1.pdf \
277: preconv.1.txt \
1.319 kristaps 278: roff.7.html \
279: roff.7.xhtml \
280: roff.7.ps \
281: roff.7.pdf \
282: roff.7.txt \
283: tbl.7.html \
284: tbl.7.xhtml \
285: tbl.7.ps \
286: tbl.7.pdf \
1.356 schwarze 287: tbl.7.txt \
288: mandocdb.8.html \
289: mandocdb.8.xhtml \
290: mandocdb.8.ps \
291: mandocdb.8.pdf \
292: mandocdb.8.txt
1.319 kristaps 293:
294: $(INDEX_MANS): mandoc
295:
296: INDEX_OBJS = $(INDEX_MANS) \
297: man.h.html \
298: mandoc.h.html \
299: mdoc.h.html \
300: mdocml.tar.gz \
301: mdocml.md5
1.132 kristaps 302:
1.319 kristaps 303: www: index.html
1.42 kristaps 304:
1.348 kristaps 305: lint: llib-llibmandoc.ln llib-lmandoc.ln llib-lpreconv.ln
1.325 kristaps 306:
1.1 kristaps 307: clean:
1.319 kristaps 308: rm -f libmandoc.a $(LIBMANDOC_OBJS)
1.325 kristaps 309: rm -f llib-llibmandoc.ln $(LIBMANDOC_LNS)
1.355 kristaps 310: rm -f mandocdb $(MANDOCDB_OBJS)
311: rm -f llib-lmandocdb.ln $(MANDOCDB_LNS)
1.343 kristaps 312: rm -f preconv $(PRECONV_OBJS)
313: rm -f llib-lpreconv.ln $(PRECONV_LNS)
1.319 kristaps 314: rm -f mandoc $(MANDOC_OBJS)
1.325 kristaps 315: rm -f llib-lmandoc.ln $(MANDOC_LNS)
316: rm -f config.h config.log compat.o compat.ln
1.319 kristaps 317: rm -f mdocml.tar.gz
318: rm -f index.html $(INDEX_OBJS)
1.290 kristaps 319:
1.319 kristaps 320: install: all
1.270 joerg 321: mkdir -p $(DESTDIR)$(BINDIR)
322: mkdir -p $(DESTDIR)$(EXAMPLEDIR)
1.332 kristaps 323: mkdir -p $(DESTDIR)$(LIBDIR)
1.334 kristaps 324: mkdir -p $(DESTDIR)$(INCLUDEDIR)
1.270 joerg 325: mkdir -p $(DESTDIR)$(MANDIR)/man1
1.319 kristaps 326: mkdir -p $(DESTDIR)$(MANDIR)/man3
1.270 joerg 327: mkdir -p $(DESTDIR)$(MANDIR)/man7
1.356 schwarze 328: mkdir -p $(DESTDIR)$(MANDIR)/man8
1.346 kristaps 329: $(INSTALL_PROGRAM) mandoc preconv $(DESTDIR)$(BINDIR)
1.324 kristaps 330: $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
1.352 kristaps 331: $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR)
1.346 kristaps 332: $(INSTALL_MAN) mandoc.1 preconv.1 $(DESTDIR)$(MANDIR)/man1
1.319 kristaps 333: $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3
1.311 kristaps 334: $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
1.270 joerg 335: $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
1.60 kristaps 336:
1.319 kristaps 337: installwww: www
338: mkdir -p $(PREFIX)/snapshots
1.320 kristaps 339: $(INSTALL_DATA) index.html external.png index.css $(PREFIX)
340: $(INSTALL_DATA) $(INDEX_MANS) style.css $(PREFIX)
1.319 kristaps 341: $(INSTALL_DATA) mandoc.h.html man.h.html mdoc.h.html $(PREFIX)
342: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots
343: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots
344: $(INSTALL_DATA) mdocml.tar.gz $(PREFIX)/snapshots/mdocml-$(VERSION).tar.gz
345: $(INSTALL_DATA) mdocml.md5 $(PREFIX)/snapshots/mdocml-$(VERSION).md5
346:
347: libmandoc.a: compat.o $(LIBMANDOC_OBJS)
348: $(AR) rs $@ compat.o $(LIBMANDOC_OBJS)
349:
1.325 kristaps 350: llib-llibmandoc.ln: compat.ln $(LIBMANDOC_LNS)
351: $(LINT) $(LINTFLAGS) -Clibmandoc compat.ln $(LIBMANDOC_LNS)
352:
1.319 kristaps 353: mandoc: $(MANDOC_OBJS) libmandoc.a
354: $(CC) -o $@ $(MANDOC_OBJS) libmandoc.a
1.325 kristaps 355:
1.343 kristaps 356: llib-lmandoc.ln: $(MANDOC_LNS)
357: $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS)
358:
1.355 kristaps 359: mandocdb: $(MANDOCDB_OBJS) libmandoc.a
1.358 ! kristaps 360: $(CC) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB)
1.326 kristaps 361:
1.355 kristaps 362: llib-lmandocdb.ln: $(MANDOCDB_LNS)
363: $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS)
1.343 kristaps 364:
365: preconv: $(PRECONV_OBJS)
366: $(CC) -o $@ $(PRECONV_OBJS)
367:
368: llib-lpreconv.ln: $(PRECONV_LNS)
369: $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS)
1.319 kristaps 370:
371: mdocml.md5: mdocml.tar.gz
372: md5 mdocml.tar.gz >$@
373:
374: mdocml.tar.gz: $(SRCS)
375: mkdir -p .dist/mdocml-$(VERSION)/
1.353 kristaps 376: $(INSTALL_SOURCE) $(SRCS) .dist/mdocml-$(VERSION)
1.319 kristaps 377: ( cd .dist/ && tar zcf ../$@ ./ )
1.60 kristaps 378: rm -rf .dist/
379:
1.319 kristaps 380: index.html: $(INDEX_OBJS)
1.148 kristaps 381:
1.319 kristaps 382: config.h: config.h.pre config.h.post
383: rm -f config.log
384: ( cat config.h.pre; \
385: echo; \
386: if $(CC) $(CFLAGS) -Werror -o test-strlcat test-strlcat.c >> config.log 2>&1; then \
387: echo '#define HAVE_STRLCAT'; \
388: rm test-strlcat; \
1.347 kristaps 389: fi; \
390: if $(CC) $(CFLAGS) -Werror -o test-mmap test-mmap.c >> config.log 2>&1; then \
391: echo '#define HAVE_MMAP'; \
392: rm test-mmap; \
1.319 kristaps 393: fi; \
394: if $(CC) $(CFLAGS) -Werror -o test-strlcpy test-strlcpy.c >> config.log 2>&1; then \
395: echo '#define HAVE_STRLCPY'; \
396: rm test-strlcpy; \
397: fi; \
398: echo; \
399: cat config.h.post \
400: ) > $@
1.60 kristaps 401:
1.319 kristaps 402: .h.h.html:
403: highlight -I $< >$@
1.168 kristaps 404:
1.356 schwarze 405: .1.1.txt .3.3.txt .7.7.txt .8.8.txt:
1.319 kristaps 406: ./mandoc -Tascii -Wall,stop $< | col -b >$@
1.168 kristaps 407:
1.356 schwarze 408: .1.1.html .3.3.html .7.7.html .8.8.html:
1.319 kristaps 409: ./mandoc -Thtml -Wall,stop -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< >$@
1.277 kristaps 410:
1.356 schwarze 411: .1.1.ps .3.3.ps .7.7.ps .8.8.ps:
1.319 kristaps 412: ./mandoc -Tps -Wall,stop $< >$@
1.297 kristaps 413:
1.356 schwarze 414: .1.1.xhtml .3.3.xhtml .7.7.xhtml .8.8.xhtml:
1.319 kristaps 415: ./mandoc -Txhtml -Wall,stop -Ostyle=style.css,man=%N.%S.xhtml,includes=%I.html $< >$@
1.290 kristaps 416:
1.356 schwarze 417: .1.1.pdf .3.3.pdf .7.7.pdf .8.8.pdf:
1.319 kristaps 418: ./mandoc -Tpdf -Wall,stop $< >$@
1.212 kristaps 419:
1.319 kristaps 420: .sgml.html:
421: validate --warn $<
422: sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< >$@
CVSweb