]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
Updating web-site.
[mandoc.git] / Makefile
1 .SUFFIXES: .html .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.7.2
13 VDATE = 23 March 2009
14
15 VFLAGS = -DVERSION=\"$(VERSION)\"
16 CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -g
17 LINTFLAGS += $(VFLAGS)
18 CFLAGS += $(VFLAGS)
19
20 MDOCLNS = mdoc_macro.ln mdoc.ln mdoc_hash.ln strings.ln xstd.ln \
21 argv.ln validate.ln action.ln lib.ln att.ln arch.ln \
22 vol.ln msec.ln st.ln
23 MDOCOBJS = mdoc_macro.o mdoc.o mdoc_hash.o strings.o xstd.o argv.o \
24 validate.o action.o lib.o att.o arch.o vol.o msec.o st.o
25 MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c strings.c xstd.c argv.c \
26 validate.c action.c lib.c att.c arch.c vol.c msec.c st.c
27
28 MANLNS = man_macro.ln man.ln man_hash.ln
29 MANOBJS = man_macro.o man.o man_hash.o
30 MANSRCS = man_macro.c man.c man_hash.c
31
32 MAINLNS = main.ln term.ln ascii.ln terminal.ln tree.ln compat.ln
33 MAINOBJS = main.o term.o ascii.o terminal.o tree.o compat.o
34 MAINSRCS = main.c term.c ascii.c terminal.c tree.c compat.c
35
36 LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln
37 LNS = $(MAINLNS) $(MDOCLNS)
38 LIBS = libmdoc.a libman.a
39 OBJS = $(MDOCOBJS) $(MAINOBJS)
40 SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS)
41 DATAS = arch.in att.in lib.in msec.in st.in vol.in ascii.in
42 HEADS = mdoc.h libmdoc.h man.h libman.h term.h
43 SGMLS = index.sgml
44 HTMLS = index.html
45 STATICS = style.css external.png
46 TARGZS = mdocml-$(VERSION).tar.gz \
47 mdocml-oport-$(VERSION).tar.gz \
48 mdocml-fport-$(VERSION).tar.gz \
49 mdocml-nport-$(VERSION).tar.gz
50 MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7
51 BINS = mandoc
52 CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) $(TARGZS)
53 INSTALL = $(SRCS) $(HEADS) Makefile DESCR $(MANS) $(SGMLS) \
54 $(STATICS) Makefile.netbsd Makefile.openbsd $(DATAS)
55
56 all: $(BINS)
57
58 lint: $(LLNS)
59
60 clean:
61 rm -f $(CLEAN)
62
63 cleanlint:
64 rm -f $(LNS) $(LLNS)
65
66 dist: mdocml-$(VERSION).tar.gz
67
68 port: mdocml-oport-$(VERSION).tar.gz \
69 mdocml-fport-$(VERSION).tar.gz \
70 mdocml-nport-$(VERSION).tar.gz
71
72 www: $(HTMLS) $(TARGZS)
73
74 installwww: www
75 install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
76 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
77 install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
78 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
79 install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
80 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
81 install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
82 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/
83 install -m 0444 mdocml-fport-$(VERSION).tar.gz $(PREFIX)/ports-freebsd/mdocml.tar.gz
84
85 install:
86 mkdir -p $(BINDIR)
87 mkdir -p $(MANDIR)/man1
88 mkdir -p $(MANDIR)/man7
89 $(INSTALL_PROGRAM) mandoc $(BINDIR)
90 $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
91 $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
92
93 uninstall:
94 rm -f $(BINDIR)/mandoc
95 rm -f $(MANDIR)/man1/mandoc.1
96 rm -f $(MANDIR)/man7/mdoc.7
97
98 man_macro.ln: man_macro.c libman.h
99 man_macro.o: man_macro.c libman.h
100
101 lib.ln: lib.c lib.in libmdoc.h
102 lib.o: lib.c lib.in libmdoc.h
103
104 att.ln: att.c att.in libmdoc.h
105 att.o: att.c att.in libmdoc.h
106
107 arch.ln: arch.c arch.in libmdoc.h
108 arch.o: arch.c arch.in libmdoc.h
109
110 vol.ln: vol.c vol.in libmdoc.h
111 vol.o: vol.c vol.in libmdoc.h
112
113 ascii.ln: ascii.c ascii.in term.h
114 ascii.o: ascii.c ascii.in term.h
115
116 msec.ln: msec.c msec.in libmdoc.h
117 msec.o: msec.c msec.in libmdoc.h
118
119 st.ln: st.c st.in libmdoc.h
120 st.o: st.c st.in libmdoc.h
121
122 mdoc_macro.ln: mdoc_macro.c libmdoc.h
123 mdoc_macro.o: mdoc_macro.c libmdoc.h
124
125 term.ln: term.c term.h
126 term.o: term.c term.h
127
128 strings.ln: strings.c libmdoc.h
129 strings.o: strings.c libmdoc.h
130
131 man_hash.ln: man_hash.c libman.h
132 man_hash.o: man_hash.c libman.h
133
134 mdoc_hash.ln: mdoc_hash.c libmdoc.h
135 mdoc_hash.o: mdoc_hash.c libmdoc.h
136
137 mdoc.ln: mdoc.c libmdoc.h
138 mdoc.o: mdoc.c libmdoc.h
139
140 man.ln: man.c libman.h
141 man.o: man.c libman.h
142
143 main.ln: main.c mdoc.h
144 main.o: main.c mdoc.h
145
146 terminal.ln: terminal.c term.h
147 terminal.o: terminal.c term.h
148
149 xstd.ln: xstd.c libmdoc.h
150 xstd.o: xstd.c libmdoc.h
151
152 argv.ln: argv.c libmdoc.h
153 argv.o: argv.c libmdoc.h
154
155 validate.ln: validate.c libmdoc.h
156 validate.o: validate.c libmdoc.h
157
158 action.ln: action.c libmdoc.h
159 action.o: action.c libmdoc.h
160
161 libmdoc.h: mdoc.h
162
163 term.h: mdoc.h
164
165 mdocml-nport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.netbsd DESCR
166 mkdir -p .dist/mdocml/
167 sed -e "s!@VERSION@!$(VERSION)!" Makefile.netbsd > \
168 .dist/mdocml/Makefile
169 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
170 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
171 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
172 install -m 0644 DESCR .dist/mdocml/
173 echo @comment $$NetBSD$$ > .dist/mdocml/PLIST
174 echo bin/mandoc >> .dist/mdocml/PLIST
175 echo man/man1/mandoc.1 >> .dist/mdocml/PLIST
176 echo man/man7/mdoc.7 >> .dist/mdocml/PLIST
177 ( cd .dist/ && tar zcf ../$@ mdocml/ )
178 rm -rf .dist/
179
180 mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
181 mkdir -p .dist/mdocml/pkg
182 sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
183 .dist/mdocml/Makefile
184 md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
185 rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
186 sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
187 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
188 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
189 echo bin/mandoc >> .dist/mdocml/pkg/PLIST
190 echo @man man/man1/mandoc.1 >> .dist/mdocml/pkg/PLIST
191 echo @man man/man7/mdoc.7 >> .dist/mdocml/pkg/PLIST
192 ( cd .dist/ && tar zcf ../$@ mdocml/ )
193 rm -rf .dist/
194
195 mdocml-fport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.freebsd DESCR
196 mkdir -p .dist/mdocml
197 sed -e "s!@VERSION@!$(VERSION)!" Makefile.freebsd > \
198 .dist/mdocml/Makefile
199 ( md5 mdocml-$(VERSION).tar.gz; \
200 sha1 mdocml-$(VERSION).tar.gz; \
201 echo -n "SIZE (mdocml-$(VERSION).tar.gz) = "; \
202 ls -l mdocml-$(VERSION).tar.gz | awk '{print $$5}' \
203 ) > .dist/mdocml/distinfo
204 install -m 0644 DESCR .dist/mdocml/pkg-descr
205 ( echo; echo "WWW: http://mdocml.bsd.lv/") >> .dist/mdocml/pkg-descr
206 ( cd .dist/ && tar zcf ../$@ mdocml/ )
207 rm -rf .dist/
208
209 mdocml-$(VERSION).tar.gz: $(INSTALL)
210 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
211 install -m 0644 $(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) $(LINTFLAGS) -Clibmdoc $(MDOCLNS)
217
218 llib-llibman.ln: $(MANLNS)
219 $(LINT) $(LINTFLAGS) -Clibman $(MANLNS)
220
221 llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln
222 $(LINT) $(LINTFLAGS) -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)!" $< > $@