3 CFLAGS += -W -Wall -Wno-unused-parameter -g
5 LIBLNS = macro.ln mdoc.ln hash.ln strings.ln xstd.ln argv.ln \
8 BINLNS = tree.ln mdocml.ln
10 LNS = $(LIBLNS) $(BINLNS)
12 LLNS = llib-llibmdoc.ln llib-lmdocml.ln
16 LIBOBJS = macro.o mdoc.o hash.o strings.o xstd.o argv.o \
19 BINOBJS = tree.o mdocml.o
21 OBJS = $(LIBOBJS) $(BINOBJS)
23 SRCS = macro.c mdoc.c mdocml.c hash.c strings.c xstd.c argv.c \
24 validate.c action.c tree.c
26 HEADS = mdoc.h private.h
28 MANS = mdocml.1 mdoc.3
32 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS)
34 INSTALL = $(SRCS) $(HEADS) Makefile Makefile.port DESCR $(MANS)
36 FAIL = regress/test.empty \
37 regress/test.prologue.00 \
38 regress/test.prologue.01 \
39 regress/test.prologue.02 \
40 regress/test.prologue.03 \
41 regress/test.prologue.04 \
42 regress/test.prologue.06 \
43 regress/test.prologue.13 \
44 regress/test.prologue.15 \
45 regress/test.prologue.16 \
46 regress/test.prologue.18 \
47 regress/test.prologue.19 \
48 regress/test.prologue.21 \
49 regress/test.prologue.22 \
50 regress/test.prologue.23 \
51 regress/test.prologue.24 \
52 regress/test.prologue.25 \
53 regress/test.prologue.26 \
54 regress/test.prologue.27 \
55 regress/test.prologue.28 \
56 regress/test.prologue.29 \
57 regress/test.prologue.30 \
58 regress/test.prologue.31 \
59 regress/test.prologue.32 \
60 regress/test.prologue.33 \
64 regress/test.name.01 \
65 regress/test.name.02 \
68 SUCCEED = regress/test.prologue.05 \
69 regress/test.prologue.07 \
70 regress/test.prologue.08 \
71 regress/test.prologue.09 \
72 regress/test.prologue.10 \
73 regress/test.prologue.11 \
74 regress/test.prologue.12 \
75 regress/test.prologue.14 \
76 regress/test.prologue.17 \
77 regress/test.prologue.20 \
79 regress/test.name.00 \
80 regress/test.list.00 \
81 regress/test.list.01 \
82 regress/test.list.02 \
83 regress/test.list.03 \
93 dist: mdocml-$(VERSION).tar.gz
95 port: mdocml-oport-$(VERSION).tar.gz
98 @for f in $(FAIL); do \
99 echo "./mdocml $$f" ; \
100 ./mdocml $$f 2>/dev/null || continue ; exit 1 ; done
101 @for f in $(SUCCEED); do \
102 echo "./mdocml $$f" ; \
103 ./mdocml $$f 2>/dev/null || exit 1 ; done
106 mkdir -p $(PREFIX)/bin/
107 mkdir -p $(PREFIX)/include/mdoc/
108 mkdir -p $(PREFIX)/lib/
109 mkdir -p $(PREFIX)/man/man1/
110 install -m 0755 mdocml $(PREFIX)/bin/
111 install -m 0444 mdocml.1 $(PREFIX)/man/man1/
112 install -m 0444 mdoc.3 $(PREFIX)/man/man3/
113 install -m 0644 libmdoc.a $(PREFIX)/lib/
114 install -m 0444 mdoc.h $(PREFIX)/include/
116 install-dist: mdocml-$(VERSION).tar.gz mdocml-oport-$(VERSION).tar.gz
117 install -m 0644 mdocml-$(VERSION).tar.gz $(PREFIX)/
118 install -m 0644 mdocml-$(VERSION).tar.gz $(PREFIX)/mdocml.tar.gz
119 install -m 0644 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/
120 install -m 0644 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/mdocml-oport.tar.gz
123 rm -f $(PREFIX)/bin/mdocml
124 rm -f $(PREFIX)/man/man1/mdocml.1
125 rm -f $(PREFIX)/man/man3/mdoc.3
126 rm -f $(PREFIX)/lib/libmdoc.a
127 rm -f $(PREFIX)/include/mdoc.h
129 macro.ln: macro.c private.h
131 macro.o: macro.c private.h
133 strings.ln: strings.c private.h
135 strings.o: strings.c private.h
137 tree.ln: tree.c mdoc.h
139 tree.o: tree.c mdoc.h
141 hash.ln: hash.c private.h
143 hash.o: hash.c private.h
145 mdoc.ln: mdoc.c private.h
147 mdoc.o: mdoc.c private.h
149 mdocml.ln: mdocml.c mdoc.h
151 mdocml.o: mdocml.c mdoc.h
153 xstd.ln: xstd.c private.h
155 xstd.o: xstd.c private.h
157 argv.ln: argv.c private.h
159 argv.o: argv.c private.h
161 validate.ln: validate.c private.h
163 validate.o: validate.c private.h
165 action.ln: action.c private.h
167 action.o: action.c private.h
171 mdocml-oport-$(VERSION).tar.gz: Makefile.port DESCR
172 mkdir -p .dist/mdocml/pkg
173 sed -e "s!@VERSION@!$(VERSION)!" Makefile.port > .dist/mdocml/Makefile
174 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
175 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
176 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
177 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
178 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
179 echo bin/mdocml >> .dist/mdocml/pkg/PLIST
180 echo lib/libmdoc.a >> .dist/mdocml/pkg/PLIST
181 echo include/mdoc.h >> .dist/mdocml/pkg/PLIST
182 echo @man man/man1/mdocml.1 >> .dist/mdocml/pkg/PLIST
183 echo @man man/man3/mdoc.3 >> .dist/mdocml/pkg/PLIST
184 ( cd .dist/ && tar zcf ../$@ mdocml/ )
187 mdocml-$(VERSION).tar.gz: $(INSTALL)
188 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
189 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
190 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
193 llib-llibmdoc.ln: $(LIBLNS)
194 $(LINT) $(LINTFLAGS) -Clibmdoc $(LIBLNS)
196 llib-lmdocml.ln: $(BINLNS) llib-llibmdoc.ln
197 $(LINT) $(LINTFLAGS) -Cmdocml $(BINLNS) llib-llibmdoc.ln
199 libmdoc.a: $(LIBOBJS)
200 $(AR) rs $@ $(LIBOBJS)
202 mdocml: $(BINOBJS) libmdoc.a
203 $(CC) $(CFLAGS) -o $@ $(BINOBJS) libmdoc.a