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 | |
31 | AUTOMAKE_OPTIONS = foreign |
32 | |
33 | ## --- What to build --- |
34 | |
8f207948 |
35 | SUBDIRS = man |
36 | |
ae24fcf7 |
37 | bin_SCRIPTS = mLib-config |
18756bee |
38 | bin_PROGRAMS = crc-mktab unihash-mkstatic |
ae24fcf7 |
39 | |
c7f30b36 |
40 | lib_LTLIBRARIES = libmLib.la |
90a332ae |
41 | pkglibexecdir = $(libexecdir)/$(PACKAGE) |
14d7100d |
42 | pkglibexec_PROGRAMS = @BRES_LIBEXEC@ |
43 | EXTRA_PROGRAMS = bres |
0875b58f |
44 | |
64b4afc3 |
45 | pkginclude_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 \ |
1c4fa429 |
53 | base64.h base32.h hex.h mdwopt.h str.h testrig.h url.h |
0875b58f |
54 | |
55 | ## --- Things to put in the library --- |
56 | |
14d7100d |
57 | libmLib_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 |
61 | libmLib_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 \ |
1c4fa429 |
72 | base64.c base32.c hex.c mdwopt.c str.c testrig.c url.c |
14d7100d |
73 | EXTRA_libmLib_la_SOURCES = bres.c bres-adns.c |
74 | libmLib_la_LIBADD = @DEPLIBS@ |
8f207948 |
75 | |
18756bee |
76 | BUILT_SOURCES = crc32-tab.c unihash-global.c |
b7580524 |
77 | |
78 | crc32-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 |
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 |
b7580524 |
95 | |
21c22b5c |
96 | ## --- Test code --- |
97 | |
3980d2f1 |
98 | noinst_PROGRAMS = da.t sym.t assoc.t bits.t |
d04f4733 |
99 | |
100 | check: \ |
573eadb5 |
101 | da.test sym.test assoc.test bits.test base64.test hex.test \ |
1c4fa429 |
102 | base32.test \ |
573eadb5 |
103 | unihash.test |
d04f4733 |
104 | |
105 | da_t_SOURCES = da-test.c |
106 | da_t_LDADD = libmLib.la |
107 | da_t_LDFLAGS = -static |
108 | da.in: $(srcdir)/da-gtest |
c5775f49 |
109 | perl $(srcdir)/da-gtest 10000 >da.in.new |
110 | mv da.in.new da.in |
d04f4733 |
111 | da.ref: da.in $(srcdir)/da-ref |
c5775f49 |
112 | perl $(srcdir)/da-ref <da.in >da.ref.new |
113 | mv da.ref.new da.ref |
d04f4733 |
114 | da.test: da.t da.in da.ref |
d5679ed0 |
115 | ./da.t <da.in >da.out |
116 | cmp da.out da.ref |
21c22b5c |
117 | @echo "darray tested OK." |
118 | |
d04f4733 |
119 | sym_t_SOURCES = sym-test.c |
120 | sym_t_LDADD = libmLib.la |
121 | sym_t_LDFLAGS = -static |
122 | sym.in: $(srcdir)/sym-gtest |
c5775f49 |
123 | perl $(srcdir)/sym-gtest 10000 >sym.in.new |
124 | mv sym.in.new sym.in |
d04f4733 |
125 | sym.ref: sym.in $(srcdir)/sym-ref |
c5775f49 |
126 | perl $(srcdir)/sym-ref <sym.in >sym.ref.new |
127 | mv sym.ref.new sym.ref |
d04f4733 |
128 | sym.test: sym.t sym.in sym.ref |
d5679ed0 |
129 | ./sym.t <sym.in >sym.out |
130 | cmp sym.out sym.ref |
21c22b5c |
131 | @echo "sym tested OK." |
132 | |
d04f4733 |
133 | assoc_t_SOURCES = assoc-test.c |
134 | assoc_t_LDADD = libmLib.la |
135 | assoc_t_LDFLAGS = -static |
136 | assoc.test: assoc.t sym.in sym.ref |
d5679ed0 |
137 | ./assoc.t <sym.in >assoc.out |
138 | cmp assoc.out sym.ref |
5c5bbeb9 |
139 | @echo "assoc tested OK." |
140 | |
e9184b1e |
141 | bits_t_SOURCES = bits.c |
c8e26384 |
142 | bits_t_LDADD = libmLib.la |
143 | bits_t_LDFLAGS = -static |
cb114820 |
144 | bits.o: bits.c |
90a332ae |
145 | $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/bits.c -o bits.o |
d5679ed0 |
146 | bits.test: bits.t |
147 | ./bits.t -f $(srcdir)/bits.in |
148 | |
149 | base64.to: base64.c |
573eadb5 |
150 | $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \ |
151 | $(srcdir)/base64.c -o base64.to |
d5679ed0 |
152 | base64.t: base64.to base64.o libmLib.la |
573eadb5 |
153 | $(CC) $(CFLAGS) $(LDFLAGS) \ |
154 | base64.to .libs/libmLib.a $(LIBS) -o base64.t |
d5679ed0 |
155 | base64.test: base64.t base64.in base64.ref |
156 | ./base64.t <$(srcdir)/base64.in >base64.out |
157 | cmp base64.out $(srcdir)/base64.ref |
158 | ./base64.t -d <$(srcdir)/base64.ref >base64.out |
159 | cmp base64.out $(srcdir)/base64.in |
160 | @echo "base64 tested OK." |
161 | |
1c4fa429 |
162 | base32.to: base32.c |
163 | $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \ |
164 | $(srcdir)/base32.c -o base32.to |
165 | base32.t: base32.to base32.o libmLib.la |
166 | $(CC) $(CFLAGS) $(LDFLAGS) \ |
167 | base32.to .libs/libmLib.a $(LIBS) -o base32.t |
168 | base32.test: base32.t base32.in base32.ref |
169 | ./base32.t <$(srcdir)/base32.in >base32.out |
170 | cmp base32.out $(srcdir)/base32.ref |
171 | ./base32.t -d <$(srcdir)/base32.ref >base32.out |
172 | cmp base32.out $(srcdir)/base32.in |
173 | @echo "base32 tested OK." |
174 | |
d5679ed0 |
175 | hex.to: hex.c |
573eadb5 |
176 | $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \ |
177 | $(srcdir)/hex.c -o hex.to |
d5679ed0 |
178 | hex.t: hex.to hex.o libmLib.la |
573eadb5 |
179 | $(CC) $(CFLAGS) $(LDFLAGS) \ |
180 | hex.to .libs/libmLib.a $(LIBS) -o hex.t |
d5679ed0 |
181 | hex.test: hex.t hex.in hex.ref |
182 | ./hex.t <$(srcdir)/hex.in >hex.out |
183 | cmp hex.out $(srcdir)/hex.ref |
184 | ./hex.t -d <$(srcdir)/hex.ref >hex.out |
185 | cmp hex.out $(srcdir)/hex.in |
186 | @echo "hex tested OK." |
e9184b1e |
187 | |
573eadb5 |
188 | unihash.to: unihash.c |
189 | $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \ |
190 | $(srcdir)/unihash.c -o unihash.to |
191 | unihash.t: unihash.to libmLib.la |
192 | $(CC) $(CFLAGS) $(LDFLAGS) \ |
193 | unihash.to .libs/libmLib.a $(LIBS) -o unihash.t |
194 | unihash.in: unihash-check.pl |
195 | perl $(srcdir)/unihash-check.pl >unihash.in.new |
3cbb08ea |
196 | mv unihash.in.new $(srcdir)/unihash.in |
573eadb5 |
197 | unihash.test: unihash.t unihash.in |
3cbb08ea |
198 | ./unihash.t -f $(srcdir)/unihash.in |
573eadb5 |
199 | |
21c22b5c |
200 | TEST_CLEAN = \ |
573eadb5 |
201 | *.t *.to \ |
d5679ed0 |
202 | da.in da.ref da.out \ |
203 | sym.in sym.ref sym.out \ |
1c4fa429 |
204 | base64.out base32.out hex.out unihash.in |
21c22b5c |
205 | |
206 | TEST_DIST = \ |
207 | da-gtest da-ref \ |
e9184b1e |
208 | sym-gtest sym-ref \ |
d5679ed0 |
209 | bits.in bits-testgen.c \ |
3cbb08ea |
210 | unihash-check.pl unihash.in \ |
1c4fa429 |
211 | base64.in base64.ref base32.in base32.ref hex.in hex.ref |
21c22b5c |
212 | |
891a96e4 |
213 | ## --- Background resolver --- |
214 | ## |
215 | ## I must (a) build the standalone version, and (b) inform the client library |
216 | ## where the standalone version is. |
217 | |
14d7100d |
218 | bres$(EXEEXT): bres-stnd.o |
891a96e4 |
219 | $(LINK) -o bres bres-stnd.o $(LIBS) |
220 | |
221 | bres-stnd.o: $(srcdir)/bres.c |
222 | $(COMPILE) -c -DBRES_STANDALONE -o bres-stnd.o $(srcdir)/bres.c |
223 | |
c7f30b36 |
224 | bres.lo: $(srcdir)/bres.c |
90a332ae |
225 | $(LTCOMPILE) -c -DBRES_SERVER="\"$(libexecdir)/$(PACKAGE)/`echo bres|sed '$(transform)'`\"" $(srcdir)/bres.c |
891a96e4 |
226 | |
227 | ## --- Other useful rules --- |
c255a2ee |
228 | |
229 | install-man: |
a9f61b5f |
230 | (cd man && $(MAKE) install-man) |
c3b137c8 |
231 | uninstall-man: |
232 | (cd man && $(MAKE) uninstall-man) |
c255a2ee |
233 | |
58084d9f |
234 | CLEANFILES = $(TEST_CLEAN) crc32-tab.c |
235 | DISTCLEANFILES = libtool |
471f9daa |
236 | EXTRA_DIST = \ |
237 | $(TEST_DIST) maninst \ |
75721625 |
238 | debian/rules debian/copyright debian/control debian/changelog |
21c22b5c |
239 | |
8f207948 |
240 | ##----- That's all, folks --------------------------------------------------- |