Various Debian fixes.
[mLib] / Makefile.am
1 ## -*-Makefile-*-
2 ##
3 ## $Id: Makefile.am,v 1.40 2003/11/10 10:01:14 mdw Exp $
4 ##
5 ## Building the distribution
6 ##
7 ## (c) 1998 Straylight/Edgeware
8 ##
9
10 ##----- Licensing notice ----------------------------------------------------
11 ##
12 ## This file is part of the mLib utilities library.
13 ##
14 ## mLib is free software; you can redistribute it and/or modify
15 ## it under the terms of the GNU Library General Public License as
16 ## published by the Free Software Foundation; either version 2 of the
17 ## License, or (at your option) any later version.
18 ##
19 ## mLib is distributed in the hope that it will be useful,
20 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ## GNU Library General Public License for more details.
23 ##
24 ## You should have received a copy of the GNU Library General Public
25 ## License along with mLib; if not, write to the Free
26 ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 ## MA 02111-1307, USA.
28
29 ##----- Revision history ----------------------------------------------------
30 ##
31 ## $Log: Makefile.am,v $
32 ## Revision 1.40 2003/11/10 10:01:14 mdw
33 ## Various Debian fixes.
34 ##
35 ## Revision 1.39 2003/11/09 13:48:43 mdw
36 ## Debianization\!
37 ##
38 ## Revision 1.38 2003/10/12 14:54:18 mdw
39 ## Version bump.
40 ##
41 ## Revision 1.37 2003/10/12 14:44:46 mdw
42 ## Various fixes.
43 ##
44 ## Revision 1.36 2003/05/18 15:17:04 mdw
45 ## Version bump.
46 ##
47 ## Revision 1.35 2003/05/16 00:22:57 mdw
48 ## Test base64 and hex encoding.
49 ##
50 ## Revision 1.34 2003/04/23 12:51:03 mdw
51 ## New manpage installer.
52 ##
53 ## Revision 1.33 2002/01/13 13:26:59 mdw
54 ## New hex encoding stuff. Rename test programs.
55 ##
56 ## Revision 1.32 2001/03/03 12:20:23 mdw
57 ## New macros @DA_FIRST@ and @DA_LAST@ for stack/queue peeking.
58 ##
59 ## Revision 1.31 2001/02/03 18:43:56 mdw
60 ## New feature: watch a file for changes.
61 ##
62 ## Revision 1.30 2001/01/25 21:11:41 mdw
63 ## Use `$(MAKE)' in the `install-man' rule, so that the jobserver doesn't
64 ## whinge.
65 ##
66 ## Revision 1.29 2001/01/21 19:05:21 mdw
67 ## Add test driver for associations.
68 ##
69 ## Revision 1.28 2001/01/20 12:07:04 mdw
70 ## Put `bres' in a different place.
71 ##
72 ## Revision 1.27 2001/01/20 11:46:49 mdw
73 ## Add new files.
74 ##
75 ## Revision 1.26 2000/10/14 16:46:44 mdw
76 ## Make sure that the bits testcase gets its test vector from the source
77 ## directory.
78 ##
79 ## Revision 1.25 2000/10/08 11:20:57 mdw
80 ## Clean some more files.
81 ##
82 ## Revision 1.24 2000/10/08 11:08:25 mdw
83 ## (crc-mktab): now requires str.c.
84 ##
85 ## Revision 1.23 2000/07/29 10:06:10 mdw
86 ## Support `make -j' building.
87 ##
88 ## Revision 1.22 2000/07/21 19:01:33 mdw
89 ## Generate the CRC table rather than hardcoding it.
90 ##
91 ## Revision 1.21 2000/07/16 18:57:52 mdw
92 ## New files. Test cases for `bits.h'.
93 ##
94 ## Revision 1.20 2000/06/17 10:39:43 mdw
95 ## Various new source files.
96 ##
97 ## Revision 1.17 1999/11/11 18:47:33 mdw
98 ## Use `libtool' to generate a shared library.
99 ##
100 ## Revision 1.16 1999/11/11 17:48:28 mdw
101 ## New configuration system for library clients.
102 ##
103 ## Revision 1.15 1999/10/22 22:40:49 mdw
104 ## New source files. New testing system for sym and dynarray.
105 ##
106 ## Revision 1.11 1999/07/06 19:36:05 mdw
107 ## Various minor bugfixes.
108 ##
109 ## Revision 1.10 1999/07/06 19:18:47 mdw
110 ## Handle new manual page directory.
111 ##
112 ## Revision 1.8 1999/05/21 22:16:08 mdw
113 ## Reorder the source files again, in an attempt to make them slightly
114 ## logical. It hasn't really succeeded, although it is an improvement.
115 ##
116 ## Revision 1.6 1999/05/15 10:33:53 mdw
117 ## Add simplified locking code.
118 ##
119 ## Revision 1.5 1999/05/14 21:01:28 mdw
120 ## Integrated `select' handling bits from the background resolver project.
121 ##
122 ## Revision 1.2 1998/11/25 23:30:30 mdw
123 ## Add `tv.c'and `tv.h' to the list.
124 ##
125 ## Revision 1.1.1.1 1998/06/17 23:44:42 mdw
126 ## Initial version of mLib
127 ##
128 ## Revision 1.5 1997/08/13 17:55:43 mdw
129 ## Add big GPL header. General tidying up.
130 ##
131
132 ## --- Options ---
133
134 AUTOMAKE_OPTIONS = foreign
135
136 ## --- What to build ---
137
138 SUBDIRS = man
139
140 bin_SCRIPTS = mLib-config
141 bin_PROGRAMS = crc-mktab
142
143 lib_LTLIBRARIES = libmLib.la
144 pkglibexecdir = $(libexecdir)/$(PACKAGE)
145 pkglibexec_PROGRAMS = bres
146
147 pkginclude_HEADERS = \
148 align.h alloc.h arena.h bits.h exc.h quis.h report.h sub.h \
149 trace.h track.h unihash.h \
150 pool.h \
151 atom.h assoc.h darray.h dstr.h dspool.h hash.h sym.h crc32.h \
152 env.h fdflags.h fwatch.h lock.h \
153 bres.h conn.h lbuf.h ident.h pkbuf.h sel.h selbuf.h selpk.h sig.h \
154 tv.h \
155 base64.h hex.h mdwopt.h str.h testrig.h url.h
156
157 ## --- Things to put in the library ---
158
159 libmLib_la_LDFLAGS = -version-info 2:2:0
160 ## Middle number is the patchlevel. Final number is the minor version. The
161 ## difference between the first and last numbers is major version.
162
163 libmLib_la_SOURCES = \
164 alloc.c arena.c exc.c quis.c pquis.c report.c sub.c trace.c \
165 traceopt.c track.c unihash.c \
166 pool.c pool-file.c pool-sub.c \
167 atom.c assoc.c darray.c dstr.c dputf.c dspool.c hash.c sym.c \
168 crc32.c crc32-tab.c \
169 env.c fdflags.c fwatch.c lock.c \
170 bres.c conn.c lbuf.c ident.c pkbuf.c sel.c selbuf.c selpk.c sig.c \
171 tv.c \
172 base64.c hex.c mdwopt.c str.c testrig.c url.c
173
174 BUILT_SOURCES = crc32-tab.c
175
176 crc32-tab.c: crc-mktab
177 ./crc-mktab \
178 -p0x04c11db7 -b32 -B8 -r \
179 -c -scrc32_table -icrc32.h -tuint32 -ocrc32-tab.c.new
180 mv crc32-tab.c.new crc32-tab.c
181
182 crc_mktab_SOURCES = crc-mktab.c mdwopt.c quis.c pquis.c report.c str.c
183
184 ## --- Test code ---
185
186 noinst_PROGRAMS = da.t sym.t assoc.t bits.t
187
188 check: \
189 da.test sym.test assoc.test bits.test base64.test hex.test
190
191 da_t_SOURCES = da-test.c
192 da_t_LDADD = libmLib.la
193 da_t_LDFLAGS = -static
194 da.in: $(srcdir)/da-gtest
195 perl $(srcdir)/da-gtest 10000 >da.in.new
196 mv da.in.new da.in
197 da.ref: da.in $(srcdir)/da-ref
198 perl $(srcdir)/da-ref <da.in >da.ref.new
199 mv da.ref.new da.ref
200 da.test: da.t da.in da.ref
201 ./da.t <da.in >da.out
202 cmp da.out da.ref
203 @echo "darray tested OK."
204
205 sym_t_SOURCES = sym-test.c
206 sym_t_LDADD = libmLib.la
207 sym_t_LDFLAGS = -static
208 sym.in: $(srcdir)/sym-gtest
209 perl $(srcdir)/sym-gtest 10000 >sym.in.new
210 mv sym.in.new sym.in
211 sym.ref: sym.in $(srcdir)/sym-ref
212 perl $(srcdir)/sym-ref <sym.in >sym.ref.new
213 mv sym.ref.new sym.ref
214 sym.test: sym.t sym.in sym.ref
215 ./sym.t <sym.in >sym.out
216 cmp sym.out sym.ref
217 @echo "sym tested OK."
218
219 assoc_t_SOURCES = assoc-test.c
220 assoc_t_LDADD = libmLib.la
221 assoc_t_LDFLAGS = -static
222 assoc.test: assoc.t sym.in sym.ref
223 ./assoc.t <sym.in >assoc.out
224 cmp assoc.out sym.ref
225 @echo "assoc tested OK."
226
227 bits_t_SOURCES = bits.c
228 bits_t_LDADD = libmLib.la
229 bits_t_LDFLAGS = -static
230 bits.o: bits.c
231 $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/bits.c -o bits.o
232 bits.test: bits.t
233 ./bits.t -f $(srcdir)/bits.in
234
235 base64.to: base64.c
236 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $(srcdir)/base64.c -o base64.to
237 base64.t: base64.to base64.o libmLib.la
238 $(CC) $(CFLAGS) $(LDFLAGS) base64.to .libs/libmLib.a $(LIBS) -o base64.t
239 base64.test: base64.t base64.in base64.ref
240 ./base64.t <$(srcdir)/base64.in >base64.out
241 cmp base64.out $(srcdir)/base64.ref
242 ./base64.t -d <$(srcdir)/base64.ref >base64.out
243 cmp base64.out $(srcdir)/base64.in
244 @echo "base64 tested OK."
245
246 hex.to: hex.c
247 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $(srcdir)/hex.c -o hex.to
248 hex.t: hex.to hex.o libmLib.la
249 $(CC) $(CFLAGS) $(LDFLAGS) hex.to .libs/libmLib.a $(LIBS) -o hex.t
250 hex.test: hex.t hex.in hex.ref
251 ./hex.t <$(srcdir)/hex.in >hex.out
252 cmp hex.out $(srcdir)/hex.ref
253 ./hex.t -d <$(srcdir)/hex.ref >hex.out
254 cmp hex.out $(srcdir)/hex.in
255 @echo "hex tested OK."
256
257 TEST_CLEAN = \
258 *.t \
259 da.in da.ref da.out \
260 sym.in sym.ref sym.out \
261 base64.out hex.out
262
263 TEST_DIST = \
264 da-gtest da-ref \
265 sym-gtest sym-ref \
266 bits.in bits-testgen.c \
267 base64.in base64.ref hex.in hex.ref
268
269 ## --- Background resolver ---
270 ##
271 ## I must (a) build the standalone version, and (b) inform the client library
272 ## where the standalone version is.
273
274 bres: bres-stnd.o
275 $(LINK) -o bres bres-stnd.o $(LIBS)
276
277 bres-stnd.o: $(srcdir)/bres.c
278 $(COMPILE) -c -DBRES_STANDALONE -o bres-stnd.o $(srcdir)/bres.c
279
280 bres.lo: $(srcdir)/bres.c
281 $(LTCOMPILE) -c -DBRES_SERVER="\"$(libexecdir)/$(PACKAGE)/`echo bres|sed '$(transform)'`\"" $(srcdir)/bres.c
282
283 ## --- Other useful rules ---
284
285 install-man:
286 (cd man && $(MAKE) install-man)
287 uninstall-man:
288 (cd man && $(MAKE) uninstall-man)
289
290 CLEANFILES = $(TEST_CLEAN) crc32-tab.c
291 DISTCLEANFILES = libtool
292 EXTRA_DIST = \
293 $(TEST_DIST) maninst \
294 debian/rules debian/copyright debian/control debian/changelog
295
296 ##----- That's all, folks ---------------------------------------------------