1 .SUFFIXES: .html .xml .sgml .1.txt .3.txt .7.txt .1 .3 .7 .md5 .tar.gz
4 INCLUDEDIR = $(PREFIX)/include
7 INSTALL_PROGRAM = install -m 0755
8 INSTALL_DATA = install -m 0444
9 INSTALL_LIB = install -m 0644
10 INSTALL_MAN = $(INSTALL_DATA)
13 VDATE = 05 September 2009
15 VFLAGS = -DVERSION=\"$(VERSION)\"
16 CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -g
18 LINTFLAGS += $(VFLAGS)
20 MDOCLNS = mdoc_macro.ln mdoc.ln mdoc_hash.ln mdoc_strings.ln \
21 mdoc_argv.ln mdoc_validate.ln mdoc_action.ln \
22 lib.ln att.ln arch.ln vol.ln msec.ln st.ln \
24 MDOCOBJS = mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \
25 mdoc_argv.o mdoc_validate.o mdoc_action.o lib.o att.o \
26 arch.o vol.o msec.o st.o mandoc.o
27 MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \
28 mdoc_argv.c mdoc_validate.c mdoc_action.c lib.c att.c \
29 arch.c vol.c msec.c st.c mandoc.c
31 MANLNS = man_macro.ln man.ln man_hash.ln man_validate.ln \
32 man_action.ln mandoc.ln man_argv.ln
33 MANOBJS = man_macro.o man.o man_hash.o man_validate.o \
34 man_action.o mandoc.o man_argv.o
35 MANSRCS = man_macro.c man.c man_hash.c man_validate.c \
36 man_action.c mandoc.c man_argv.c
38 MAINLNS = main.ln mdoc_term.ln ascii.ln term.ln tree.ln \
39 compat.ln man_term.ln html.ln
40 MAINOBJS = main.o mdoc_term.o ascii.o term.o tree.o compat.o \
42 MAINSRCS = main.c mdoc_term.c ascii.c term.c tree.c compat.c \
45 LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln
46 LNS = $(MAINLNS) $(MDOCLNS) $(MANLNS)
47 LIBS = libmdoc.a libman.a
48 OBJS = $(MDOCOBJS) $(MAINOBJS) $(MANOBJS)
49 SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS)
50 DATAS = arch.in att.in lib.in msec.in st.in vol.in ascii.in
51 HEADS = mdoc.h libmdoc.h man.h libman.h term.h libmandoc.h
54 HTMLS = index.html ChangeLog.html
56 STATICS = style.css external.png
57 MD5S = mdocml-$(VERSION).md5
58 TARGZS = mdocml-$(VERSION).tar.gz
59 MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
61 TEXTS = mandoc.1.txt mdoc.3.txt mdoc.7.txt manuals.7.txt \
62 mandoc_char.7.txt man.7.txt man.3.txt
64 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
65 $(TARGZS) tags $(TEXTS) $(MD5S) $(XMLS)
66 INSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
79 dist: mdocml-$(VERSION).tar.gz
83 www: all $(HTMLS) $(MD5S) $(TARGZS) $(TEXTS)
86 install -m 0444 $(TEXTS) $(HTMLS) $(STATICS) $(PREFIX)/
87 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
88 install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/
89 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
90 install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/mdocml.md5
94 mkdir -p $(MANDIR)/man1
95 mkdir -p $(MANDIR)/man7
96 $(INSTALL_PROGRAM) mandoc $(BINDIR)
97 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
98 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
101 rm -f $(BINDIR)/mandoc
102 rm -f $(MANDIR)/man1/mandoc.1
103 rm -f $(MANDIR)/man7/mdoc.7
105 man_macro.ln: man_macro.c libman.h
106 man_macro.o: man_macro.c libman.h
108 lib.ln: lib.c lib.in libmdoc.h
109 lib.o: lib.c lib.in libmdoc.h
111 att.ln: att.c att.in libmdoc.h
112 att.o: att.c att.in libmdoc.h
114 arch.ln: arch.c arch.in libmdoc.h
115 arch.o: arch.c arch.in libmdoc.h
117 vol.ln: vol.c vol.in libmdoc.h
118 vol.o: vol.c vol.in libmdoc.h
120 ascii.ln: ascii.c ascii.in term.h
121 ascii.o: ascii.c ascii.in term.h
123 msec.ln: msec.c msec.in libmdoc.h
124 msec.o: msec.c msec.in libmdoc.h
126 st.ln: st.c st.in libmdoc.h
127 st.o: st.c st.in libmdoc.h
129 mdoc_macro.ln: mdoc_macro.c libmdoc.h
130 mdoc_macro.o: mdoc_macro.c libmdoc.h
132 mdoc_term.ln: mdoc_term.c term.h mdoc.h
133 mdoc_term.o: mdoc_term.c term.h mdoc.h
135 mdoc_strings.ln: mdoc_strings.c libmdoc.h
136 mdoc_strings.o: mdoc_strings.c libmdoc.h
138 man_hash.ln: man_hash.c libman.h
139 man_hash.o: man_hash.c libman.h
141 mdoc_hash.ln: mdoc_hash.c libmdoc.h
142 mdoc_hash.o: mdoc_hash.c libmdoc.h
144 mdoc.ln: mdoc.c libmdoc.h
145 mdoc.o: mdoc.c libmdoc.h
147 man.ln: man.c libman.h
148 man.o: man.c libman.h
150 main.ln: main.c mdoc.h
151 main.o: main.c mdoc.h
156 term.ln: term.c term.h man.h mdoc.h
157 term.o: term.c term.h man.h mdoc.h
159 html.ln: html.c man.h mdoc.h
160 html.o: html.c man.h mdoc.h
162 tree.ln: tree.c man.h mdoc.h
163 tree.o: tree.c man.h mdoc.h
165 mdoc_argv.ln: mdoc_argv.c libmdoc.h
166 mdoc_argv.o: mdoc_argv.c libmdoc.h
168 man_argv.ln: man_argv.c libman.h
169 man_argv.o: man_argv.c libman.h
171 man_validate.ln: man_validate.c libman.h
172 man_validate.o: man_validate.c libman.h
174 mdoc_validate.ln: mdoc_validate.c libmdoc.h
175 mdoc_validate.o: mdoc_validate.c libmdoc.h
177 mdoc_action.ln: mdoc_action.c libmdoc.h
178 mdoc_action.o: mdoc_action.c libmdoc.h
183 cvs2cl --xml --xml-encoding iso-8859-15 -t --noxmlns -f $@
185 ChangeLog.html: ChangeLog.xml ChangeLog.xsl
186 xsltproc -o $@ ChangeLog.xsl ChangeLog.xml
188 mdocml-$(VERSION).tar.gz: $(INSTALL)
189 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
190 cp -f $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
191 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
194 llib-llibmdoc.ln: $(MDOCLNS)
195 $(LINT) -Clibmdoc $(MDOCLNS)
197 llib-llibman.ln: $(MANLNS)
198 $(LINT) -Clibman $(MANLNS)
200 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
201 $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln
203 libmdoc.a: $(MDOCOBJS)
204 $(AR) rs $@ $(MDOCOBJS)
207 $(AR) rs $@ $(MANOBJS)
209 mandoc: $(MAINOBJS) libmdoc.a libman.a
210 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a
214 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
217 ./mandoc -Wall,error -fstrict $< | col -b > $@
220 ./mandoc -Wall,error -fstrict $< | col -b > $@
223 ./mandoc -Wall,error -fstrict $< | col -b > $@