]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
Version: 1.9.5.
[mandoc.git] / Makefile
1 .SUFFIXES: .html .xml .sgml .1 .3 .7 .md5 .tar.gz .1.html .3.html .7.html
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.9.5
13 VDATE = 21 September 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 man_argv.ln
33 MANOBJS = man_macro.o man.o man_hash.o man_validate.o \
34 man_action.o mandoc.o man_argv.o
35 MANSRCS = man_macro.c man.c man_hash.c man_validate.c \
36 man_action.c mandoc.c man_argv.c
37
38 MAINLNS = main.ln mdoc_term.ln chars.ln term.ln tree.ln \
39 compat.ln man_term.ln html.ln mdoc_html.ln \
40 man_html.ln
41 MAINOBJS = main.o mdoc_term.o chars.o term.o tree.o compat.o \
42 man_term.o html.o mdoc_html.o man_html.o
43 MAINSRCS = main.c mdoc_term.c chars.c term.c tree.c compat.c \
44 man_term.c html.c mdoc_html.c man_html.c
45
46 LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln
47 LNS = $(MAINLNS) $(MDOCLNS) $(MANLNS)
48 LIBS = libmdoc.a libman.a
49 OBJS = $(MDOCOBJS) $(MAINOBJS) $(MANOBJS)
50 SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS)
51 DATAS = arch.in att.in lib.in msec.in st.in vol.in chars.in
52 HEADS = mdoc.h libmdoc.h man.h libman.h term.h libmandoc.h
53 SGMLS = index.sgml
54 XSLS = ChangeLog.xsl
55 HTMLS = index.html ChangeLog.html mandoc.1.html mdoc.3.html \
56 man.3.html mdoc.7.html man.7.html mandoc_char.7.html \
57 manuals.7.html
58 XMLS = ChangeLog.xml
59 STATICS = index.css style.css external.png
60 MD5S = mdocml-$(VERSION).md5
61 TARGZS = mdocml-$(VERSION).tar.gz
62 MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
63 man.7 man.3
64 BINS = mandoc
65 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
66 $(TARGZS) tags $(MD5S) $(XMLS)
67 INSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
68 $(DATAS) $(XSLS)
69
70 all: $(BINS)
71
72 lint: $(LLNS)
73
74 clean:
75 rm -f $(CLEAN)
76
77 cleanlint:
78 rm -f $(LNS) $(LLNS)
79
80 dist: mdocml-$(VERSION).tar.gz
81
82 www: all $(HTMLS) $(MD5S) $(TARGZS)
83
84 installwww: www
85 install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
86 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
87 install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/
88 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
89 install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/mdocml.md5
90
91 install:
92 mkdir -p $(BINDIR)
93 mkdir -p $(MANDIR)/man1
94 mkdir -p $(MANDIR)/man7
95 $(INSTALL_PROGRAM) mandoc $(BINDIR)
96 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
97 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
98
99 uninstall:
100 rm -f $(BINDIR)/mandoc
101 rm -f $(MANDIR)/man1/mandoc.1
102 rm -f $(MANDIR)/man7/mdoc.7
103
104 man_macro.ln: man_macro.c libman.h
105 man_macro.o: man_macro.c libman.h
106
107 lib.ln: lib.c lib.in libmdoc.h
108 lib.o: lib.c lib.in libmdoc.h
109
110 att.ln: att.c att.in libmdoc.h
111 att.o: att.c att.in libmdoc.h
112
113 arch.ln: arch.c arch.in libmdoc.h
114 arch.o: arch.c arch.in libmdoc.h
115
116 vol.ln: vol.c vol.in libmdoc.h
117 vol.o: vol.c vol.in libmdoc.h
118
119 chars.ln: chars.c chars.in chars.h
120 chars.o: chars.c chars.in chars.h
121
122 msec.ln: msec.c msec.in libmdoc.h
123 msec.o: msec.c msec.in libmdoc.h
124
125 st.ln: st.c st.in libmdoc.h
126 st.o: st.c st.in libmdoc.h
127
128 mdoc_macro.ln: mdoc_macro.c libmdoc.h
129 mdoc_macro.o: mdoc_macro.c libmdoc.h
130
131 mdoc_term.ln: mdoc_term.c term.h mdoc.h
132 mdoc_term.o: mdoc_term.c term.h mdoc.h
133
134 mdoc_strings.ln: mdoc_strings.c libmdoc.h
135 mdoc_strings.o: mdoc_strings.c libmdoc.h
136
137 man_hash.ln: man_hash.c libman.h
138 man_hash.o: man_hash.c libman.h
139
140 mdoc_hash.ln: mdoc_hash.c libmdoc.h
141 mdoc_hash.o: mdoc_hash.c libmdoc.h
142
143 mdoc.ln: mdoc.c libmdoc.h
144 mdoc.o: mdoc.c libmdoc.h
145
146 man.ln: man.c libman.h
147 man.o: man.c libman.h
148
149 main.ln: main.c mdoc.h
150 main.o: main.c mdoc.h
151
152 compat.ln: compat.c
153 compat.o: compat.c
154
155 term.ln: term.c term.h man.h mdoc.h chars.h
156 term.o: term.c term.h man.h mdoc.h chars.h
157
158 html.ln: html.c html.h chars.h
159 html.o: html.c html.h chars.h
160
161 mdoc_html.ln: mdoc_html.c html.h mdoc.h
162 mdoc_html.o: mdoc_html.c html.h mdoc.h
163
164 man_html.ln: man_html.c html.h man.h
165 man_html.o: man_html.c html.h man.h
166
167 tree.ln: tree.c man.h mdoc.h
168 tree.o: tree.c man.h mdoc.h
169
170 mdoc_argv.ln: mdoc_argv.c libmdoc.h
171 mdoc_argv.o: mdoc_argv.c libmdoc.h
172
173 man_argv.ln: man_argv.c libman.h
174 man_argv.o: man_argv.c libman.h
175
176 man_validate.ln: man_validate.c libman.h
177 man_validate.o: man_validate.c libman.h
178
179 mdoc_validate.ln: mdoc_validate.c libmdoc.h
180 mdoc_validate.o: mdoc_validate.c libmdoc.h
181
182 mdoc_action.ln: mdoc_action.c libmdoc.h
183 mdoc_action.o: mdoc_action.c libmdoc.h
184
185 libmdoc.h: mdoc.h
186
187 ChangeLog.xml:
188 cvs2cl --xml --xml-encoding iso-8859-15 -t --noxmlns -f $@
189
190 ChangeLog.html: ChangeLog.xml ChangeLog.xsl
191 xsltproc -o $@ ChangeLog.xsl ChangeLog.xml
192
193 mdocml-$(VERSION).tar.gz: $(INSTALL)
194 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
195 cp -f $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
196 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
197 rm -rf .dist/
198
199 llib-llibmdoc.ln: $(MDOCLNS)
200 $(LINT) -Clibmdoc $(MDOCLNS)
201
202 llib-llibman.ln: $(MANLNS)
203 $(LINT) -Clibman $(MANLNS)
204
205 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
206 $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln
207
208 libmdoc.a: $(MDOCOBJS)
209 $(AR) rs $@ $(MDOCOBJS)
210
211 libman.a: $(MANOBJS)
212 $(AR) rs $@ $(MANOBJS)
213
214 mandoc: $(MAINOBJS) libmdoc.a libman.a
215 $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a
216
217 .sgml.html:
218 validate $<
219 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
220
221 .1.1.txt:
222 ./mandoc -Wall,error -fstrict $< | col -b > $@
223
224 .1.1.html:
225 ./mandoc -Thtml -ostyle=style.css -Wall,error -fstrict $< > $@
226
227 .3.3.txt:
228 ./mandoc -Wall,error -fstrict $< | col -b > $@
229
230 .3.3.html:
231 ./mandoc -Thtml -ostyle=style.css -Wall,error -fstrict $< > $@
232
233 .7.7.txt:
234 ./mandoc -Wall,error -fstrict $< | col -b > $@
235
236 .7.7.html:
237 ./mandoc -Thtml -ostyle=style.css -Wall,error -fstrict $< > $@
238
239 .tar.gz.md5:
240 md5 $< > $@