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