]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
Version up.
[mandoc.git] / Makefile
1 .SUFFIXES: .html .sgml .1.txt .3.txt .7.txt .1 .3 .7 .md5 .tar.gz
2
3 BINDIR = $(PREFIX)/bin
4 INCLUDEDIR = $(PREFIX)/include
5 LIBDIR = $(PREFIX)/lib
6 MANDIR = $(PREFIX)/man
7 INSTALL_PROGRAM = install -m 0755
8 INSTALL_DATA = install -m 0444
9 INSTALL_LIB = install -m 0644
10 INSTALL_MAN = $(INSTALL_DATA)
11
12 VERSION = 1.7.21
13 VDATE = 4 July 2009
14
15 VFLAGS = -DVERSION=\"$(VERSION)\"
16 CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -g
17 CFLAGS += $(VFLAGS)
18 LINTFLAGS += $(VFLAGS)
19
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 mandoc.ln
24 MDOCOBJS = mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \
25 mdoc_argv.o mdoc_validate.o mdoc_action.o lib.o att.o \
26 arch.o vol.o msec.o st.o mandoc.o
27 MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \
28 mdoc_argv.c mdoc_validate.c mdoc_action.c lib.c att.c \
29 arch.c vol.c msec.c st.c mandoc.c
30
31 MANLNS = man_macro.ln man.ln man_hash.ln man_validate.ln \
32 man_action.ln mandoc.ln
33 MANOBJS = man_macro.o man.o man_hash.o man_validate.o \
34 man_action.o mandoc.o
35 MANSRCS = man_macro.c man.c man_hash.c man_validate.c \
36 man_action.c mandoc.c
37
38 MAINLNS = main.ln mdoc_term.ln ascii.ln term.ln tree.ln \
39 compat.ln man_term.ln
40 MAINOBJS = main.o mdoc_term.o ascii.o term.o tree.o compat.o \
41 man_term.o
42 MAINSRCS = main.c mdoc_term.c ascii.c term.c tree.c compat.c \
43 man_term.c
44
45 LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln
46 LNS = $(MAINLNS) $(MDOCLNS) $(MANLNS)
47 LIBS = libmdoc.a libman.a
48 OBJS = $(MDOCOBJS) $(MAINOBJS) $(MANOBJS)
49 SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS)
50 DATAS = arch.in att.in lib.in msec.in st.in vol.in ascii.in
51 HEADS = mdoc.h libmdoc.h man.h libman.h term.h libmandoc.h
52 SGMLS = index.sgml
53 HTMLS = index.html
54 STATICS = style.css external.png
55 MD5S = mdocml-$(VERSION).md5 \
56 mdocml-oport-$(VERSION).md5 \
57 mdocml-fport-$(VERSION).md5 \
58 mdocml-nport-$(VERSION).md5
59 TARGZS = mdocml-$(VERSION).tar.gz \
60 mdocml-oport-$(VERSION).tar.gz \
61 mdocml-fport-$(VERSION).tar.gz \
62 mdocml-nport-$(VERSION).tar.gz
63 MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
64 man.7 man.3
65 TEXTS = mandoc.1.txt mdoc.3.txt mdoc.7.txt manuals.7.txt \
66 mandoc_char.7.txt man.7.txt man.3.txt
67 BINS = mandoc
68 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
69 $(TARGZS) tags $(TEXTS) ChangeLog $(MD5S)
70 MAKEFILES = Makefile.netbsd Makefile.openbsd Makefile.freebsd \
71 Makefile
72 INSTALL = $(SRCS) $(HEADS) $(MAKEFILES) DESCR $(MANS) $(SGMLS) \
73 $(STATICS) $(DATAS)
74
75 all: $(BINS)
76
77 lint: $(LLNS)
78
79 clean:
80 rm -f $(CLEAN)
81
82 cleanlint:
83 rm -f $(LNS) $(LLNS)
84
85 dist: mdocml-$(VERSION).tar.gz
86
87 html: $(HTMLS)
88
89 www: all $(HTMLS) $(MD5S) $(TARGZS) $(TEXTS) ChangeLog
90
91 installwww: www
92 install -m 0444 $(TEXTS) $(HTMLS) $(STATICS) $(PREFIX)/
93 install -m 0444 ChangeLog $(PREFIX)/snapshots/
94 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
95 install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/
96 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
97 install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/mdocml.md5
98 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
99 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
100 install -m 0444 mdocml-oport-$(VERSION).md5 $(PREFIX)/ports-openbsd/
101 install -m 0444 mdocml-oport-$(VERSION).md5 $(PREFIX)/ports-openbsd/mdocml.md5
102 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
103 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
104 install -m 0444 mdocml-nport-$(VERSION).md5 $(PREFIX)/ports-netbsd/
105 install -m 0444 mdocml-nport-$(VERSION).md5 $(PREFIX)/ports-netbsd/mdocml.md5
106 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/
107 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/mdocml.tar.gz
108 install -m 0444 mdocml-fport-$(VERSION).md5 $(PREFIX)/ports-freebsd/
109 install -m 0444 mdocml-fport-$(VERSION).md5 $(PREFIX)/ports-freebsd/mdocml.md5
110
111 install:
112 mkdir -p $(BINDIR)
113 mkdir -p $(MANDIR)/man1
114 mkdir -p $(MANDIR)/man7
115 $(INSTALL_PROGRAM) mandoc $(BINDIR)
116 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
117 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
118
119 uninstall:
120 rm -f $(BINDIR)/mandoc
121 rm -f $(MANDIR)/man1/mandoc.1
122 rm -f $(MANDIR)/man7/mdoc.7
123
124 man_macro.ln: man_macro.c libman.h
125 man_macro.o: man_macro.c libman.h
126
127 lib.ln: lib.c lib.in libmdoc.h
128 lib.o: lib.c lib.in libmdoc.h
129
130 att.ln: att.c att.in libmdoc.h
131 att.o: att.c att.in libmdoc.h
132
133 arch.ln: arch.c arch.in libmdoc.h
134 arch.o: arch.c arch.in libmdoc.h
135
136 vol.ln: vol.c vol.in libmdoc.h
137 vol.o: vol.c vol.in libmdoc.h
138
139 ascii.ln: ascii.c ascii.in term.h
140 ascii.o: ascii.c ascii.in term.h
141
142 msec.ln: msec.c msec.in libmdoc.h
143 msec.o: msec.c msec.in libmdoc.h
144
145 st.ln: st.c st.in libmdoc.h
146 st.o: st.c st.in libmdoc.h
147
148 mdoc_macro.ln: mdoc_macro.c libmdoc.h
149 mdoc_macro.o: mdoc_macro.c libmdoc.h
150
151 mdoc_term.ln: mdoc_term.c term.h mdoc.h
152 mdoc_term.o: mdoc_term.c term.h mdoc.h
153
154 mdoc_strings.ln: mdoc_strings.c libmdoc.h
155 mdoc_strings.o: mdoc_strings.c libmdoc.h
156
157 man_hash.ln: man_hash.c libman.h
158 man_hash.o: man_hash.c libman.h
159
160 mdoc_hash.ln: mdoc_hash.c libmdoc.h
161 mdoc_hash.o: mdoc_hash.c libmdoc.h
162
163 mdoc.ln: mdoc.c libmdoc.h
164 mdoc.o: mdoc.c libmdoc.h
165
166 man.ln: man.c libman.h
167 man.o: man.c libman.h
168
169 main.ln: main.c mdoc.h
170 main.o: main.c mdoc.h
171
172 compat.ln: compat.c
173 compat.o: compat.c
174
175 term.ln: term.c term.h man.h mdoc.h
176 term.o: term.c term.h man.h mdoc.h
177
178 mdoc_argv.ln: mdoc_argv.c libmdoc.h
179 mdoc_argv.o: mdoc_argv.c libmdoc.h
180
181 man_validate.ln: man_validate.c libman.h
182 man_validate.o: man_validate.c libman.h
183
184 mdoc_validate.ln: mdoc_validate.c libmdoc.h
185 mdoc_validate.o: mdoc_validate.c libmdoc.h
186
187 mdoc_action.ln: mdoc_action.c libmdoc.h
188 mdoc_action.o: mdoc_action.c libmdoc.h
189
190 libmdoc.h: mdoc.h
191
192 ChangeLog::
193 cvs2cl -P -t --no-indent --FSF --no-times
194
195 mdocml-nport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.netbsd DESCR
196 mkdir -p .dist/mdocml/
197 sed -e "s!@VERSION@!$(VERSION)!" Makefile.netbsd > \
198 .dist/mdocml/Makefile
199 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
200 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
201 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
202 install -m 0644 DESCR .dist/mdocml/
203 echo @comment $$NetBSD$$ > .dist/mdocml/PLIST
204 echo bin/mandoc >> .dist/mdocml/PLIST
205 echo man/man1/mandoc.1 >> .dist/mdocml/PLIST
206 echo man/man7/mdoc.7 >> .dist/mdocml/PLIST
207 ( cd .dist/ && tar zcf ../$@ mdocml/ )
208 rm -rf .dist/
209
210 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
211 mkdir -p .dist/mdocml/pkg
212 sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
213 .dist/mdocml/Makefile
214 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
215 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
216 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
217 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
218 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
219 echo bin/mandoc >> .dist/mdocml/pkg/PLIST
220 echo @man man/man1/mandoc.1 >> .dist/mdocml/pkg/PLIST
221 echo @man man/man7/mdoc.7 >> .dist/mdocml/pkg/PLIST
222 ( cd .dist/ && tar zcf ../$@ mdocml/ )
223 rm -rf .dist/
224
225 mdocml-fport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.freebsd DESCR
226 mkdir -p .dist/mdocml
227 sed -e "s!@VERSION@!$(VERSION)!" Makefile.freebsd > \
228 .dist/mdocml/Makefile
229 ( md5 mdocml-$(VERSION).tar.gz; \
230 cksum -a SHA256 mdocml-$(VERSION).tar.gz; \
231 echo -n "SIZE (mdocml-$(VERSION).tar.gz) = "; \
232 ls -l mdocml-$(VERSION).tar.gz | awk '{print $$5}' \
233 ) > .dist/mdocml/distinfo
234 install -m 0644 DESCR .dist/mdocml/pkg-descr
235 ( echo; echo "WWW: http://mdocml.bsd.lv/") >> .dist/mdocml/pkg-descr
236 ( cd .dist/ && tar zcf ../$@ mdocml/ )
237 rm -rf .dist/
238
239 mdocml-$(VERSION).tar.gz: $(INSTALL)
240 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
241 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
242 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
243 rm -rf .dist/
244
245 llib-llibmdoc.ln: $(MDOCLNS)
246 $(LINT) -Clibmdoc $(MDOCLNS)
247
248 llib-llibman.ln: $(MANLNS)
249 $(LINT) -Clibman $(MANLNS)
250
251 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
252 $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln
253
254 libmdoc.a: $(MDOCOBJS)
255 $(AR) rs $@ $(MDOCOBJS)
256
257 libman.a: $(MANOBJS)
258 $(AR) rs $@ $(MANOBJS)
259
260 mandoc: $(MAINOBJS) libmdoc.a libman.a
261 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a
262
263 .sgml.html:
264 validate $<
265 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
266
267 .1.1.txt:
268 ./mandoc -Wall,error -fstrict $< | col -b > $@
269
270 .3.3.txt:
271 ./mandoc -Wall,error -fstrict $< | col -b > $@
272
273 .7.7.txt:
274 ./mandoc -Wall,error -fstrict $< | col -b > $@
275
276 .tar.gz.md5:
277 md5 $< > $@