1 .SUFFIXES: .html .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)
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 MD5S = mdocml-$(VERSION).md5 \
55 mdocml-oport-$(VERSION).md5 \
56 mdocml-fport-$(VERSION).md5 \
57 mdocml-nport-$(VERSION).md5
58 TARGZS = mdocml-$(VERSION).tar.gz \
59 mdocml-oport-$(VERSION).tar.gz \
60 mdocml-fport-$(VERSION).tar.gz \
61 mdocml-nport-$(VERSION).tar.gz
62 MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
64 TEXTS = mandoc.1.txt mdoc.3.txt mdoc.7.txt manuals.7.txt \
65 mandoc_char.7.txt man.7.txt man.3.txt
67 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
68 $(TARGZS) tags $(TEXTS) ChangeLog
69 MAKEFILES = Makefile.netbsd Makefile.openbsd Makefile.freebsd \
71 INSTALL = $(SRCS) $(HEADS) $(MAKEFILES) DESCR $(MANS) $(SGMLS) \
84 dist: mdocml-$(VERSION).tar.gz
90 www: all $(TARGZS) $(TEXTS) ChangeLog
93 install -m 0444 $(TEXTS) $(HTMLS) $(STATICS) $(PREFIX)/
94 install -m 0444 ChangeLog $(PREFIX)/snapshots/
95 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
96 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
97 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
98 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
99 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
100 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
101 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/
102 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/mdocml.tar.gz
106 mkdir -p $(MANDIR)/man1
107 mkdir -p $(MANDIR)/man7
108 $(INSTALL_PROGRAM) mandoc $(BINDIR)
109 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
110 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
113 rm -f $(BINDIR)/mandoc
114 rm -f $(MANDIR)/man1/mandoc.1
115 rm -f $(MANDIR)/man7/mdoc.7
117 man_macro.ln: man_macro.c libman.h
118 man_macro.o: man_macro.c libman.h
120 lib.ln: lib.c lib.in libmdoc.h
121 lib.o: lib.c lib.in libmdoc.h
123 att.ln: att.c att.in libmdoc.h
124 att.o: att.c att.in libmdoc.h
126 arch.ln: arch.c arch.in libmdoc.h
127 arch.o: arch.c arch.in libmdoc.h
129 vol.ln: vol.c vol.in libmdoc.h
130 vol.o: vol.c vol.in libmdoc.h
132 ascii.ln: ascii.c ascii.in term.h
133 ascii.o: ascii.c ascii.in term.h
135 msec.ln: msec.c msec.in libmdoc.h
136 msec.o: msec.c msec.in libmdoc.h
138 st.ln: st.c st.in libmdoc.h
139 st.o: st.c st.in libmdoc.h
141 mdoc_macro.ln: mdoc_macro.c libmdoc.h
142 mdoc_macro.o: mdoc_macro.c libmdoc.h
144 mdoc_term.ln: mdoc_term.c term.h mdoc.h
145 mdoc_term.o: mdoc_term.c term.h mdoc.h
147 mdoc_strings.ln: mdoc_strings.c libmdoc.h
148 mdoc_strings.o: mdoc_strings.c libmdoc.h
150 man_hash.ln: man_hash.c libman.h
151 man_hash.o: man_hash.c libman.h
153 mdoc_hash.ln: mdoc_hash.c libmdoc.h
154 mdoc_hash.o: mdoc_hash.c libmdoc.h
156 mdoc.ln: mdoc.c libmdoc.h
157 mdoc.o: mdoc.c libmdoc.h
159 man.ln: man.c libman.h
160 man.o: man.c libman.h
162 main.ln: main.c mdoc.h
163 main.o: main.c mdoc.h
168 term.ln: term.c term.h man.h mdoc.h
169 term.o: term.c term.h man.h mdoc.h
171 mdoc_argv.ln: mdoc_argv.c libmdoc.h
172 mdoc_argv.o: mdoc_argv.c libmdoc.h
174 man_validate.ln: man_validate.c libman.h
175 man_validate.o: man_validate.c libman.h
177 mdoc_validate.ln: mdoc_validate.c libmdoc.h
178 mdoc_validate.o: mdoc_validate.c libmdoc.h
180 mdoc_action.ln: mdoc_action.c libmdoc.h
181 mdoc_action.o: mdoc_action.c libmdoc.h
186 cvs2cl -P -t --no-indent --FSF --no-times
188 mdocml-nport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.netbsd DESCR
189 mkdir -p .dist/mdocml/
190 sed -e "s!@VERSION@!$(VERSION)!" Makefile.netbsd > \
191 .dist/mdocml/Makefile
192 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
193 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
194 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
195 install -m 0644 DESCR .dist/mdocml/
196 echo @comment $$NetBSD$$ > .dist/mdocml/PLIST
197 echo bin/mandoc >> .dist/mdocml/PLIST
198 echo man/man1/mandoc.1 >> .dist/mdocml/PLIST
199 echo man/man7/mdoc.7 >> .dist/mdocml/PLIST
200 ( cd .dist/ && tar zcf ../$@ mdocml/ )
203 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
204 mkdir -p .dist/mdocml/pkg
205 sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
206 .dist/mdocml/Makefile
207 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
208 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
209 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
210 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
211 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
212 echo bin/mandoc >> .dist/mdocml/pkg/PLIST
213 echo @man man/man1/mandoc.1 >> .dist/mdocml/pkg/PLIST
214 echo @man man/man7/mdoc.7 >> .dist/mdocml/pkg/PLIST
215 ( cd .dist/ && tar zcf ../$@ mdocml/ )
218 mdocml-fport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.freebsd DESCR
219 mkdir -p .dist/mdocml
220 sed -e "s!@VERSION@!$(VERSION)!" Makefile.freebsd > \
221 .dist/mdocml/Makefile
222 ( md5 mdocml-$(VERSION).tar.gz; \
223 cksum -a SHA256 mdocml-$(VERSION).tar.gz; \
224 echo -n "SIZE (mdocml-$(VERSION).tar.gz) = "; \
225 ls -l mdocml-$(VERSION).tar.gz | awk '{print $$5}' \
226 ) > .dist/mdocml/distinfo
227 install -m 0644 DESCR .dist/mdocml/pkg-descr
228 ( echo; echo "WWW: http://mdocml.bsd.lv/") >> .dist/mdocml/pkg-descr
229 ( cd .dist/ && tar zcf ../$@ mdocml/ )
232 mdocml-$(VERSION).tar.gz: $(INSTALL)
233 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
234 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
235 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
238 llib-llibmdoc.ln: $(MDOCLNS)
239 $(LINT) -Clibmdoc $(MDOCLNS)
241 llib-llibman.ln: $(MANLNS)
242 $(LINT) -Clibman $(MANLNS)
244 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
245 $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln
247 libmdoc.a: $(MDOCOBJS)
248 $(AR) rs $@ $(MDOCOBJS)
251 $(AR) rs $@ $(MANOBJS)
253 mandoc: $(MAINOBJS) libmdoc.a libman.a
254 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a
258 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
261 ./mandoc -Wall,error -fstrict $< | col -b > $@
264 ./mandoc -Wall,error -fstrict $< | col -b > $@
267 ./mandoc -Wall,error -fstrict $< | col -b > $@