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