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