3 ## $Id: Makefile.am,v 1.46 2004/04/08 01:36:11 mdw Exp $
5 ## Building the distribution
7 ## (c) 1998 Straylight/Edgeware
10 ##----- Licensing notice ----------------------------------------------------
12 ## This file is part of the mLib utilities library.
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.
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.
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.
31 AUTOMAKE_OPTIONS = foreign
33 ## --- What to build ---
37 bin_SCRIPTS = mLib-config
38 bin_PROGRAMS = crc-mktab unihash-mkstatic
40 lib_LTLIBRARIES = libmLib.la
41 pkglibexecdir = $(libexecdir)/$(PACKAGE)
42 pkglibexec_PROGRAMS = @BRES_LIBEXEC@
45 pkginclude_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 \
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 \
53 base64.h hex.h mdwopt.h str.h testrig.h url.h
55 ## --- Things to put in the library ---
57 libmLib_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.
61 libmLib_la_SOURCES = \
62 alloc.c arena.c exc.c quis.c pquis.c report.c sub.c trace.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 \
67 unihash.c unihash-global.c \
68 env.c fdflags.c fdpass.c fwatch.c lock.c \
70 conn.c lbuf.c ident.c pkbuf.c sel.c selbuf.c selpk.c sig.c \
72 base64.c hex.c mdwopt.c str.c testrig.c url.c
73 EXTRA_libmLib_la_SOURCES = bres.c bres-adns.c
74 libmLib_la_LIBADD = @DEPLIBS@
76 BUILT_SOURCES = crc32-tab.c unihash-global.c
78 crc32-tab.c: 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
84 unihash-global.c: unihash-mkstatic
86 -c -sunihash_global -iunihash.h -ounihash-global.c.new
87 mv unihash-global.c.new unihash-global.c
91 mdwopt.c quis.c pquis.c report.c str.c
92 unihash_mkstatic_SOURCES = \
94 mdwopt.c quis.c pquis.c report.c str.c unihash.c
98 noinst_PROGRAMS = da.t sym.t assoc.t bits.t
101 da.test sym.test assoc.test bits.test base64.test hex.test \
104 da_t_SOURCES = da-test.c
105 da_t_LDADD = libmLib.la
106 da_t_LDFLAGS = -static
107 da.in: $(srcdir)/da-gtest
108 perl $(srcdir)/da-gtest 10000 >da.in.new
110 da.ref: da.in $(srcdir)/da-ref
111 perl $(srcdir)/da-ref <da.in >da.ref.new
113 da.test: da.t da.in da.ref
114 ./da.t <da.in >da.out
116 @echo "darray tested OK."
118 sym_t_SOURCES = sym-test.c
119 sym_t_LDADD = libmLib.la
120 sym_t_LDFLAGS = -static
121 sym.in: $(srcdir)/sym-gtest
122 perl $(srcdir)/sym-gtest 10000 >sym.in.new
124 sym.ref: sym.in $(srcdir)/sym-ref
125 perl $(srcdir)/sym-ref <sym.in >sym.ref.new
126 mv sym.ref.new sym.ref
127 sym.test: sym.t sym.in sym.ref
128 ./sym.t <sym.in >sym.out
130 @echo "sym tested OK."
132 assoc_t_SOURCES = assoc-test.c
133 assoc_t_LDADD = libmLib.la
134 assoc_t_LDFLAGS = -static
135 assoc.test: assoc.t sym.in sym.ref
136 ./assoc.t <sym.in >assoc.out
137 cmp assoc.out sym.ref
138 @echo "assoc tested OK."
140 bits_t_SOURCES = bits.c
141 bits_t_LDADD = libmLib.la
142 bits_t_LDFLAGS = -static
144 $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/bits.c -o bits.o
146 ./bits.t -f $(srcdir)/bits.in
149 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
150 $(srcdir)/base64.c -o base64.to
151 base64.t: base64.to base64.o libmLib.la
152 $(CC) $(CFLAGS) $(LDFLAGS) \
153 base64.to .libs/libmLib.a $(LIBS) -o base64.t
154 base64.test: base64.t base64.in base64.ref
155 ./base64.t <$(srcdir)/base64.in >base64.out
156 cmp base64.out $(srcdir)/base64.ref
157 ./base64.t -d <$(srcdir)/base64.ref >base64.out
158 cmp base64.out $(srcdir)/base64.in
159 @echo "base64 tested OK."
162 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
163 $(srcdir)/hex.c -o hex.to
164 hex.t: hex.to hex.o libmLib.la
165 $(CC) $(CFLAGS) $(LDFLAGS) \
166 hex.to .libs/libmLib.a $(LIBS) -o hex.t
167 hex.test: hex.t hex.in hex.ref
168 ./hex.t <$(srcdir)/hex.in >hex.out
169 cmp hex.out $(srcdir)/hex.ref
170 ./hex.t -d <$(srcdir)/hex.ref >hex.out
171 cmp hex.out $(srcdir)/hex.in
172 @echo "hex tested OK."
174 unihash.to: unihash.c
175 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
176 $(srcdir)/unihash.c -o unihash.to
177 unihash.t: unihash.to libmLib.la
178 $(CC) $(CFLAGS) $(LDFLAGS) \
179 unihash.to .libs/libmLib.a $(LIBS) -o unihash.t
180 unihash.in: unihash-check.pl
181 perl $(srcdir)/unihash-check.pl >unihash.in.new
182 mv unihash.in.new unihash.in
183 unihash.test: unihash.t unihash.in
184 ./unihash.t -f unihash.in
188 da.in da.ref da.out \
189 sym.in sym.ref sym.out \
190 base64.out hex.out unihash.in
195 bits.in bits-testgen.c \
196 base64.in base64.ref hex.in hex.ref
198 ## --- Background resolver ---
200 ## I must (a) build the standalone version, and (b) inform the client library
201 ## where the standalone version is.
203 bres$(EXEEXT): bres-stnd.o
204 $(LINK) -o bres bres-stnd.o $(LIBS)
206 bres-stnd.o: $(srcdir)/bres.c
207 $(COMPILE) -c -DBRES_STANDALONE -o bres-stnd.o $(srcdir)/bres.c
209 bres.lo: $(srcdir)/bres.c
210 $(LTCOMPILE) -c -DBRES_SERVER="\"$(libexecdir)/$(PACKAGE)/`echo bres|sed '$(transform)'`\"" $(srcdir)/bres.c
212 ## --- Other useful rules ---
215 (cd man && $(MAKE) install-man)
217 (cd man && $(MAKE) uninstall-man)
219 CLEANFILES = $(TEST_CLEAN) crc32-tab.c
220 DISTCLEANFILES = libtool
222 $(TEST_DIST) maninst \
223 debian/rules debian/copyright debian/control debian/changelog
225 ##----- That's all, folks ---------------------------------------------------