]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
Added previous GEN files to SRCS.
[mandoc.git] / Makefile
1 .SUFFIXES: .html .sgml
2
3 VERSION = 1.5.2
4 VDATE = 17 March 2009
5
6 BINDIR = $(PREFIX)/bin
7 INCLUDEDIR = $(PREFIX)/include
8 LIBDIR = $(PREFIX)/lib
9 MANDIR = $(PREFIX)/man
10
11 INSTALL_PROGRAM = install -m 0755
12 INSTALL_DATA = install -m 0444
13 INSTALL_LIB = install -m 0644
14 INSTALL_MAN = $(INSTALL_DATA)
15
16 VFLAGS = -DVERSION=\"$(VERSION)\"
17 CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -g
18
19 LINTFLAGS += $(VFLAGS)
20 CFLAGS += $(VFLAGS)
21
22 LIBLNS = macro.ln mdoc.ln hash.ln strings.ln xstd.ln argv.ln \
23 validate.ln action.ln lib.ln att.ln arch.ln vol.ln \
24 msec.ln st.ln
25
26 TREELNS = mdoctree.ln mmain.ln
27
28 TERMLNS = mdoctree.ln mmain.ln term.ln ascii.ln
29
30 LINTLNS = mdoclint.ln mmain.ln
31
32 LNS = $(LIBLNS) $(TREELNS) $(TERMLNS)
33
34 LLNS = llib-llibmdoc.ln llib-lmdoctree.ln llib-lmdocterm.ln
35
36 LIBS = libmdoc.a
37
38 LIBOBJS = macro.o mdoc.o hash.o strings.o xstd.o argv.o \
39 validate.o action.o lib.o att.o arch.o vol.o msec.o \
40 st.o
41
42 TERMOBJS= mdocterm.o mmain.o term.o ascii.o
43
44 TREEOBJS= mdoctree.o mmain.o
45
46 LINTOBJS= mdoclint.o mmain.o
47
48 OBJS = $(LIBOBJS) $(TERMOBJS) $(TREEOBJS) $(LINTOBJS)
49
50 SRCS = macro.c mdoc.c hash.c strings.c xstd.c argv.c validate.c \
51 action.c term.c mdoctree.c mdocterm.c mmain.c mdoclint.c \
52 lib.c att.c arch.c vol.c msec.c st.c ascii.c
53
54 DATAS = arch.in att.in lib.in msec.in st.in vol.in ascii.in
55
56 HEADS = mdoc.h private.h term.h mmain.h
57
58 SGMLS = index.sgml
59
60 HTMLS = index.html
61
62 STATICS = style.css external.png
63
64 TARGZS = mdocml-$(VERSION).tar.gz mdocml-oport-$(VERSION).tar.gz \
65 mdocml-nport-$(VERSION).tar.gz
66
67 MANS = mdoctree.1 mdocterm.1 mdoclint.1 mdoc.3 mdoc.7
68
69 BINS = mdocterm mdoctree mdoclint
70
71 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
72 $(TARGZS)
73
74 INSTALL = $(SRCS) $(HEADS) Makefile DESCR $(MANS) $(SGMLS) \
75 $(STATICS) Makefile.netbsd Makefile.openbsd $(DATAS)
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 port: mdocml-oport-$(VERSION).tar.gz mdocml-nport-$(VERSION).tar.gz
90
91 www: $(HTMLS) $(TARGZS)
92
93 installwww: www
94 install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
95 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
96 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
97 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
98 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
99 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
100 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
101
102 install:
103 mkdir -p $(BINDIR)
104 mkdir -p $(INCLUDEDIR)
105 mkdir -p $(LIBDIR)/lib
106 mkdir -p $(MANDIR)/man1
107 mkdir -p $(MANDIR)/man3
108 $(INSTALL_PROGRAM) mdocterm $(BINDIR)
109 $(INSTALL_PROGRAM) mdoctree $(BINDIR)
110 $(INSTALL_PROGRAM) mdoclint $(BINDIR)
111 $(INSTALL_MAN) mdocterm.1 $(MANDIR)/man1
112 $(INSTALL_MAN) mdoctree.1 $(MANDIR)/man1
113 $(INSTALL_MAN) mdoclint.1 $(MANDIR)/man1
114 $(INSTALL_MAN) mdoc.3 $(MANDIR)/man3
115 $(INSTALL_LIB) libmdoc.a $(LIBDIR)
116 $(INSTALL_DATA) mdoc.h $(INCLUDEDIR)
117
118 uninstall:
119 rm -f $(BINDIR)/mdocterm
120 rm -f $(BINDIR)/mdoctree
121 rm -f $(BINDIR)/mdoclint
122 rm -f $(MANDIR)/man1/mdocterm.1
123 rm -f $(MANDIR)/man1/mdoctree.1
124 rm -f $(MANDIR)/man1/mdoclint.1
125 rm -f $(MANDIR)/man3/mdoc.3
126 rm -f $(LIBDIR)/libmdoc.a
127 rm -f $(INCLUDEDIR)/mdoc.h
128
129 lib.ln: lib.c lib.in private.h
130 lib.o: lib.c lib.in private.h
131
132 att.ln: att.c att.in private.h
133 att.o: att.c att.in private.h
134
135 arch.ln: arch.c arch.in private.h
136 arch.o: arch.c arch.in private.h
137
138 vol.ln: vol.c vol.in private.h
139 vol.o: vol.c vol.in private.h
140
141 ascii.ln: ascii.c ascii.in term.h
142 ascii.o: ascii.c ascii.in term.h
143
144 msec.ln: msec.c msec.in private.h
145 msec.o: msec.c msec.in private.h
146
147 st.ln: st.c st.in private.h
148 st.o: st.c st.in private.h
149
150 macro.ln: macro.c private.h
151 macro.o: macro.c private.h
152
153 term.ln: term.c term.h
154 term.o: term.c term.h
155
156 strings.ln: strings.c private.h
157 strings.o: strings.c private.h
158
159 hash.ln: hash.c private.h
160 hash.o: hash.c private.h
161
162 mdoc.ln: mdoc.c private.h
163 mdoc.o: mdoc.c private.h
164
165 mdocterm.ln: mdocterm.c mmain.h
166 mdocterm.o: mdocterm.c mmain.h
167
168 mdoclint.ln: mdoclint.c mmain.h
169 mdoclint.o: mdoclint.c mmain.h
170
171 mdoctree.ln: mdoctree.c mmain.h
172 mdoctree.o: mdoctree.c mmain.h
173
174 xstd.ln: xstd.c private.h
175 xstd.o: xstd.c private.h
176
177 argv.ln: argv.c private.h
178 argv.o: argv.c private.h
179
180 validate.ln: validate.c private.h
181 validate.o: validate.c private.h
182
183 action.ln: action.c private.h
184 action.o: action.c private.h
185
186 mmain.ln: mmain.c mmain.h
187 mmain.o: mmain.c mmain.h
188
189 private.h: mdoc.h
190
191 mmain.h: mdoc.h
192
193 term.h: mdoc.h
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/mdocterm >> .dist/mdocml/PLIST
205 echo bin/mdoctree >> .dist/mdocml/PLIST
206 echo bin/mdoclint >> .dist/mdocml/PLIST
207 echo lib/libmdoc.a >> .dist/mdocml/PLIST
208 echo include/mdoc.h >> .dist/mdocml/PLIST
209 echo man/man1/mdoctree.1 >> .dist/mdocml/PLIST
210 echo man/man1/mdocterm.1 >> .dist/mdocml/PLIST
211 echo man/man1/mdoclint.1 >> .dist/mdocml/PLIST
212 echo man/man3/mdoc.3 >> .dist/mdocml/PLIST
213 ( cd .dist/ && tar zcf ../$@ mdocml/ )
214 rm -rf .dist/
215
216 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
217 mkdir -p .dist/mdocml/pkg
218 sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
219 .dist/mdocml/Makefile
220 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
221 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
222 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
223 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
224 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
225 echo bin/mdocterm >> .dist/mdocml/pkg/PLIST
226 echo bin/mdoctree >> .dist/mdocml/pkg/PLIST
227 echo bin/mdoclint >> .dist/mdocml/pkg/PLIST
228 echo lib/libmdoc.a >> .dist/mdocml/pkg/PLIST
229 echo include/mdoc.h >> .dist/mdocml/pkg/PLIST
230 echo @man man/man1/mdoctree.1 >> .dist/mdocml/pkg/PLIST
231 echo @man man/man1/mdocterm.1 >> .dist/mdocml/pkg/PLIST
232 echo @man man/man1/mdoclint.1 >> .dist/mdocml/pkg/PLIST
233 echo @man man/man3/mdoc.3 >> .dist/mdocml/pkg/PLIST
234 ( cd .dist/ && tar zcf ../$@ mdocml/ )
235 rm -rf .dist/
236
237 mdocml-$(VERSION).tar.gz: $(INSTALL)
238 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
239 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
240 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
241 rm -rf .dist/
242
243 llib-llibmdoc.ln: $(LIBLNS)
244 $(LINT) $(LINTFLAGS) -Clibmdoc $(LIBLNS)
245
246 llib-lmdoctree.ln: $(TREELNS) llib-llibmdoc.ln
247 $(LINT) $(LINTFLAGS) -Cmdoctree $(TREELNS) llib-llibmdoc.ln
248
249 llib-lmdocterm.ln: $(TERMLNS) llib-llibmdoc.ln
250 $(LINT) $(LINTFLAGS) -Cmdocterm $(TERMLNS) llib-llibmdoc.ln
251
252 libmdoc.a: $(LIBOBJS)
253 $(AR) rs $@ $(LIBOBJS)
254
255 mdocterm: $(TERMOBJS) libmdoc.a
256 $(CC) $(CFLAGS) -o $@ $(TERMOBJS) libmdoc.a
257
258 mdoctree: $(TREEOBJS) libmdoc.a
259 $(CC) $(CFLAGS) -o $@ $(TREEOBJS) libmdoc.a
260
261 mdoclint: $(LINTOBJS) libmdoc.a
262 $(CC) $(CFLAGS) -o $@ $(LINTOBJS) libmdoc.a
263
264 .sgml.html:
265 validate $<
266 sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
267