Add base32 encoding and decoding.
[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
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
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
92unihash_mkstatic_SOURCES = \
93 unihash-mkstatic.c \
94 mdwopt.c quis.c pquis.c report.c str.c unihash.c
95
96## --- Test code ---
97
98noinst_PROGRAMS = da.t sym.t assoc.t bits.t
99
100check: \
101 da.test sym.test assoc.test bits.test base64.test hex.test \
102 base32.test \
103 unihash.test
104
105da_t_SOURCES = da-test.c
106da_t_LDADD = libmLib.la
107da_t_LDFLAGS = -static
108da.in: $(srcdir)/da-gtest
109 perl $(srcdir)/da-gtest 10000 >da.in.new
110 mv da.in.new da.in
111da.ref: da.in $(srcdir)/da-ref
112 perl $(srcdir)/da-ref <da.in >da.ref.new
113 mv da.ref.new da.ref
114da.test: da.t da.in da.ref
115 ./da.t <da.in >da.out
116 cmp da.out da.ref
117 @echo "darray tested OK."
118
119sym_t_SOURCES = sym-test.c
120sym_t_LDADD = libmLib.la
121sym_t_LDFLAGS = -static
122sym.in: $(srcdir)/sym-gtest
123 perl $(srcdir)/sym-gtest 10000 >sym.in.new
124 mv sym.in.new sym.in
125sym.ref: sym.in $(srcdir)/sym-ref
126 perl $(srcdir)/sym-ref <sym.in >sym.ref.new
127 mv sym.ref.new sym.ref
128sym.test: sym.t sym.in sym.ref
129 ./sym.t <sym.in >sym.out
130 cmp sym.out sym.ref
131 @echo "sym tested OK."
132
133assoc_t_SOURCES = assoc-test.c
134assoc_t_LDADD = libmLib.la
135assoc_t_LDFLAGS = -static
136assoc.test: assoc.t sym.in sym.ref
137 ./assoc.t <sym.in >assoc.out
138 cmp assoc.out sym.ref
139 @echo "assoc tested OK."
140
141bits_t_SOURCES = bits.c
142bits_t_LDADD = libmLib.la
143bits_t_LDFLAGS = -static
144bits.o: bits.c
145 $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/bits.c -o bits.o
146bits.test: bits.t
147 ./bits.t -f $(srcdir)/bits.in
148
149base64.to: base64.c
150 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
151 $(srcdir)/base64.c -o base64.to
152base64.t: base64.to base64.o libmLib.la
153 $(CC) $(CFLAGS) $(LDFLAGS) \
154 base64.to .libs/libmLib.a $(LIBS) -o base64.t
155base64.test: base64.t base64.in base64.ref
156 ./base64.t <$(srcdir)/base64.in >base64.out
157 cmp base64.out $(srcdir)/base64.ref
158 ./base64.t -d <$(srcdir)/base64.ref >base64.out
159 cmp base64.out $(srcdir)/base64.in
160 @echo "base64 tested OK."
161
162base32.to: base32.c
163 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
164 $(srcdir)/base32.c -o base32.to
165base32.t: base32.to base32.o libmLib.la
166 $(CC) $(CFLAGS) $(LDFLAGS) \
167 base32.to .libs/libmLib.a $(LIBS) -o base32.t
168base32.test: base32.t base32.in base32.ref
169 ./base32.t <$(srcdir)/base32.in >base32.out
170 cmp base32.out $(srcdir)/base32.ref
171 ./base32.t -d <$(srcdir)/base32.ref >base32.out
172 cmp base32.out $(srcdir)/base32.in
173 @echo "base32 tested OK."
174
175hex.to: hex.c
176 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
177 $(srcdir)/hex.c -o hex.to
178hex.t: hex.to hex.o libmLib.la
179 $(CC) $(CFLAGS) $(LDFLAGS) \
180 hex.to .libs/libmLib.a $(LIBS) -o hex.t
181hex.test: hex.t hex.in hex.ref
182 ./hex.t <$(srcdir)/hex.in >hex.out
183 cmp hex.out $(srcdir)/hex.ref
184 ./hex.t -d <$(srcdir)/hex.ref >hex.out
185 cmp hex.out $(srcdir)/hex.in
186 @echo "hex tested OK."
187
188unihash.to: unihash.c
189 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
190 $(srcdir)/unihash.c -o unihash.to
191unihash.t: unihash.to libmLib.la
192 $(CC) $(CFLAGS) $(LDFLAGS) \
193 unihash.to .libs/libmLib.a $(LIBS) -o unihash.t
194unihash.in: unihash-check.pl
195 perl $(srcdir)/unihash-check.pl >unihash.in.new
196 mv unihash.in.new unihash.in
197unihash.test: unihash.t unihash.in
198 ./unihash.t -f unihash.in
199
200TEST_CLEAN = \
201 *.t *.to \
202 da.in da.ref da.out \
203 sym.in sym.ref sym.out \
204 base64.out base32.out hex.out unihash.in
205
206TEST_DIST = \
207 da-gtest da-ref \
208 sym-gtest sym-ref \
209 bits.in bits-testgen.c \
210 base64.in base64.ref base32.in base32.ref hex.in hex.ref
211
212## --- Background resolver ---
213##
214## I must (a) build the standalone version, and (b) inform the client library
215## where the standalone version is.
216
217bres$(EXEEXT): bres-stnd.o
218 $(LINK) -o bres bres-stnd.o $(LIBS)
219
220bres-stnd.o: $(srcdir)/bres.c
221 $(COMPILE) -c -DBRES_STANDALONE -o bres-stnd.o $(srcdir)/bres.c
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 ---------------------------------------------------