5 CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -g
7 LIBLNS = macro.ln mdoc.ln hash.ln strings.ln xstd.ln argv.ln \
10 TREELNS = mdoctree.ln mmain.ln
12 TERMLNS = mdoctree.ln mmain.ln term.ln
14 LINTLNS = mdoclint.ln mmain.ln
16 LNS = $(LIBLNS) $(TREELNS) $(TERMLNS)
18 LLNS = llib-llibmdoc.ln llib-lmdoctree.ln llib-lmdocterm.ln
22 LIBOBJS = macro.o mdoc.o hash.o strings.o xstd.o argv.o \
25 TERMOBJS= mdocterm.o mmain.o term.o
27 TREEOBJS= mdoctree.o mmain.o
29 LINTOBJS= mdoclint.o mmain.o
31 OBJS = $(LIBOBJS) $(TERMOBJS) $(TREEOBJS)
33 SRCS = macro.c mdoc.c hash.c strings.c xstd.c argv.c validate.c \
34 action.c term.c mdoctree.c mdocterm.c mmain.c mdoclint.c
36 HEADS = mdoc.h private.h term.h mmain.h
42 STATICS = style.css external.png
44 TARGZS = mdocml-$(VERSION).tar.gz mdocml-oport-$(VERSION).tar.gz
46 MANS = mdoctree.1 mdocterm.1 mdoclint.1 mdoc.3
48 BINS = mdocterm mdoctree mdoclint
50 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
53 INSTALL = $(SRCS) $(HEADS) Makefile Makefile.port DESCR $(MANS) \
56 FAIL = regress/test.empty \
57 regress/test.prologue.00 \
58 regress/test.prologue.01 \
59 regress/test.prologue.02 \
60 regress/test.prologue.03 \
61 regress/test.prologue.04 \
62 regress/test.prologue.06 \
63 regress/test.prologue.13 \
64 regress/test.prologue.15 \
65 regress/test.prologue.16 \
66 regress/test.prologue.18 \
67 regress/test.prologue.19 \
68 regress/test.prologue.21 \
69 regress/test.prologue.22 \
70 regress/test.prologue.23 \
71 regress/test.prologue.24 \
72 regress/test.prologue.25 \
73 regress/test.prologue.26 \
74 regress/test.prologue.27 \
75 regress/test.prologue.28 \
76 regress/test.prologue.29 \
77 regress/test.prologue.30 \
78 regress/test.prologue.31 \
79 regress/test.prologue.32 \
80 regress/test.prologue.33 \
82 regress/test.escape.01 \
83 regress/test.escape.02 \
84 regress/test.escape.03 \
85 regress/test.escape.04 \
86 regress/test.escape.06 \
87 regress/test.escape.07 \
88 regress/test.escape.08 \
89 regress/test.escape.09
91 SUCCEED = regress/test.prologue.05 \
92 regress/test.prologue.07 \
93 regress/test.prologue.08 \
94 regress/test.prologue.09 \
95 regress/test.prologue.10 \
96 regress/test.prologue.11 \
97 regress/test.prologue.12 \
98 regress/test.prologue.14 \
99 regress/test.prologue.17 \
100 regress/test.prologue.20 \
102 regress/test.name.00 \
103 regress/test.name.01 \
104 regress/test.name.02 \
105 regress/test.name.03 \
106 regress/test.list.00 \
107 regress/test.list.01 \
108 regress/test.list.02 \
109 regress/test.list.03 \
110 regress/test.list.04 \
111 regress/test.list.05 \
112 regress/test.list.06 \
115 regress/test.escape.00 \
116 regress/test.escape.05
118 REGRESS = $(FAIL) $(SUCCEED)
127 dist: mdocml-$(VERSION).tar.gz
129 port: mdocml-oport-$(VERSION).tar.gz
131 www: $(HTMLS) $(TARGZS)
134 install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
135 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
136 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
137 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
138 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
141 @for f in $(FAIL); do \
142 echo "./mdoclint $$f" ; \
143 ./mdoclint $$f 2>/dev/null || continue ; exit 1 ; done
144 @for f in $(SUCCEED); do \
145 echo "./mdoclint $$f" ; \
146 ./mdoclint $$f 2>/dev/null || exit 1 ; done
149 mkdir -p $(PREFIX)/bin/
150 mkdir -p $(PREFIX)/include/mdoc/
151 mkdir -p $(PREFIX)/lib/
152 mkdir -p $(PREFIX)/man/man1/
153 install -m 0755 mdocterm $(PREFIX)/bin/
154 install -m 0755 mdoctree $(PREFIX)/bin/
155 install -m 0755 mdoclint $(PREFIX)/bin/
156 install -m 0444 mdocterm.1 $(PREFIX)/man/man1/
157 install -m 0444 mdoctree.1 $(PREFIX)/man/man1/
158 install -m 0444 mdoclint.1 $(PREFIX)/man/man1/
159 install -m 0444 mdoc.3 $(PREFIX)/man/man3/
160 install -m 0644 libmdoc.a $(PREFIX)/lib/
161 install -m 0444 mdoc.h $(PREFIX)/include/
164 rm -f $(PREFIX)/bin/mdocterm
165 rm -f $(PREFIX)/bin/mdoctree
166 rm -f $(PREFIX)/bin/mdoclint
167 rm -f $(PREFIX)/man/man1/mdocterm.1
168 rm -f $(PREFIX)/man/man1/mdoctree.1
169 rm -f $(PREFIX)/man/man1/mdoclint.1
170 rm -f $(PREFIX)/man/man3/mdoc.3
171 rm -f $(PREFIX)/lib/libmdoc.a
172 rm -f $(PREFIX)/include/mdoc.h
174 macro.ln: macro.c private.h
175 macro.o: macro.c private.h
177 term.ln: term.c term.h
178 term.o: term.c term.h
180 strings.ln: strings.c private.h
181 strings.o: strings.c private.h
183 hash.ln: hash.c private.h
184 hash.o: hash.c private.h
186 mdoc.ln: mdoc.c private.h
187 mdoc.o: mdoc.c private.h
189 mdocterm.ln: mdocterm.c mmain.h
190 mdocterm.o: mdocterm.c mmain.h
192 mdoclint.ln: mdoclint.c mmain.h
193 mdoclint.o: mdoclint.c mmain.h
195 mdoctree.ln: mdoctree.c mmain.h
196 mdoctree.o: mdoctree.c mmain.h
198 xstd.ln: xstd.c private.h
199 xstd.o: xstd.c private.h
201 argv.ln: argv.c private.h
202 argv.o: argv.c private.h
204 validate.ln: validate.c private.h
205 validate.o: validate.c private.h
207 action.ln: action.c private.h
208 action.o: action.c private.h
210 mmain.ln: mmain.c mmain.h
211 mmain.o: mmain.c mmain.h
219 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.port DESCR
220 mkdir -p .dist/mdocml/pkg
221 sed -e "s!@VERSION@!$(VERSION)!" Makefile.port > \
222 .dist/mdocml/Makefile
223 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
224 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
225 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
226 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
227 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
228 echo bin/mdocterm >> .dist/mdocml/pkg/PLIST
229 echo bin/mdoctree >> .dist/mdocml/pkg/PLIST
230 echo bin/mdoclint >> .dist/mdocml/pkg/PLIST
231 echo lib/libmdoc.a >> .dist/mdocml/pkg/PLIST
232 echo include/mdoc.h >> .dist/mdocml/pkg/PLIST
233 echo @man man/man1/mdoctree.1 >> .dist/mdocml/pkg/PLIST
234 echo @man man/man1/mdocterm.1 >> .dist/mdocml/pkg/PLIST
235 echo @man man/man1/mdoclint.1 >> .dist/mdocml/pkg/PLIST
236 echo @man man/man3/mdoc.3 >> .dist/mdocml/pkg/PLIST
237 ( cd .dist/ && tar zcf ../$@ mdocml/ )
240 mdocml-$(VERSION).tar.gz: $(INSTALL)
241 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
242 mkdir -p .dist/mdocml/mdocml-$(VERSION)/regress/
243 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
244 install -m 0644 $(REGRESS) .dist/mdocml/mdocml-$(VERSION)/regress/
245 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
248 llib-llibmdoc.ln: $(LIBLNS)
249 $(LINT) $(LINTFLAGS) -Clibmdoc $(LIBLNS)
251 llib-lmdoctree.ln: $(TREELNS) llib-llibmdoc.ln
252 $(LINT) $(LINTFLAGS) -Cmdoctree $(TREELNS) llib-llibmdoc.ln
254 llib-lmdocterm.ln: $(TERMLNS) llib-llibmdoc.ln
255 $(LINT) $(LINTFLAGS) -Cmdocterm $(TERMLNS) llib-llibmdoc.ln
257 libmdoc.a: $(LIBOBJS)
258 $(AR) rs $@ $(LIBOBJS)
260 mdocterm: $(TERMOBJS) libmdoc.a
261 $(CC) $(CFLAGS) -o $@ $(TERMOBJS) libmdoc.a
263 mdoctree: $(TREEOBJS) libmdoc.a
264 $(CC) $(CFLAGS) -o $@ $(TREEOBJS) libmdoc.a
266 mdoclint: $(LINTOBJS) libmdoc.a
267 $(CC) $(CFLAGS) -o $@ $(LINTOBJS) libmdoc.a