Expunge revision histories in files.
[mLib] / Makefile.am
1 ## -*-Makefile-*-
2 ##
3 ## $Id: Makefile.am,v 1.46 2004/04/08 01:36:11 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 ## --- Options ---
30
31 AUTOMAKE_OPTIONS = foreign
32
33 ## --- What to build ---
34
35 SUBDIRS = man
36
37 bin_SCRIPTS = mLib-config
38 bin_PROGRAMS = crc-mktab unihash-mkstatic
39
40 lib_LTLIBRARIES = libmLib.la
41 pkglibexecdir = $(libexecdir)/$(PACKAGE)
42 pkglibexec_PROGRAMS = @BRES_LIBEXEC@
43 EXTRA_PROGRAMS = bres
44
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 \
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 hex.h mdwopt.h str.h testrig.h url.h
54
55 ## --- Things to put in the library ---
56
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.
60
61 libmLib_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 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@
75
76 BUILT_SOURCES = crc32-tab.c unihash-global.c
77
78 crc32-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
84 unihash-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
89 crc_mktab_SOURCES = \
90 crc-mktab.c \
91 mdwopt.c quis.c pquis.c report.c str.c
92 unihash_mkstatic_SOURCES = \
93 unihash-mkstatic.c \
94 mdwopt.c quis.c pquis.c report.c str.c unihash.c
95
96 ## --- Test code ---
97
98 noinst_PROGRAMS = da.t sym.t assoc.t bits.t
99
100 check: \
101 da.test sym.test assoc.test bits.test base64.test hex.test \
102 unihash.test
103
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
109 mv da.in.new da.in
110 da.ref: da.in $(srcdir)/da-ref
111 perl $(srcdir)/da-ref <da.in >da.ref.new
112 mv da.ref.new da.ref
113 da.test: da.t da.in da.ref
114 ./da.t <da.in >da.out
115 cmp da.out da.ref
116 @echo "darray tested OK."
117
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
123 mv sym.in.new sym.in
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
129 cmp sym.out sym.ref
130 @echo "sym tested OK."
131
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."
139
140 bits_t_SOURCES = bits.c
141 bits_t_LDADD = libmLib.la
142 bits_t_LDFLAGS = -static
143 bits.o: bits.c
144 $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/bits.c -o bits.o
145 bits.test: bits.t
146 ./bits.t -f $(srcdir)/bits.in
147
148 base64.to: base64.c
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."
160
161 hex.to: hex.c
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."
173
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
185
186 TEST_CLEAN = \
187 *.t *.to \
188 da.in da.ref da.out \
189 sym.in sym.ref sym.out \
190 base64.out hex.out unihash.in
191
192 TEST_DIST = \
193 da-gtest da-ref \
194 sym-gtest sym-ref \
195 bits.in bits-testgen.c \
196 base64.in base64.ref hex.in hex.ref
197
198 ## --- Background resolver ---
199 ##
200 ## I must (a) build the standalone version, and (b) inform the client library
201 ## where the standalone version is.
202
203 bres$(EXEEXT): bres-stnd.o
204 $(LINK) -o bres bres-stnd.o $(LIBS)
205
206 bres-stnd.o: $(srcdir)/bres.c
207 $(COMPILE) -c -DBRES_STANDALONE -o bres-stnd.o $(srcdir)/bres.c
208
209 bres.lo: $(srcdir)/bres.c
210 $(LTCOMPILE) -c -DBRES_SERVER="\"$(libexecdir)/$(PACKAGE)/`echo bres|sed '$(transform)'`\"" $(srcdir)/bres.c
211
212 ## --- Other useful rules ---
213
214 install-man:
215 (cd man && $(MAKE) install-man)
216 uninstall-man:
217 (cd man && $(MAKE) uninstall-man)
218
219 CLEANFILES = $(TEST_CLEAN) crc32-tab.c
220 DISTCLEANFILES = libtool
221 EXTRA_DIST = \
222 $(TEST_DIST) maninst \
223 debian/rules debian/copyright debian/control debian/changelog
224
225 ##----- That's all, folks ---------------------------------------------------