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