1 .SUFFIXES
: .html .xml .sgml
.1 .3 .7 .md5 .
tar.gz
2 .SUFFIXES
: .1.txt
.3.txt
.7.txt
3 .SUFFIXES
: .1.xhtml
.3.xhtml
.7.xhtml
4 .SUFFIXES
: .1.sgml
.3.sgml
.7.sgml
6 .SUFFIXES
: .1.ps
.3.ps
.7.ps
7 .SUFFIXES
: .1.pdf
.3.pdf
.7.pdf
10 BINDIR
= $(PREFIX
)/bin
11 INCLUDEDIR
= $(PREFIX
)/include
12 LIBDIR
= $(PREFIX
)/lib
13 MANDIR
= $(PREFIX
)/man
14 EXAMPLEDIR
= $(PREFIX
)/share
/examples
/mandoc
16 INSTALL_PROGRAM
= $(INSTALL
) -m
0755
17 INSTALL_DATA
= $(INSTALL
) -m
0444
18 INSTALL_LIB
= $(INSTALL
) -m
0644
19 INSTALL_MAN
= $(INSTALL_DATA
)
22 VDATE
= 07 January
2010
24 VFLAGS
= -DVERSION
="\"$(VERSION)\""
25 WFLAGS
= -W
-Wall
-Wstrict-prototypes
-Wno-unused-parameter
-Wwrite-strings
26 CFLAGS
+= -g
$(WFLAGS
) $(VFLAGS
) -DHAVE_CONFIG_H
28 # Specify this if you want to hard-code the operating system to appear
29 # in the lower-left hand corner of -mdoc manuals.
30 # CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
31 CFLAGS
+= -UOSNAME
-DOSNAME
="\"Minix\""
33 LINTFLAGS
+= $(VFLAGS
)
35 ROFFLNS
= roff.ln tbl.ln tbl_opts.ln tbl_layout.ln tbl_data.ln
37 ROFFSRCS
= roff.c tbl.c tbl_opts.c tbl_layout.c tbl_data.c
39 ROFFOBJS
= roff.o tbl.o tbl_opts.o tbl_layout.o tbl_data.o
47 MDOCLNS
= mdoc_macro.ln mdoc.ln mdoc_hash.ln mdoc_strings.ln \
48 mdoc_argv.ln mdoc_validate.ln \
49 lib.ln att.ln arch.ln vol.ln msec.ln st.ln
51 MDOCOBJS
= mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \
52 mdoc_argv.o mdoc_validate.o lib.o att.o \
53 arch.o vol.o msec.o st.o
55 MDOCSRCS
= mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \
56 mdoc_argv.c mdoc_validate.c lib.c att.c \
57 arch.c vol.c msec.c st.c
59 MANLNS
= man_macro.ln man.ln man_hash.ln man_validate.ln \
62 MANOBJS
= man_macro.o man.o man_hash.o man_validate.o \
64 MANSRCS
= man_macro.c man.c man_hash.c man_validate.c \
67 MAINLNS
= main.ln mdoc_term.ln chars.ln term.ln tree.ln \
68 compat.ln man_term.ln html.ln mdoc_html.ln \
69 man_html.ln out.ln term_ps.ln term_ascii.ln \
70 tbl_term.ln tbl_html.ln
72 MAINOBJS
= main.o mdoc_term.o chars.o term.o tree.o compat.o \
73 man_term.o html.o mdoc_html.o man_html.o out.o \
74 term_ps.o term_ascii.o tbl_term.o tbl_html.o
76 MAINSRCS
= main.c mdoc_term.c chars.c term.c tree.c compat.c \
77 man_term.c html.c mdoc_html.c man_html.c out.c \
78 term_ps.c term_ascii.c tbl_term.c tbl_html.c
80 LLNS
= llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln \
81 llib-llibmandoc.ln llib-llibroff.ln
83 LNS
= $(MAINLNS
) $(MDOCLNS
) $(MANLNS
) \
84 $(MANDOCLNS
) $(ROFFLNS
)
86 LIBS
= libmdoc.a libman.a libmandoc.a libroff.a
88 OBJS
= $(MDOCOBJS
) $(MAINOBJS
) $(MANOBJS
) \
89 $(MANDOCOBJS
) $(ROFFOBJS
)
91 SRCS
= $(MDOCSRCS
) $(MAINSRCS
) $(MANSRCS
) \
92 $(MANDOCSRCS
) $(ROFFSRCS
)
94 DATAS
= arch.in att.in lib.in msec.in st.in \
97 HEADS
= mdoc.h libmdoc.h man.h libman.h term.h \
98 libmandoc.h html.h chars.h out.h main.h roff.h \
101 GSGMLS
= mandoc
.1.sgml mdoc
.3.sgml mdoc
.7.sgml \
102 mandoc_char
.7.sgml man
.7.sgml man
.3.sgml roff
.7.sgml \
103 roff
.3.sgml tbl
.7.sgml
107 XHTMLS
= mandoc
.1.xhtml mdoc
.3.xhtml \
108 man
.3.xhtml mdoc
.7.xhtml man
.7.xhtml mandoc_char
.7.xhtml \
109 roff
.7.xhtml roff
.3.xhtml tbl
.7.xhtml
111 HTMLS
= ChangeLog.html index.html man.h.html mdoc.h.html \
112 mandoc.h.html roff.h.html mandoc
.1.html mdoc
.3.html \
113 man
.3.html mdoc
.7.html man
.7.html mandoc_char
.7.html \
114 roff
.7.html roff
.3.html tbl
.7.html
116 PSS
= mandoc
.1.ps mdoc
.3.ps man
.3.ps mdoc
.7.ps man
.7.ps \
117 mandoc_char
.7.ps roff
.7.ps roff
.3.ps tbl
.7.ps
119 PDFS
= mandoc
.1.pdf mdoc
.3.pdf man
.3.pdf mdoc
.7.pdf man
.7.pdf \
120 mandoc_char
.7.pdf roff
.7.pdf roff
.3.pdf tbl
.7.pdf
124 TEXTS
= mandoc
.1.txt mdoc
.3.txt man
.3.txt mdoc
.7.txt man
.7.txt \
125 mandoc_char
.7.txt ChangeLog.txt \
126 roff
.7.txt roff
.3.txt tbl
.7.txt
128 EXAMPLES
= example.style.css
132 STATICS
= index.css style.css external.png
134 MD5S
= mdocml-
$(VERSION
).md5
136 TARGZS
= mdocml-
$(VERSION
).
tar.gz
138 MANS
= mandoc
.1 mdoc
.3 mdoc
.7 mandoc_char
.7 man
.7 \
139 man
.3 roff
.7 roff
.3 tbl
.7
143 TESTS
= test-strlcat.c test-strlcpy.c
145 CONFIGS
= config.h.pre config.h.post
147 DOCLEAN
= $(BINS
) $(LNS
) $(LLNS
) $(LIBS
) $(OBJS
) $(HTMLS
) \
148 $(TARGZS
) tags $(MD5S
) $(XMLS
) $(TEXTS
) $(GSGMLS
) \
149 config.h config.log
$(PSS
) $(PDFS
) $(XHTMLS
)
151 DOINSTALL
= $(SRCS
) $(HEADS
) Makefile
$(MANS
) $(SGMLS
) $(STATICS
) \
152 $(DATAS
) $(XSLS
) $(EXAMPLES
) $(TESTS
) $(CONFIGS
)
161 dist: mdocml-
$(VERSION
).
tar.gz
163 www
: all $(GSGMLS
) $(HTMLS
) $(XHTMLS
) $(TEXTS
) $(MD5S
) $(TARGZS
) $(PSS
) $(PDFS
)
170 $(INSTALL_DATA
) $(HTMLS
) $(XHTMLS
) $(PSS
) $(PDFS
) $(TEXTS
) $(STATICS
) $(DESTDIR
)$(PREFIX
)/
171 $(INSTALL_DATA
) mdocml-
$(VERSION
).
tar.gz
$(DESTDIR
)$(PREFIX
)/snapshots
/
172 $(INSTALL_DATA
) mdocml-
$(VERSION
).md5
$(DESTDIR
)$(PREFIX
)/snapshots
/
173 $(INSTALL_DATA
) mdocml-
$(VERSION
).
tar.gz
$(DESTDIR
)$(PREFIX
)/snapshots
/mdocml.
tar.gz
174 $(INSTALL_DATA
) mdocml-
$(VERSION
).md5
$(DESTDIR
)$(PREFIX
)/snapshots
/mdocml.md5
177 mkdir
-p
$(DESTDIR
)$(BINDIR
)
178 mkdir
-p
$(DESTDIR
)$(EXAMPLEDIR
)
179 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
180 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man7
181 $(INSTALL_PROGRAM
) mandoc
$(DESTDIR
)$(BINDIR
)
182 $(INSTALL_MAN
) mandoc
.1 $(DESTDIR
)$(MANDIR
)/man1
183 $(INSTALL_MAN
) man
.7 mdoc
.7 roff
.7 tbl
.7 mandoc_char
.7 $(DESTDIR
)$(MANDIR
)/man7
184 $(INSTALL_DATA
) example.style.css
$(DESTDIR
)$(EXAMPLEDIR
)
187 rm -f
$(DESTDIR
)$(BINDIR
)/mandoc
188 rm -f
$(DESTDIR
)$(MANDIR
)/man1
/mandoc
.1
189 rm -f
$(DESTDIR
)$(MANDIR
)/man7
/mdoc
.7
190 rm -f
$(DESTDIR
)$(MANDIR
)/man7
/roff
.7
191 rm -f
$(DESTDIR
)$(MANDIR
)/man7
/tbl
.7
192 rm -f
$(DESTDIR
)$(MANDIR
)/man7
/man
.7
193 rm -f
$(DESTDIR
)$(MANDIR
)/man7
/mandoc_char
.7
194 rm -f
$(DESTDIR
)$(EXAMPLEDIR
)/example.style.css
200 man_macro.ln man_macro.o
: man_macro.c libman.h
202 lib.ln lib.o
: lib.c lib.in libmdoc.h
204 att.ln att.o
: att.c att.in libmdoc.h
206 arch.ln arch.o
: arch.c arch.in libmdoc.h
208 vol.ln vol.o
: vol.c vol.in libmdoc.h
210 chars.ln chars.o
: chars.c chars.in chars.h
212 msec.ln msec.o
: msec.c msec.in libmdoc.h
214 st.ln st.o
: st.c st.in libmdoc.h
216 mdoc_macro.ln mdoc_macro.o
: mdoc_macro.c libmdoc.h
218 mdoc_term.ln mdoc_term.o
: mdoc_term.c term.h mdoc.h
220 mdoc_strings.ln mdoc_strings.o
: mdoc_strings.c libmdoc.h
222 man_hash.ln man_hash.o
: man_hash.c libman.h
224 mdoc_hash.ln mdoc_hash.o
: mdoc_hash.c libmdoc.h
226 mdoc.ln mdoc.o
: mdoc.c libmdoc.h
228 man.ln man.o
: man.c libman.h
230 main.ln main.o
: main.c mdoc.h man.h roff.h
232 compat.ln compat.o
: compat.c
234 term.ln term.o
: term.c term.h man.h mdoc.h chars.h
236 term_ps.ln term_ps.o
: term_ps.c term.h main.h
238 term_ascii.ln term_ascii.o
: term_ascii.c term.h main.h
240 html.ln html.o
: html.c html.h chars.h
242 mdoc_html.ln mdoc_html.o
: mdoc_html.c html.h mdoc.h
244 man_html.ln man_html.o
: man_html.c html.h man.h out.h
246 out.ln out.o
: out.c out.h
248 mandoc.ln mandoc.o
: mandoc.c libmandoc.h
250 tree.ln tree.o
: tree.c man.h mdoc.h
252 mdoc_argv.ln mdoc_argv.o
: mdoc_argv.c libmdoc.h
254 man_argv.ln man_argv.o
: man_argv.c libman.h
256 man_validate.ln man_validate.o
: man_validate.c libman.h
258 mdoc_validate.ln mdoc_validate.o
: mdoc_validate.c libmdoc.h
263 cvs2cl
--xml
--xml-encoding iso-8859-15
-t
--noxmlns
-f
$@
268 ChangeLog.html
: ChangeLog.xml ChangeLog.xsl
269 xsltproc
-o
$@ ChangeLog.xsl ChangeLog.xml
271 mdocml-
$(VERSION
).
tar.gz
: $(DOINSTALL
)
272 mkdir
-p .
dist/mdocml
/mdocml-
$(VERSION
)/
273 cp
-f
$(DOINSTALL
) .
dist/mdocml
/mdocml-
$(VERSION
)/
274 ( cd .
dist/mdocml
/ && tar zcf ..
/..
/$@ mdocml-
$(VERSION
)/ )
277 llib-llibmdoc.ln
: $(MDOCLNS
)
278 $(LINT
) -Clibmdoc
$(MDOCLNS
)
280 llib-llibman.ln
: $(MANLNS
)
281 $(LINT
) -Clibman
$(MANLNS
)
283 llib-llibmandoc.ln
: $(MANDOCLNS
)
284 $(LINT
) -Clibmandoc
$(MANDOCLNS
)
286 llib-llibroff.ln
: $(ROFFLNS
)
287 $(LINT
) -Clibroff
$(ROFFLNS
)
289 llib-lmandoc.ln
: $(MAINLNS
) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln llib-llibroff.ln
290 $(LINT
) -Cmandoc
$(MAINLNS
) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln llib-llibroff.ln
292 libmdoc.a
: $(MDOCOBJS
)
293 $(AR
) rs
$@
$(MDOCOBJS
)
296 $(AR
) rs
$@
$(MANOBJS
)
298 libmandoc.a
: $(MANDOCOBJS
)
299 $(AR
) rs
$@
$(MANDOCOBJS
)
301 libroff.a
: $(ROFFOBJS
)
302 $(AR
) rs
$@
$(ROFFOBJS
)
304 mandoc
: $(MAINOBJS
) libroff.a libmdoc.a libman.a libmandoc.a
305 $(CC
) $(CFLAGS
) -o
$@
$(MAINOBJS
) libroff.a libmdoc.a libman.a libmandoc.a
309 sed
-e
"s!@VERSION@!$(VERSION)!" -e
"s!@VDATE@!$(VDATE)!" $< > $@
311 .1.1.txt
.3.3.txt
.7.7.txt
:
312 .
/mandoc
-Tascii
-Wall
,stop
$< | col
-b
> $@
314 .1.1.sgml
.3.3.sgml
.7.7.sgml
:
315 .
/mandoc
-Thtml
-Wall
,stop
-Ostyle
=style.css
,man
=%N.
%S.html
,includes
=%I.html
$< > $@
317 .1.1.ps
.3.3.ps
.7.7.ps
:
318 .
/mandoc
-Tps
-Wall
,stop
$< > $@
320 .1.1.xhtml
.3.3.xhtml
.7.7.xhtml
:
321 .
/mandoc
-Txhtml
-Wall
,stop
-Ostyle
=style.css
,man
=%N.
%S.xhtml
,includes
=%I.html
$< > $@
323 .1.1.pdf
.3.3.pdf
.7.7.pdf
:
324 .
/mandoc
-Tpdf
-Wall
,stop
$< > $@
332 config.h
: config.h.pre config.h.post
334 ( cat config.h.pre
; \
336 if
$(CC
) $(CFLAGS
) -Werror
-c test-strlcat.c
>> config.log
2>&1; then \
337 echo
'#define HAVE_STRLCAT'; \
340 if
$(CC
) $(CFLAGS
) -Werror
-c test-strlcpy.c
>> config.log
2>&1; then \
341 echo
'#define HAVE_STRLCPY'; \