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 strings.ln xstd.ln \
21 argv.ln validate.ln action.ln lib.ln att.ln arch.ln \
23 MDOCOBJS = mdoc_macro.o mdoc.o mdoc_hash.o strings.o xstd.o argv.o \
24 validate.o action.o lib.o att.o arch.o vol.o msec.o st.o
25 MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c strings.c xstd.c argv.c \
26 validate.c action.c lib.c att.c arch.c vol.c msec.c st.c
28 MANLNS = man_macro.ln man.ln man_hash.ln
29 MANOBJS = man_macro.o man.o man_hash.o
30 MANSRCS = man_macro.c man.c man_hash.c
32 MAINLNS = main.ln term.ln ascii.ln terminal.ln tree.ln compat.ln
33 MAINOBJS = main.o term.o ascii.o terminal.o tree.o compat.o
34 MAINSRCS = main.c term.c ascii.c terminal.c tree.c compat.c
36 LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln
37 LNS = $(MAINLNS) $(MDOCLNS)
38 LIBS = libmdoc.a libman.a
39 OBJS = $(MDOCOBJS) $(MAINOBJS)
40 SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS)
41 DATAS = arch.in att.in lib.in msec.in st.in vol.in ascii.in
42 HEADS = mdoc.h libmdoc.h man.h libman.h term.h
45 STATICS = style.css external.png
46 TARGZS = mdocml-$(VERSION).tar.gz \
47 mdocml-oport-$(VERSION).tar.gz \
48 mdocml-fport-$(VERSION).tar.gz \
49 mdocml-nport-$(VERSION).tar.gz
50 MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7
52 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) $(TARGZS)
53 INSTALL = $(SRCS) $(HEADS) Makefile DESCR $(MANS) $(SGMLS) \
54 $(STATICS) Makefile.netbsd Makefile.openbsd $(DATAS)
66 dist: mdocml-$(VERSION).tar.gz
68 port: mdocml-oport-$(VERSION).tar.gz \
69 mdocml-fport-$(VERSION).tar.gz \
70 mdocml-nport-$(VERSION).tar.gz
72 www: $(HTMLS) $(TARGZS)
75 install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
76 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
77 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
78 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
79 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
80 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
81 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
82 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/
83 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/mdocml.tar.gz
87 mkdir -p $(MANDIR)/man1
88 mkdir -p $(MANDIR)/man7
89 $(INSTALL_PROGRAM) mandoc $(BINDIR)
90 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
91 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
94 rm -f $(BINDIR)/mandoc
95 rm -f $(MANDIR)/man1/mandoc.1
96 rm -f $(MANDIR)/man7/mdoc.7
98 man_macro.ln: man_macro.c libman.h
99 man_macro.o: man_macro.c libman.h
101 lib.ln: lib.c lib.in libmdoc.h
102 lib.o: lib.c lib.in libmdoc.h
104 att.ln: att.c att.in libmdoc.h
105 att.o: att.c att.in libmdoc.h
107 arch.ln: arch.c arch.in libmdoc.h
108 arch.o: arch.c arch.in libmdoc.h
110 vol.ln: vol.c vol.in libmdoc.h
111 vol.o: vol.c vol.in libmdoc.h
113 ascii.ln: ascii.c ascii.in term.h
114 ascii.o: ascii.c ascii.in term.h
116 msec.ln: msec.c msec.in libmdoc.h
117 msec.o: msec.c msec.in libmdoc.h
119 st.ln: st.c st.in libmdoc.h
120 st.o: st.c st.in libmdoc.h
122 mdoc_macro.ln: mdoc_macro.c libmdoc.h
123 mdoc_macro.o: mdoc_macro.c libmdoc.h
125 term.ln: term.c term.h
126 term.o: term.c term.h
128 strings.ln: strings.c libmdoc.h
129 strings.o: strings.c libmdoc.h
131 man_hash.ln: man_hash.c libman.h
132 man_hash.o: man_hash.c libman.h
134 mdoc_hash.ln: mdoc_hash.c libmdoc.h
135 mdoc_hash.o: mdoc_hash.c libmdoc.h
137 mdoc.ln: mdoc.c libmdoc.h
138 mdoc.o: mdoc.c libmdoc.h
140 man.ln: man.c libman.h
141 man.o: man.c libman.h
143 main.ln: main.c mdoc.h
144 main.o: main.c mdoc.h
146 terminal.ln: terminal.c term.h
147 terminal.o: terminal.c term.h
149 xstd.ln: xstd.c libmdoc.h
150 xstd.o: xstd.c libmdoc.h
152 argv.ln: argv.c libmdoc.h
153 argv.o: argv.c libmdoc.h
155 validate.ln: validate.c libmdoc.h
156 validate.o: validate.c libmdoc.h
158 action.ln: action.c libmdoc.h
159 action.o: action.c libmdoc.h
165 mdocml-nport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.netbsd DESCR
166 mkdir -p .dist/mdocml/
167 sed -e "s!@VERSION@!$(VERSION)!" Makefile.netbsd > \
168 .dist/mdocml/Makefile
169 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
170 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
171 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
172 install -m 0644 DESCR .dist/mdocml/
173 echo @comment $$NetBSD$$ > .dist/mdocml/PLIST
174 echo bin/mandoc >> .dist/mdocml/PLIST
175 echo man/man1/mandoc.1 >> .dist/mdocml/PLIST
176 echo man/man7/mdoc.7 >> .dist/mdocml/PLIST
177 ( cd .dist/ && tar zcf ../$@ mdocml/ )
180 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
181 mkdir -p .dist/mdocml/pkg
182 sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
183 .dist/mdocml/Makefile
184 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
185 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
186 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
187 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
188 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
189 echo bin/mandoc >> .dist/mdocml/pkg/PLIST
190 echo @man man/man1/mandoc.1 >> .dist/mdocml/pkg/PLIST
191 echo @man man/man7/mdoc.7 >> .dist/mdocml/pkg/PLIST
192 ( cd .dist/ && tar zcf ../$@ mdocml/ )
195 mdocml-fport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.freebsd DESCR
196 mkdir -p .dist/mdocml
197 sed -e "s!@VERSION@!$(VERSION)!" Makefile.freebsd > \
198 .dist/mdocml/Makefile
199 ( md5 mdocml-$(VERSION).tar.gz; \
200 sha1 mdocml-$(VERSION).tar.gz; \
201 echo -n "SIZE (mdocml-$(VERSION).tar.gz) = "; \
202 ls -l mdocml-$(VERSION).tar.gz | awk '{print $$5}' \
203 ) > .dist/mdocml/distinfo
204 install -m 0644 DESCR .dist/mdocml/pkg-descr
205 ( echo; echo "WWW: http://mdocml.bsd.lv/") >> .dist/mdocml/pkg-descr
206 ( cd .dist/ && tar zcf ../$@ mdocml/ )
209 mdocml-$(VERSION).tar.gz: $(INSTALL)
210 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
211 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
212 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
215 llib-llibmdoc.ln: $(MDOCLNS)
216 $(LINT) $(LINTFLAGS) -Clibmdoc $(MDOCLNS)
218 llib-llibman.ln: $(MANLNS)
219 $(LINT) $(LINTFLAGS) -Clibman $(MANLNS)
221 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
222 $(LINT) $(LINTFLAGS) -Cmandoc $(MAINLNS) llib-llibmdoc.ln
224 libmdoc.a: $(MDOCOBJS)
225 $(AR) rs $@ $(MDOCOBJS)
228 $(AR) rs $@ $(MANOBJS)
230 mandoc: $(MAINOBJS) libmdoc.a libman.a
231 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a
235 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@