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