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
17 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
60 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) $(TARGZS) \
62 MAKEFILES = Makefile.netbsd Makefile.openbsd Makefile.freebsd \
64 INSTALL = $(SRCS) $(HEADS) $(MAKEFILES) DESCR $(MANS) $(SGMLS) \
77 dist: mdocml-$(VERSION).tar.gz
79 port: mdocml-oport-$(VERSION).tar.gz \
80 mdocml-fport-$(VERSION).tar.gz \
81 mdocml-nport-$(VERSION).tar.gz
83 www: $(HTMLS) $(TARGZS)
86 install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
87 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
88 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
89 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
90 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
91 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
92 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
93 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/
94 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/mdocml.tar.gz
98 mkdir -p $(MANDIR)/man1
99 mkdir -p $(MANDIR)/man7
100 $(INSTALL_PROGRAM) mandoc $(BINDIR)
101 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
102 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
105 rm -f $(BINDIR)/mandoc
106 rm -f $(MANDIR)/man1/mandoc.1
107 rm -f $(MANDIR)/man7/mdoc.7
109 man_macro.ln: man_macro.c libman.h
110 man_macro.o: man_macro.c libman.h
112 lib.ln: lib.c lib.in libmdoc.h
113 lib.o: lib.c lib.in libmdoc.h
115 att.ln: att.c att.in libmdoc.h
116 att.o: att.c att.in libmdoc.h
118 arch.ln: arch.c arch.in libmdoc.h
119 arch.o: arch.c arch.in libmdoc.h
121 vol.ln: vol.c vol.in libmdoc.h
122 vol.o: vol.c vol.in libmdoc.h
124 ascii.ln: ascii.c ascii.in term.h
125 ascii.o: ascii.c ascii.in term.h
127 msec.ln: msec.c msec.in libmdoc.h
128 msec.o: msec.c msec.in libmdoc.h
130 st.ln: st.c st.in libmdoc.h
131 st.o: st.c st.in libmdoc.h
133 mdoc_macro.ln: mdoc_macro.c libmdoc.h
134 mdoc_macro.o: mdoc_macro.c libmdoc.h
136 mdoc_term.ln: mdoc_term.c term.h mdoc.h
137 mdoc_term.o: mdoc_term.c term.h mdoc.h
139 mdoc_strings.ln: mdoc_strings.c libmdoc.h
140 mdoc_strings.o: mdoc_strings.c libmdoc.h
142 man_hash.ln: man_hash.c libman.h
143 man_hash.o: man_hash.c libman.h
145 mdoc_hash.ln: mdoc_hash.c libmdoc.h
146 mdoc_hash.o: mdoc_hash.c libmdoc.h
148 mdoc.ln: mdoc.c libmdoc.h
149 mdoc.o: mdoc.c libmdoc.h
151 man.ln: man.c libman.h
152 man.o: man.c libman.h
154 main.ln: main.c mdoc.h
155 main.o: main.c mdoc.h
157 term.ln: term.c term.h man.h mdoc.h
158 term.o: term.c term.h man.h mdoc.h
160 mdoc_argv.ln: mdoc_argv.c libmdoc.h
161 mdoc_argv.o: mdoc_argv.c libmdoc.h
163 man_validate.ln: man_validate.c libman.h
164 man_validate.o: man_validate.c libman.h
166 mdoc_validate.ln: mdoc_validate.c libmdoc.h
167 mdoc_validate.o: mdoc_validate.c libmdoc.h
169 mdoc_action.ln: mdoc_action.c libmdoc.h
170 mdoc_action.o: mdoc_action.c libmdoc.h
174 mdocml-nport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.netbsd DESCR
175 mkdir -p .dist/mdocml/
176 sed -e "s!@VERSION@!$(VERSION)!" Makefile.netbsd > \
177 .dist/mdocml/Makefile
178 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
179 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
180 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
181 install -m 0644 DESCR .dist/mdocml/
182 echo @comment $$NetBSD$$ > .dist/mdocml/PLIST
183 echo bin/mandoc >> .dist/mdocml/PLIST
184 echo man/man1/mandoc.1 >> .dist/mdocml/PLIST
185 echo man/man7/mdoc.7 >> .dist/mdocml/PLIST
186 ( cd .dist/ && tar zcf ../$@ mdocml/ )
189 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
190 mkdir -p .dist/mdocml/pkg
191 sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
192 .dist/mdocml/Makefile
193 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
194 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
195 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
196 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
197 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
198 echo bin/mandoc >> .dist/mdocml/pkg/PLIST
199 echo @man man/man1/mandoc.1 >> .dist/mdocml/pkg/PLIST
200 echo @man man/man7/mdoc.7 >> .dist/mdocml/pkg/PLIST
201 ( cd .dist/ && tar zcf ../$@ mdocml/ )
204 mdocml-fport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.freebsd DESCR
205 mkdir -p .dist/mdocml
206 sed -e "s!@VERSION@!$(VERSION)!" Makefile.freebsd > \
207 .dist/mdocml/Makefile
208 ( md5 mdocml-$(VERSION).tar.gz; \
209 cksum -a SHA256 mdocml-$(VERSION).tar.gz; \
210 echo -n "SIZE (mdocml-$(VERSION).tar.gz) = "; \
211 ls -l mdocml-$(VERSION).tar.gz | awk '{print $$5}' \
212 ) > .dist/mdocml/distinfo
213 install -m 0644 DESCR .dist/mdocml/pkg-descr
214 ( echo; echo "WWW: http://mdocml.bsd.lv/") >> .dist/mdocml/pkg-descr
215 ( cd .dist/ && tar zcf ../$@ mdocml/ )
218 mdocml-$(VERSION).tar.gz: $(INSTALL)
219 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
220 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
221 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
224 llib-llibmdoc.ln: $(MDOCLNS)
225 $(LINT) $(LINTFLAGS) -Clibmdoc $(MDOCLNS)
227 llib-llibman.ln: $(MANLNS)
228 $(LINT) $(LINTFLAGS) -Clibman $(MANLNS)
230 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
231 $(LINT) $(LINTFLAGS) -Cmandoc $(MAINLNS) llib-llibmdoc.ln
233 libmdoc.a: $(MDOCOBJS)
234 $(AR) rs $@ $(MDOCOBJS)
237 $(AR) rs $@ $(MANOBJS)
239 mandoc: $(MAINOBJS) libmdoc.a libman.a
240 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a
244 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@