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