1 .SUFFIXES: .html .sgml .1.txt .3.txt .7.txt .1 .3 .7
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)
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
23 MDOCOBJS = mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \
24 mdoc_argv.o mdoc_validate.o mdoc_action.o lib.o att.o \
25 arch.o vol.o msec.o st.o
26 MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \
27 mdoc_argv.c mdoc_validate.c mdoc_action.c lib.c att.c \
28 arch.c vol.c msec.c st.c
30 MANLNS = man_macro.ln man.ln man_hash.ln man_validate.ln \
32 MANOBJS = man_macro.o man.o man_hash.o man_validate.o \
34 MANSRCS = man_macro.c man.c man_hash.c man_validate.c \
37 MAINLNS = main.ln mdoc_term.ln ascii.ln term.ln tree.ln \
39 MAINOBJS = main.o mdoc_term.o ascii.o term.o tree.o compat.o \
41 MAINSRCS = main.c mdoc_term.c ascii.c term.c tree.c compat.c \
44 LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln
45 LNS = $(MAINLNS) $(MDOCLNS) $(MANLNS)
46 LIBS = libmdoc.a libman.a
47 OBJS = $(MDOCOBJS) $(MAINOBJS) $(MANOBJS)
48 SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS)
49 DATAS = arch.in att.in lib.in msec.in st.in vol.in ascii.in
50 HEADS = mdoc.h libmdoc.h man.h libman.h term.h
53 STATICS = style.css external.png
54 TARGZS = mdocml-$(VERSION).tar.gz \
55 mdocml-oport-$(VERSION).tar.gz \
56 mdocml-fport-$(VERSION).tar.gz \
57 mdocml-nport-$(VERSION).tar.gz
58 MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
60 TEXTS = mandoc.1.txt mdoc.3.txt mdoc.7.txt manuals.7.txt \
61 mandoc_char.7.txt man.7.txt man.3.txt
63 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
64 $(TARGZS) tags $(TEXTS) ChangeLog
65 MAKEFILES = Makefile.netbsd Makefile.openbsd Makefile.freebsd \
67 INSTALL = $(SRCS) $(HEADS) $(MAKEFILES) DESCR $(MANS) $(SGMLS) \
80 dist: mdocml-$(VERSION).tar.gz
82 port: mdocml-oport-$(VERSION).tar.gz \
83 mdocml-fport-$(VERSION).tar.gz \
84 mdocml-nport-$(VERSION).tar.gz
86 www: all $(HTMLS) $(TARGZS) $(TEXTS) ChangeLog
89 install -m 0444 $(TEXTS) $(HTMLS) $(STATICS) $(PREFIX)/
90 install -m 0444 ChangeLog $(PREFIX)/snapshots/
91 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
92 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
93 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
94 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
95 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
96 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
97 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/
98 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/mdocml.tar.gz
102 mkdir -p $(MANDIR)/man1
103 mkdir -p $(MANDIR)/man7
104 $(INSTALL_PROGRAM) mandoc $(BINDIR)
105 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
106 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
109 rm -f $(BINDIR)/mandoc
110 rm -f $(MANDIR)/man1/mandoc.1
111 rm -f $(MANDIR)/man7/mdoc.7
113 man_macro.ln: man_macro.c libman.h
114 man_macro.o: man_macro.c libman.h
116 lib.ln: lib.c lib.in libmdoc.h
117 lib.o: lib.c lib.in libmdoc.h
119 att.ln: att.c att.in libmdoc.h
120 att.o: att.c att.in libmdoc.h
122 arch.ln: arch.c arch.in libmdoc.h
123 arch.o: arch.c arch.in libmdoc.h
125 vol.ln: vol.c vol.in libmdoc.h
126 vol.o: vol.c vol.in libmdoc.h
128 ascii.ln: ascii.c ascii.in term.h
129 ascii.o: ascii.c ascii.in term.h
131 msec.ln: msec.c msec.in libmdoc.h
132 msec.o: msec.c msec.in libmdoc.h
134 st.ln: st.c st.in libmdoc.h
135 st.o: st.c st.in libmdoc.h
137 mdoc_macro.ln: mdoc_macro.c libmdoc.h
138 mdoc_macro.o: mdoc_macro.c libmdoc.h
140 mdoc_term.ln: mdoc_term.c term.h mdoc.h
141 mdoc_term.o: mdoc_term.c term.h mdoc.h
143 mdoc_strings.ln: mdoc_strings.c libmdoc.h
144 mdoc_strings.o: mdoc_strings.c libmdoc.h
146 man_hash.ln: man_hash.c libman.h
147 man_hash.o: man_hash.c libman.h
149 mdoc_hash.ln: mdoc_hash.c libmdoc.h
150 mdoc_hash.o: mdoc_hash.c libmdoc.h
152 mdoc.ln: mdoc.c libmdoc.h
153 mdoc.o: mdoc.c libmdoc.h
155 man.ln: man.c libman.h
156 man.o: man.c libman.h
158 main.ln: main.c mdoc.h
159 main.o: main.c mdoc.h
164 term.ln: term.c term.h man.h mdoc.h
165 term.o: term.c term.h man.h mdoc.h
167 mdoc_argv.ln: mdoc_argv.c libmdoc.h
168 mdoc_argv.o: mdoc_argv.c libmdoc.h
170 man_validate.ln: man_validate.c libman.h
171 man_validate.o: man_validate.c libman.h
173 mdoc_validate.ln: mdoc_validate.c libmdoc.h
174 mdoc_validate.o: mdoc_validate.c libmdoc.h
176 mdoc_action.ln: mdoc_action.c libmdoc.h
177 mdoc_action.o: mdoc_action.c libmdoc.h
182 cvs2cl -P -t --no-indent --FSF --no-times
184 mdocml-nport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.netbsd DESCR
185 mkdir -p .dist/mdocml/
186 sed -e "s!@VERSION@!$(VERSION)!" Makefile.netbsd > \
187 .dist/mdocml/Makefile
188 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
189 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
190 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
191 install -m 0644 DESCR .dist/mdocml/
192 echo @comment $$NetBSD$$ > .dist/mdocml/PLIST
193 echo bin/mandoc >> .dist/mdocml/PLIST
194 echo man/man1/mandoc.1 >> .dist/mdocml/PLIST
195 echo man/man7/mdoc.7 >> .dist/mdocml/PLIST
196 ( cd .dist/ && tar zcf ../$@ mdocml/ )
199 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
200 mkdir -p .dist/mdocml/pkg
201 sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
202 .dist/mdocml/Makefile
203 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
204 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
205 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
206 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
207 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
208 echo bin/mandoc >> .dist/mdocml/pkg/PLIST
209 echo @man man/man1/mandoc.1 >> .dist/mdocml/pkg/PLIST
210 echo @man man/man7/mdoc.7 >> .dist/mdocml/pkg/PLIST
211 ( cd .dist/ && tar zcf ../$@ mdocml/ )
214 mdocml-fport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.freebsd DESCR
215 mkdir -p .dist/mdocml
216 sed -e "s!@VERSION@!$(VERSION)!" Makefile.freebsd > \
217 .dist/mdocml/Makefile
218 ( md5 mdocml-$(VERSION).tar.gz; \
219 cksum -a SHA256 mdocml-$(VERSION).tar.gz; \
220 echo -n "SIZE (mdocml-$(VERSION).tar.gz) = "; \
221 ls -l mdocml-$(VERSION).tar.gz | awk '{print $$5}' \
222 ) > .dist/mdocml/distinfo
223 install -m 0644 DESCR .dist/mdocml/pkg-descr
224 ( echo; echo "WWW: http://mdocml.bsd.lv/") >> .dist/mdocml/pkg-descr
225 ( cd .dist/ && tar zcf ../$@ mdocml/ )
228 mdocml-$(VERSION).tar.gz: $(INSTALL)
229 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
230 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
231 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
234 llib-llibmdoc.ln: $(MDOCLNS)
235 $(LINT) -Clibmdoc $(MDOCLNS)
237 llib-llibman.ln: $(MANLNS)
238 $(LINT) -Clibman $(MANLNS)
240 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
241 $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln
243 libmdoc.a: $(MDOCOBJS)
244 $(AR) rs $@ $(MDOCOBJS)
247 $(AR) rs $@ $(MANOBJS)
249 mandoc: $(MAINOBJS) libmdoc.a libman.a
250 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a
254 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
257 ./mandoc -Wall,error -fstrict $< | col -b > $@
260 ./mandoc -Wall,error -fstrict $< | col -b > $@
263 ./mandoc -Wall,error -fstrict $< | col -b > $@