Expunge revision histories in files.
[mLib] / Makefile.am
CommitLineData
0875b58f 1## -*-Makefile-*-
2##
8656dc50 3## $Id: Makefile.am,v 1.46 2004/04/08 01:36:11 mdw Exp $
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 = \
14d7100d 46 align.h alloc.h arena.h bits.h exc.h macros.h quis.h report.h sub.h \
c5775f49 47 trace.h track.h unihash.h \
e9184b1e 48 pool.h \
8c685f42 49 atom.h assoc.h darray.h dstr.h dspool.h hash.h sym.h crc32.h \
ad61a8f8 50 env.h fdflags.h fdpass.h fwatch.h lock.h \
7b979907 51 bres.h conn.h lbuf.h ident.h pkbuf.h sel.h selbuf.h selpk.h sig.h \
52 tv.h \
d04f4733 53 base64.h hex.h mdwopt.h str.h testrig.h url.h
0875b58f 54
55## --- Things to put in the library ---
56
14d7100d 57libmLib_la_LDFLAGS = -version-info 2:3:0
c7f30b36 58## Middle number is the patchlevel. Final number is the minor version. The
59## difference between the first and last numbers is major version.
0875b58f 60
c7f30b36 61libmLib_la_SOURCES = \
7b979907 62 alloc.c arena.c exc.c quis.c pquis.c report.c sub.c trace.c \
18756bee 63 traceopt.c track.c \
e9184b1e 64 pool.c pool-file.c pool-sub.c \
8c685f42 65 atom.c assoc.c darray.c dstr.c dputf.c dspool.c hash.c sym.c \
66 crc32.c crc32-tab.c \
18756bee 67 unihash.c unihash-global.c \
ad61a8f8 68 env.c fdflags.c fdpass.c fwatch.c lock.c \
14d7100d 69 @BRES_SOURCE@.c \
70 conn.c lbuf.c ident.c pkbuf.c sel.c selbuf.c selpk.c sig.c \
7b979907 71 tv.c \
d04f4733 72 base64.c hex.c mdwopt.c str.c testrig.c url.c
14d7100d 73EXTRA_libmLib_la_SOURCES = bres.c bres-adns.c
74libmLib_la_LIBADD = @DEPLIBS@
8f207948 75
18756bee 76BUILT_SOURCES = crc32-tab.c unihash-global.c
b7580524 77
78crc32-tab.c: crc-mktab
79 ./crc-mktab \
80 -p0x04c11db7 -b32 -B8 -r \
75721625 81 -c -scrc32_table -icrc32.h -tuint32 -ocrc32-tab.c.new
82 mv crc32-tab.c.new crc32-tab.c
b7580524 83
18756bee 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
b7580524 95
21c22b5c 96## --- Test code ---
97
3980d2f1 98noinst_PROGRAMS = da.t sym.t assoc.t bits.t
d04f4733 99
100check: \
573eadb5 101 da.test sym.test assoc.test bits.test base64.test hex.test \
102 unihash.test
d04f4733 103
104da_t_SOURCES = da-test.c
105da_t_LDADD = libmLib.la
106da_t_LDFLAGS = -static
107da.in: $(srcdir)/da-gtest
c5775f49 108 perl $(srcdir)/da-gtest 10000 >da.in.new
109 mv da.in.new da.in
d04f4733 110da.ref: da.in $(srcdir)/da-ref
c5775f49 111 perl $(srcdir)/da-ref <da.in >da.ref.new
112 mv da.ref.new da.ref
d04f4733 113da.test: da.t da.in da.ref
d5679ed0 114 ./da.t <da.in >da.out
115 cmp da.out da.ref
21c22b5c 116 @echo "darray tested OK."
117
d04f4733 118sym_t_SOURCES = sym-test.c
119sym_t_LDADD = libmLib.la
120sym_t_LDFLAGS = -static
121sym.in: $(srcdir)/sym-gtest
c5775f49 122 perl $(srcdir)/sym-gtest 10000 >sym.in.new
123 mv sym.in.new sym.in
d04f4733 124sym.ref: sym.in $(srcdir)/sym-ref
c5775f49 125 perl $(srcdir)/sym-ref <sym.in >sym.ref.new
126 mv sym.ref.new sym.ref
d04f4733 127sym.test: sym.t sym.in sym.ref
d5679ed0 128 ./sym.t <sym.in >sym.out
129 cmp sym.out sym.ref
21c22b5c 130 @echo "sym tested OK."
131
d04f4733 132assoc_t_SOURCES = assoc-test.c
133assoc_t_LDADD = libmLib.la
134assoc_t_LDFLAGS = -static
135assoc.test: assoc.t sym.in sym.ref
d5679ed0 136 ./assoc.t <sym.in >assoc.out
137 cmp assoc.out sym.ref
5c5bbeb9 138 @echo "assoc tested OK."
139
e9184b1e 140bits_t_SOURCES = bits.c
c8e26384 141bits_t_LDADD = libmLib.la
142bits_t_LDFLAGS = -static
cb114820 143bits.o: bits.c
90a332ae 144 $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/bits.c -o bits.o
d5679ed0 145bits.test: bits.t
146 ./bits.t -f $(srcdir)/bits.in
147
148base64.to: base64.c
573eadb5 149 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
150 $(srcdir)/base64.c -o base64.to
d5679ed0 151base64.t: base64.to base64.o libmLib.la
573eadb5 152 $(CC) $(CFLAGS) $(LDFLAGS) \
153 base64.to .libs/libmLib.a $(LIBS) -o base64.t
d5679ed0 154base64.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
161hex.to: hex.c
573eadb5 162 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
163 $(srcdir)/hex.c -o hex.to
d5679ed0 164hex.t: hex.to hex.o libmLib.la
573eadb5 165 $(CC) $(CFLAGS) $(LDFLAGS) \
166 hex.to .libs/libmLib.a $(LIBS) -o hex.t
d5679ed0 167hex.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."
e9184b1e 173
573eadb5 174unihash.to: unihash.c
175 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
176 $(srcdir)/unihash.c -o unihash.to
177unihash.t: unihash.to libmLib.la
178 $(CC) $(CFLAGS) $(LDFLAGS) \
179 unihash.to .libs/libmLib.a $(LIBS) -o unihash.t
180unihash.in: unihash-check.pl
181 perl $(srcdir)/unihash-check.pl >unihash.in.new
182 mv unihash.in.new unihash.in
183unihash.test: unihash.t unihash.in
184 ./unihash.t -f unihash.in
185
21c22b5c 186TEST_CLEAN = \
573eadb5 187 *.t *.to \
d5679ed0 188 da.in da.ref da.out \
189 sym.in sym.ref sym.out \
573eadb5 190 base64.out hex.out unihash.in
21c22b5c 191
192TEST_DIST = \
193 da-gtest da-ref \
e9184b1e 194 sym-gtest sym-ref \
d5679ed0 195 bits.in bits-testgen.c \
196 base64.in base64.ref hex.in hex.ref
21c22b5c 197
891a96e4 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
14d7100d 203bres$(EXEEXT): bres-stnd.o
891a96e4 204 $(LINK) -o bres bres-stnd.o $(LIBS)
205
206bres-stnd.o: $(srcdir)/bres.c
207 $(COMPILE) -c -DBRES_STANDALONE -o bres-stnd.o $(srcdir)/bres.c
208
c7f30b36 209bres.lo: $(srcdir)/bres.c
90a332ae 210 $(LTCOMPILE) -c -DBRES_SERVER="\"$(libexecdir)/$(PACKAGE)/`echo bres|sed '$(transform)'`\"" $(srcdir)/bres.c
891a96e4 211
212## --- Other useful rules ---
c255a2ee 213
214install-man:
a9f61b5f 215 (cd man && $(MAKE) install-man)
c3b137c8 216uninstall-man:
217 (cd man && $(MAKE) uninstall-man)
c255a2ee 218
58084d9f 219CLEANFILES = $(TEST_CLEAN) crc32-tab.c
220DISTCLEANFILES = libtool
471f9daa 221EXTRA_DIST = \
222 $(TEST_DIST) maninst \
75721625 223 debian/rules debian/copyright debian/control debian/changelog
21c22b5c 224
8f207948 225##----- That's all, folks ---------------------------------------------------