chiark / gitweb /
Refugees from Catacomb: low-level buffer primitives.
[mLib] / Makefile.am
... / ...
CommitLineData
1## -*-Makefile-*-
2##
3## $Id$
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## --- Options ---
30
31AUTOMAKE_OPTIONS = foreign
32
33## --- What to build ---
34
35SUBDIRS = man
36
37bin_SCRIPTS = mLib-config
38bin_PROGRAMS = crc-mktab unihash-mkstatic
39
40lib_LTLIBRARIES = libmLib.la
41pkglibexecdir = $(libexecdir)/$(PACKAGE)
42pkglibexec_PROGRAMS = @BRES_LIBEXEC@
43EXTRA_PROGRAMS = bres
44
45pkginclude_HEADERS = \
46 align.h alloc.h arena.h bits.h exc.h macros.h quis.h report.h sub.h \
47 trace.h track.h unihash.h \
48 pool.h \
49 atom.h assoc.h darray.h dstr.h dspool.h hash.h sym.h crc32.h \
50 env.h fdflags.h fdpass.h fwatch.h lock.h \
51 bres.h conn.h lbuf.h ident.h pkbuf.h sel.h selbuf.h selpk.h sig.h \
52 tv.h \
53 base64.h base32.h hex.h mdwopt.h str.h testrig.h url.h
54
55## --- Things to put in the library ---
56
57libmLib_la_LDFLAGS = -version-info 2:3:0
58## Middle number is the patchlevel. Final number is the minor version. The
59## difference between the first and last numbers is major version.
60
61libmLib_la_SOURCES = \
62 alloc.c arena.c exc.c quis.c pquis.c report.c sub.c trace.c \
63 traceopt.c track.c \
64 pool.c pool-file.c pool-sub.c \
65 atom.c assoc.c darray.c dstr.c dputf.c dspool.c hash.c sym.c \
66 crc32.c crc32-tab.c \
67 unihash.c unihash-global.c \
68 env.c fdflags.c fdpass.c fwatch.c lock.c \
69 @BRES_SOURCE@.c \
70 conn.c lbuf.c ident.c pkbuf.c sel.c selbuf.c selpk.c sig.c \
71 tv.c \
72 base64.c base32.c hex.c mdwopt.c str.c testrig.c url.c
73EXTRA_libmLib_la_SOURCES = bres.c bres-adns.c
74libmLib_la_LIBADD = @DEPLIBS@
75
76BUILT_SOURCES = crc32-tab.c unihash-global.c
77
78crc32-tab.c: crc-mktab$(EXEEXT)
79 ./crc-mktab \
80 -p0x04c11db7 -b32 -B8 -r \
81 -c -scrc32_table -icrc32.h -tuint32 -ocrc32-tab.c.new
82 mv crc32-tab.c.new crc32-tab.c
83
84unihash-global.c: unihash-mkstatic$(EXEEXT)
85 ./unihash-mkstatic \
86 -c -sunihash_global -iunihash.h -ounihash-global.c.new
87 mv unihash-global.c.new unihash-global.c
88
89crc_mktab_SOURCES = \
90 crc-mktab.c \
91 mdwopt.c quis.c pquis.c report.c str.c
92crc_mktab_CFLAGS = $(AM_CFLAGS)
93unihash_mkstatic_SOURCES = \
94 unihash-mkstatic.c \
95 mdwopt.c quis.c pquis.c report.c str.c unihash.c
96unihash_mkstatic_CFLAGS = $(AM_CFLAGS)
97
98## --- Test code ---
99
100noinst_PROGRAMS = da.t sym.t assoc.t bits.t
101
102check: \
103 da.test sym.test assoc.test bits.test base64.test hex.test \
104 base32.test \
105 unihash.test
106
107da_t_SOURCES = da-test.c
108da_t_LDADD = libmLib.la
109da_t_LDFLAGS = -static
110da.in: $(srcdir)/da-gtest
111 perl $(srcdir)/da-gtest 10000 >da.in.new
112 mv da.in.new da.in
113da.ref: da.in $(srcdir)/da-ref
114 perl $(srcdir)/da-ref <da.in >da.ref.new
115 mv da.ref.new da.ref
116da.test: da.t da.in da.ref
117 ./da.t <da.in >da.out
118 cmp da.out da.ref
119 @echo "darray tested OK."
120
121sym_t_SOURCES = sym-test.c
122sym_t_LDADD = libmLib.la
123sym_t_LDFLAGS = -static
124sym.in: $(srcdir)/sym-gtest
125 perl $(srcdir)/sym-gtest 10000 >sym.in.new
126 mv sym.in.new sym.in
127sym.ref: sym.in $(srcdir)/sym-ref
128 perl $(srcdir)/sym-ref <sym.in >sym.ref.new
129 mv sym.ref.new sym.ref
130sym.test: sym.t sym.in sym.ref
131 ./sym.t <sym.in >sym.out
132 cmp sym.out sym.ref
133 @echo "sym tested OK."
134
135assoc_t_SOURCES = assoc-test.c
136assoc_t_LDADD = libmLib.la
137assoc_t_LDFLAGS = -static
138assoc.test: assoc.t sym.in sym.ref
139 ./assoc.t <sym.in >assoc.out
140 cmp assoc.out sym.ref
141 @echo "assoc tested OK."
142
143bits_t_SOURCES = bits.c
144bits_t_LDADD = libmLib.la
145bits_t_LDFLAGS = -static
146bits.o: bits.c
147 $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/bits.c -o bits.o
148bits.test: bits.t
149 ./bits.t -f $(srcdir)/bits.in
150
151base64.to: base64.c
152 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
153 $(srcdir)/base64.c -o base64.to
154base64.t: base64.to base64.o libmLib.la
155 $(CC) $(CFLAGS) $(LDFLAGS) \
156 base64.to .libs/libmLib.a $(LIBS) -o base64.t
157base64.test: base64.t base64.in base64.ref
158 ./base64.t <$(srcdir)/base64.in >base64.out
159 cmp base64.out $(srcdir)/base64.ref
160 ./base64.t -d <$(srcdir)/base64.ref >base64.out
161 cmp base64.out $(srcdir)/base64.in
162 @echo "base64 tested OK."
163
164base32.to: base32.c
165 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
166 $(srcdir)/base32.c -o base32.to
167base32.t: base32.to base32.o libmLib.la
168 $(CC) $(CFLAGS) $(LDFLAGS) \
169 base32.to .libs/libmLib.a $(LIBS) -o base32.t
170base32.test: base32.t base32.in base32.ref
171 ./base32.t <$(srcdir)/base32.in >base32.out
172 cmp base32.out $(srcdir)/base32.ref
173 ./base32.t -d <$(srcdir)/base32.ref >base32.out
174 cmp base32.out $(srcdir)/base32.in
175 @echo "base32 tested OK."
176
177hex.to: hex.c
178 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
179 $(srcdir)/hex.c -o hex.to
180hex.t: hex.to hex.o libmLib.la
181 $(CC) $(CFLAGS) $(LDFLAGS) \
182 hex.to .libs/libmLib.a $(LIBS) -o hex.t
183hex.test: hex.t hex.in hex.ref
184 ./hex.t <$(srcdir)/hex.in >hex.out
185 cmp hex.out $(srcdir)/hex.ref
186 ./hex.t -d <$(srcdir)/hex.ref >hex.out
187 cmp hex.out $(srcdir)/hex.in
188 @echo "hex tested OK."
189
190unihash.to: unihash.c
191 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
192 $(srcdir)/unihash.c -o unihash.to
193unihash.t: unihash.to libmLib.la
194 $(CC) $(CFLAGS) $(LDFLAGS) \
195 unihash.to .libs/libmLib.a $(LIBS) -o unihash.t
196unihash.in: unihash-check.pl
197 perl $(srcdir)/unihash-check.pl >unihash.in.new
198 mv unihash.in.new $(srcdir)/unihash.in
199unihash.test: unihash.t unihash.in
200 ./unihash.t -f $(srcdir)/unihash.in
201
202TEST_CLEAN = \
203 *.t *.to \
204 da.in da.ref da.out \
205 sym.in sym.ref sym.out \
206 base64.out base32.out hex.out unihash.in
207
208TEST_DIST = \
209 da-gtest da-ref \
210 sym-gtest sym-ref \
211 bits.in bits-testgen.c \
212 unihash-check.pl unihash.in \
213 base64.in base64.ref base32.in base32.ref hex.in hex.ref
214
215## --- Background resolver ---
216##
217## I must (a) build the standalone version, and (b) inform the client library
218## where the standalone version is.
219
220bres_SOURCES = bres.c
221bres_CFLAGS = -DBRES_STANDALONE
222
223bres.lo: $(srcdir)/bres.c
224 $(LTCOMPILE) -c -DBRES_SERVER="\"$(libexecdir)/$(PACKAGE)/`echo bres|sed '$(transform)'`\"" $(srcdir)/bres.c
225
226## --- Other useful rules ---
227
228install-man:
229 (cd man && $(MAKE) install-man)
230uninstall-man:
231 (cd man && $(MAKE) uninstall-man)
232
233CLEANFILES = $(TEST_CLEAN) crc32-tab.c
234DISTCLEANFILES = libtool
235EXTRA_DIST = \
236 $(TEST_DIST) maninst \
237 debian/rules debian/copyright debian/control debian/changelog
238
239##----- That's all, folks ---------------------------------------------------