7adc8d831ea8a1ff9c2125509c611915442b43b3
[u/mdw/catacomb] / Makefile.m4
1 ## -*-m4-*-
2 ##
3 ## $Id: Makefile.m4,v 1.76 2004/04/01 12:59:40 mdw Exp $
4 ##
5 ## Makefile for Catacomb
6 ##
7 ## (c) 1999 Straylight/Edgeware
8 ##
9
10 ##----- Licensing notice ----------------------------------------------------
11 ##
12 ## This file is part of Catacomb.
13 ##
14 ## Catacomb 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 ## Catacomb 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 Catacomb; if not, write to the Free
26 ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 ## MA 02111-1307, USA.
28
29 ##----- Revision history ----------------------------------------------------
30 ##
31 ## $Log: Makefile.m4,v $
32 ## Revision 1.76 2004/04/01 12:59:40 mdw
33 ## Ooops! qdparse needs mp headers.
34 ##
35 ## Revision 1.75 2004/04/01 12:50:09 mdw
36 ## Add cyclic group abstraction, with test code. Separate off exponentation
37 ## functions for better static linking. Fix a buttload of bugs on the way.
38 ## Generally ensure that negative exponents do inversion correctly. Add
39 ## table of standard prime-field subgroups. (Binary field subgroups are
40 ## currently unimplemented but easy to add if anyone ever finds a good one.)
41 ##
42 ## Revision 1.74 2004/03/28 01:58:47 mdw
43 ## Generate, store and retreive elliptic curve keys.
44 ##
45 ## Revision 1.73 2004/03/27 18:38:00 mdw
46 ## Fix distribution.
47 ##
48 ## Revision 1.72 2004/03/27 17:55:11 mdw
49 ## Run ec-info test.
50 ##
51 ## Revision 1.71 2004/03/27 17:54:11 mdw
52 ## Standard curves and curve checking.
53 ##
54 ## Revision 1.70 2004/03/27 00:04:46 mdw
55 ## Implement efficient reduction for pleasant-looking primes.
56 ##
57 ## Revision 1.69 2004/03/23 15:19:32 mdw
58 ## Test elliptic curves more thoroughly.
59 ##
60 ## Revision 1.68 2004/03/21 23:03:30 mdw
61 ## Distribute headers properly.
62 ##
63 ## Revision 1.67 2004/03/21 22:52:06 mdw
64 ## Merge and close elliptic curve branch.
65 ##
66 ## Revision 1.60.2.2 2004/03/21 22:39:46 mdw
67 ## Elliptic curves on binary fields work.
68 ##
69 ## Revision 1.60.2.1 2003/06/10 13:43:53 mdw
70 ## Simple (non-projective) curves over prime fields now seem to work.
71 ##
72 ## Revision 1.66 2004/03/21 22:43:50 mdw
73 ## New hash variant SHA224.
74 ##
75 ## Revision 1.65 2003/11/29 23:39:36 mdw
76 ## Debianization.
77 ##
78 ## Revision 1.64 2003/11/10 22:18:30 mdw
79 ## Build fixes.
80 ##
81 ## Revision 1.63 2003/10/17 16:30:46 mdw
82 ## Report errors if key files don't exist!
83 ##
84 ## Revision 1.62 2003/10/12 15:02:09 mdw
85 ## Reliability fixes.
86 ##
87 ## Revision 1.61 2003/10/11 21:02:33 mdw
88 ## Import buf stuff from tripe.
89 ##
90 ## Revision 1.60 2003/05/16 01:12:37 mdw
91 ## Ship `rc2-tab.h' and `skipjack-tab.h'.
92 ##
93 ## Revision 1.59 2003/05/16 00:54:50 mdw
94 ## Install pixie to fake root if wanted. Ship `desx-tab.h'
95 ##
96 ## Revision 1.58 2002/10/19 17:56:50 mdw
97 ## Fix bit operations. Test them (a bit) better.
98 ##
99 ## Revision 1.57 2002/10/15 22:58:29 mdw
100 ## Fast estimation of number representation lengths.
101 ##
102 ## Revision 1.56 2001/06/16 13:01:10 mdw
103 ## New source files and tests.
104 ##
105 ## Revision 1.55 2001/05/08 22:17:41 mdw
106 ## New cipher Noekeon added.
107 ##
108 ## Revision 1.54 2001/05/07 17:32:52 mdw
109 ## New Rijndael block sizes.
110 ##
111 ## Revision 1.53 2001/04/29 18:11:19 mdw
112 ## New block cipher MARS.
113 ##
114 ## Revision 1.52 2001/04/29 17:37:35 mdw
115 ## Added SAFER block cipher.
116 ##
117 ## Revision 1.51 2001/04/19 18:26:32 mdw
118 ## Add CRC as another hash function.
119 ##
120 ## Revision 1.50 2001/04/06 22:05:10 mdw
121 ## Add support for SSL pseudo-random function.
122 ##
123 ## Revision 1.49 2001/04/04 20:10:52 mdw
124 ## Add support for the TLS pseudo-random function.
125 ##
126 ## Revision 1.48 2001/04/03 19:36:50 mdw
127 ## New block cipher DESX added.
128 ##
129 ## Revision 1.47 2001/03/03 13:14:13 mdw
130 ## Distribute md2-tab.h
131 ##
132 ## Revision 1.46 2001/02/21 20:03:22 mdw
133 ## Added support for MD2 hash function.
134 ##
135 ## Revision 1.45 2001/02/03 16:09:41 mdw
136 ## New files added.
137 ##
138 ## Revision 1.44 2000/10/15 17:49:00 mdw
139 ## New SHA variants with longer outputs.
140 ##
141 ## Revision 1.43 2000/10/08 16:01:26 mdw
142 ## Add binary poly arithmetic. Tidy table generation stuff. Distribute
143 ## calc prototypes.
144 ##
145 ## Revision 1.42 2000/10/08 12:16:06 mdw
146 ## Remove vestiges of @primorial@.
147 ##
148 ## Revision 1.41 2000/08/15 21:46:20 mdw
149 ## Set up the dependencies on primetab.[ch] and mptypes.h properly.
150 ## There's some m4 hacking, but it's worth it not to have to recompile all
151 ## the cipher modes.
152 ##
153 ## Revision 1.40 2000/08/06 10:50:55 mdw
154 ## (mkphrase): New program for generating random passphrases with measured
155 ## strength.
156 ##
157 ## Revision 1.39 2000/07/29 21:55:32 mdw
158 ## Make sure the pixie is installed setuid-root (workaround for an Automake
159 ## bug). Install new manpages.
160 ##
161 ## Revision 1.38 2000/07/29 10:54:55 mdw
162 ## Further fixing to support building using normal `make' again. ;-) I
163 ## think we're there now.
164 ##
165 ## Revision 1.37 2000/07/29 10:02:36 mdw
166 ## Lots of fixing to support `make -j' building.
167 ##
168 ## Revision 1.36 2000/07/20 20:13:38 mdw
169 ## Added Bellare and Rogaway's PSS encoding for RSA signatures.
170 ##
171 ## Revision 1.35 2000/07/16 20:00:46 mdw
172 ## Bug fixes to distribution.
173 ##
174 ## Revision 1.34 2000/07/15 20:55:32 mdw
175 ## More hashes and ciphers. An extra tool.
176 ##
177 ## Revision 1.33 2000/07/09 21:34:15 mdw
178 ## New hash functions and other stuff.
179 ##
180 ## Revision 1.32 2000/07/01 11:27:32 mdw
181 ## Name changes and new files.
182 ##
183 ## Revision 1.31 2000/06/25 13:02:07 mdw
184 ## Fix cleaning of generated files.
185 ##
186 ## Revision 1.30 2000/06/22 19:10:33 mdw
187 ## Fix Makefile to test mp-sqrt.c.
188 ##
189 ## Revision 1.29 2000/06/22 19:04:19 mdw
190 ## More new functions to be added.
191 ##
192 ## Revision 1.28 2000/06/18 23:31:18 mdw
193 ## Rearrange build order to ensure that `mptypes.h' exists by the time it's
194 ## needed.
195 ##
196 ## Revision 1.27 2000/06/17 13:28:50 mdw
197 ## Minor tidying and fixing.
198 ##
199 ## Revision 1.26 2000/06/17 10:33:43 mdw
200 ## Lots of new ciphers and other files.
201 ##
202 ## Revision 1.25 2000/02/12 18:55:40 mdw
203 ## Make it all compile properly.
204 ##
205 ## Revision 1.24 2000/02/12 18:22:26 mdw
206 ## Missed a file. Whoops.
207 ##
208 ## Revision 1.23 2000/02/12 18:21:01 mdw
209 ## Overhaul of key management (again).
210 ##
211 ## Revision 1.22 1999/12/22 16:04:06 mdw
212 ## Lots of new files.
213 ##
214 ## Revision 1.21 1999/12/13 15:47:58 mdw
215 ## Fix a couple of minor bugs in the distribution set.
216 ##
217 ## Revision 1.19 1999/12/11 10:58:24 mdw
218 ## Fix bug in test rig link flags. Add Karatsuba squaring.
219 ##
220 ## Revision 1.18 1999/12/10 23:30:01 mdw
221 ## Lots of new files.
222 ##
223 ## Revision 1.17 1999/11/25 11:38:31 mdw
224 ## Support for conversions between MPs and C integers.
225 ##
226 ## Revision 1.16 1999/11/22 20:51:33 mdw
227 ## Add yet more source files.
228 ##
229 ## Revision 1.15 1999/11/22 14:08:30 mdw
230 ## Improve dependencies for test programs.
231 ##
232 ## Revision 1.14 1999/11/22 00:17:09 mdw
233 ## Create object files for test programs so that rebuilding doesn't take so
234 ## long.
235 ##
236 ## Revision 1.12 1999/11/20 22:36:26 mdw
237 ## Improve dependencies. Move mpx testing into mpx.c.
238 ##
239 ## Revision 1.11 1999/11/20 22:24:53 mdw
240 ## Add Diffie-Hellman support.
241 ##
242 ## Revision 1.10 1999/11/19 19:28:24 mdw
243 ## Add DSA files and tests.
244 ##
245 ## Revision 1.9 1999/11/17 18:05:35 mdw
246 ## Many new files and test cases for multiprecision arithmetic.
247 ##
248 ## Revision 1.8 1999/11/13 01:56:07 mdw
249 ## Include multiprecision maths stuff.
250 ##
251 ## Revision 1.7 1999/11/11 19:01:02 mdw
252 ## Use `libtool' to generate a shared library.
253 ##
254 ## Revision 1.6 1999/11/11 17:47:34 mdw
255 ## Updates for new configuration system, and `mptypes' generator.
256 ##
257 ## Revision 1.5 1999/11/11 00:59:17 mdw
258 ## Minor reformatting.
259 ##
260 ## Revision 1.4 1999/10/24 10:20:36 mdw
261 ## Modify for standalone distribution. The library's getting far too large
262 ## to be sensibly embedded in other programs.
263 ##
264 ## Revision 1.3 1999/10/24 10:04:26 mdw
265 ## Install headers in the right directory.
266 ##
267 ## Revision 1.2 1999/10/23 12:55:35 mdw
268 ## The `CVS' directory can't be hardlinked. Don't worry about this
269 ## overmuch.
270 ##
271 ## Revision 1.1 1999/09/03 08:41:11 mdw
272 ## Initial import.
273 ##
274
275 AUTOMAKE_OPTIONS = foreign
276
277 SUBDIRS = tests
278
279 archincludedir = $(libdir)/catacomb/include
280
281 ## --- List handling macros ---
282 ##
283 ## List handling is nice, usually. Unfortunately, I based this design on
284 ## TeX list macros rather than anything sensible...
285
286 define(`_', `define(`_item', $1)define(`_item_2', $2)emit`'')
287 define(`adorn', `pushdef(`emit', `$1`'_item`'$3')$2`'popdef(`emit')')
288 define(`join',
289 `pushdef(`emit', `adorn(``_(''_item`$2', `$3', ``)'')`'')$1`'popdef(`emit')')
290 define(`addsuffix', `adorn(`', `$1', `$2')')
291 define(`lit', `adorn(`', `$1', `')')
292 define(`nl', `
293 ')
294
295 define(`allwithsuffix',
296 `addsuffix(`$1', `$3') addsuffix(`$2', `$3') dnl
297 addsuffix(join(`$1', `-', `$2'), `$3')')
298
299 ## --- Autogenerated source files ---
300
301 define(`ciphers', `dnl
302 _(des) _(desx) _(des3) _(mars) dnl
303 _(idea) _(safer) _(safersk) dnl
304 _(blowfish) _(twofish) dnl
305 _(tea) _(xtea) dnl
306 _(rc2) _(rc5) dnl
307 _(skipjack) dnl
308 _(cast128) _(cast256) dnl
309 _(square) _(rijndael) _(rijndael192) _(rijndael256) dnl
310 _(serpent) _(noekeon)')
311 define(`cipher_modes', `_(ecb) _(cbc) _(cfb) _(ofb) _(counter)')
312
313 define(`hashes', `dnl
314 _(md5) _(md4) _(md2) _(tiger) dnl
315 _(sha) _(sha224) _(sha256) _(sha384) _(sha512) dnl
316 _(rmd128) _(rmd160) _(rmd256) _(rmd320)')
317 define(`hash_modes', `_(mgf) _(hmac)')
318
319 MODES = \
320 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.c') \
321 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.h') \
322 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.c') \
323 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.h')
324
325 $(MODES): modes-stamp
326 modes-stamp: genmodes
327 cd $(srcdir); ./genmodes "lit(`ciphers')" "lit(`cipher_modes')"
328 cd $(srcdir); ./genmodes "lit(`hashes')" "lit(`hash_modes')"
329 echo datestamp >modes-stamp
330
331 define(`gen_tables', `dnl
332 _(des) _(blowfish) _(twofish) dnl
333 _(square) _(rijndael) dnl
334 _(safer) _(mars) _(tiger) dnl
335 _(gfshare) _(gfx-sqr)')
336
337 autoheaders: addsuffix(`gen_tables', `-tab.h') primetab.h mptypes.h
338 define(`emit', `
339 _item`'-tab.h: _item`'-mktab
340 ./_item`'-mktab >_item`'-tab.h.new
341 mv _item`'-tab.h.new _item`'-tab.h')dnl
342 gen_tables
343
344 primetab.h: primetab.c
345 primetab.c: genprimes
346 ./genprimes -h primetab.h -c primetab.c \
347 -s CATACOMB_PRIMETAB_H -n 256 \
348 -t "unsigned short" -i primetab
349 archinclude_HEADERS = mptypes.h
350 mptypes.h: mptypes
351 ./mptypes >mptypes.h.new
352 mv mptypes.h.new mptypes.h
353
354 ectab.c: ectab.in ec-gentab.sh mpdump
355 $(srcdir)/ec-gentab.sh <$(srcdir)/ectab.in >ectab.c.new
356 mv ectab.c.new ectab.c
357
358 ptab.c: ptab.in p-gentab.sh mpdump
359 $(srcdir)/p-gentab.sh <$(srcdir)/ptab.in >ptab.c.new
360 mv ptab.c.new ptab.c
361
362 BUILT_SOURCES = \
363 getdate.c modes-stamp \
364 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
365 addsuffix(join(`ciphers', `-', `cipher_modes'), `.h') \
366 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
367 addsuffix(join(`hashes', `-', `hash_modes'), `.h')
368
369 ## --- Building the main library ---
370
371 lib_LTLIBRARIES = libcatacomb.la
372
373 libcatacomb_la_LDFLAGS = -version-info 3:0:1
374 ## Middle number is the patchlevel. Final number is the minor version. The
375 ## difference between the first and last numbers is major version.
376
377 pkginclude_HEADERS = \
378 arena.h paranoia.h buf.h qdparse.h \
379 blkc.h hash.h gcipher.h ghash.h gmac.h grand.h ghash-def.h \
380 lcrand.h fibrand.h rc4.h seal.h rand.h noise.h fipstest.h maurer.h \
381 key.h key-data.h passphrase.h pixie.h lmem.h \
382 mpx.h bitops.h mpw.h mpscan.h mparena.h mp.h mptext.h mpint.h \
383 exp.h mpbarrett.h mpmont.h mpreduce.h \
384 mpcrt.h mprand.h mpmul.h \
385 gfx.h gf.h gfreduce.h \
386 primetab.h pfilt.h rabin.h \
387 pgen.h prim.h strongprime.h limlee.h keycheck.h \
388 bbs.h rsa.h dh.h dsarand.h dsa.h \
389 oaep.h pkcs1.h pss.h tlsprf.h sslprf.h \
390 gfshare.h share.h \
391 rho.h \
392 field.h ec.h ec-exp.h ec-test.h ectab.h ec-keys.h \
393 ptab.h group.h \
394 allwithsuffix(`ciphers', `cipher_modes', `.h') \
395 allwithsuffix(`hashes', `hash_modes', `.h') \
396 addsuffix(`cipher_modes', `-def.h') \
397 addsuffix(`hash_modes', `-def.h') crc32.h
398
399 define(`MP_SOURCES',
400 `mpx.c mpx-kmul.c mpx-ksqr.c mpscan.c mparena.c qdparse.c \
401 mp-misc.c mp-mem.c mp-const.c mp-io.c mp-arith.c mp-test.c \
402 mp-sqrt.c mp-gcd.c mp-jacobi.c mp-modsqrt.c \
403 mpint.c mptext.c mptext-file.c mptext-string.c mptext-dstr.c \
404 mptext-len.c \
405 exp.c mpcrt.c mpmul.c mprand.c \
406 mpbarrett.c mpbarrett-exp.c mpbarrett-mexp.c mpbarrett-exp.h \
407 mpmont.c mpmont-exp.c mpmont-mexp.c mpmont-exp.h \
408 mpreduce.c mpreduce-exp.h \
409 group-stdops.c group-exp.c group-exp.h g-prime.c group-parse.c \
410 group-string.c group-file.c group-dstr.c \
411 rho.c buf.c ptab.c \
412 GF_SOURCES PGEN_SOURCES EC_SOURCES')
413
414 define(`GF_SOURCES',
415 `gfx.c gfx-kmul.c gfx-sqr.c gf-arith.c gf-gcd.c \
416 gfreduce.c gfreduce-exp.h')
417
418 define(`EC_SOURCES',
419 `field.c field-parse.c f-prime.c f-niceprime.c f-binpoly.c \
420 ec.c ec-exp.c ec-prime.c ec-bin.c ec-test.c ec-info.c ectab.c \
421 ec-fetch.c g-ec.c')
422
423 define(`PGEN_SOURCES',
424 `pfilt.c rabin.c \
425 pgen.c pgen-stdev.c pgen-safe.c pgen-gcd.c prim.c strongprime.c \
426 limlee.c \
427 keycheck.c keycheck-mp.c keycheck-report.c \
428 bbs-rand.c bbs-gen.c bbs-jump.c bbs-fetch.c \
429 rsa-priv.c rsa-pub.c rsa-gen.c rsa-recover.c rsa-fetch.c \
430 dh-gen.c dh-limlee.c dh-check.c dh-fetch.c dh-param.c \
431 dsarand.c dsa-sign.c dsa-verify.c dsa-gen.c dsa-check.c \
432 key-data.c key-flags.c key-text.c key-binary.c key-pass.c \
433 key-pack.c key-misc.c key-file.c key-attr.c key-io.c key-moan.c \
434 key-error.c key-fetch.c \
435 primetab.c share.c')
436
437 libcatacomb_la_SOURCES = \
438 grand.c keysz.c \
439 lcrand.c fibrand.c rc4.c seal.c rand.c noise.c fipstest.c maurer.c \
440 arena.c \
441 passphrase.c pixie-client.c pixie-common.c lmem.c \
442 oaep.c pkcs1.c pss.c tlsprf.c sslprf.c \
443 gfshare.c \
444 MP_SOURCES karatsuba.h \
445 des-base.c des-base.h \
446 desx-tab.h \
447 rc2-tab.h \
448 skipjack-tab.h \
449 cast-s.c cast-sk.c cast-base.h cast-tab.h \
450 rijndael-base.c rijndael-base.h \
451 md2-tab.h \
452 serpent-sbox.h skipjack-tab.h tiger-base.h \
453 daftstory.h \
454 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
455 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
456 addsuffix(`ciphers', `.c') addsuffix(`hashes', `.c') crc32.c
457
458 des-base.lo: des-tab.h
459 blowfish.lo: blowfish-tab.h
460 twofish.lo: twofish-tab.h
461 square.lo: square-tab.h
462 rijndael-base.lo: rijndael-tab.h
463 safer.lo: safer-tab.h
464 mars.lo: mars-tab.h
465 tiger.lo: tiger-tab.h
466 gfshare.lo: gfshare-tab.h
467 gfx-sqr.lo: gfx-sqr-tab.h
468 patsubst(MP_SOURCES, `\.c\>', `.lo') dsig.o keyutil.o rspit.o: \
469 mptypes.h primetab.h
470
471 ## --- Utility programs ---
472
473 bin_PROGRAMS = dsig key pixie rspit factorial hashsum mkphrase
474 bin_SCRIPTS = catacomb-config xpixie
475 noinst_PROGRAMS = \
476 genprimes mptypes serpent-check bittest mpdump \
477 addsuffix(`gen_tables', `-mktab')
478 LDADD = libcatacomb.la
479
480 dsig_SOURCES = dsig.c getdate.y getdate.h
481 key_SOURCES = keyutil.c getdate.y getdate.h
482 hashsum_SOURCES = hashsum.c
483 rspit_SOURCES = rspit.c
484 factorial_SOURCES = factorial.c
485 pixie_SOURCES = pixie.c pixie-common.c lmem.c arena.c
486 pixie_LDADD =
487 mkphrase_SOURCES = mkphrase.c
488 bittest_SOURCES = bittest.c
489 bittest_LDADD =
490
491 define(`emit', `
492 patsubst(_item, `[^a-zA-Z0-9]', `_')_mktab_SOURCES = _item`'-mktab.c
493 patsubst(_item, `[^a-zA-Z0-9]', `_')_mktab_LDADD =')dnl
494 gen_tables
495
496 serpent_check_SOURCES = serpent-check.c
497 serpent_check_LDADD =
498
499 genprimes_SOURCES = genprimes.c
500 genprimes_LDADD =
501
502 mptypes_SOURCES = mptypes.c
503 mptypes_LDADD =
504
505 mpdump_SOURCES = \
506 mpdump.c \
507 mpx.c mpx-kmul.c mpx-ksqr.c mpscan.c mparena.c \
508 mp-misc.c mp-mem.c mp-const.c mp-arith.c mp-io.c \
509 mptext.c mptext-string.c
510 mpdump_LDADD =
511
512 ## --- Install the pixie setuid-root if we can ---
513 ##
514 ## Bodge around a bug in Automake: it doesn't call `install-exec-hook' from
515 ## `install' if there are subdirectories.
516
517 changequote(<, >)
518 install: install-exec-hook
519 install-exec-hook:
520 @pixie="$(DESTDIR)$(bindir)/`echo pixie|sed $(transform)`"; \
521 if chown root $$pixie && chmod 4755 $$pixie; then \
522 echo "chown root $$pixie"; \
523 echo "chmod 4755 $$pixie"; \
524 else \
525 echo "***"; \
526 echo "*** You should probably install $$pixie setuid-root."; \
527 echo "***"; \
528 fi
529 changequote(`, ')
530
531 ## --- Documentation ---
532
533 man_MANS = key.1 hashsum.1 keyring.5 pixie.1
534
535 ## --- Other handy definitions ---
536
537 EXTRA_DIST = \
538 Makefile.m4 genmodes $(man_MANS) xpixie group-test.c \
539 ectab.in ec-gentab.sh ptab.in p-gentab.sh \
540 README.cipher README.hash README.random README.mp \
541 debian/rules debian/copyright debian/control debian/changelog \
542 debian/catacomb-bin.postinst debian/catacomb-bin.config \
543 debian/catacomb-bin.prerm debian/catacomb-bin.templates
544
545 dist-hook:
546 @ln getdate.c $(distdir) || ln $(srcdir)/getdate.c $(distdir) || true
547 @echo datestamp >$(distdir)/modes-stamp || true
548 @for i in calc tests; do \
549 mkdir $(distdir)/$$i; \
550 ln $(srcdir)/$$i/*[!~] $(distdir)/$$i; \
551 done || true
552 # kr=$$HOME/.catacomb/dsig-keyring; \
553 # if [ -r $$kr ]; then \
554 # cd $(distdir); \
555 # ../key -k $$kr extract -f -secret KEYRING; \
556 # find . -type f -print0 | ../dsig -k $$kr sign -0 -oMANIFEST; \
557 # fi
558
559 ## --- Testing ---
560
561 define(`testprogs', `')
562
563 define(`CTESTRIG',
564 `define(`testprogs', testprogs \
565 $1.t)dnl
566 $1.to: $1.c
567 $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $(srcdir)/$1.c -o $1.to
568 $1.t: $1.to libcatacomb.la
569 $(CC) $(CFLAGS) $(LDFLAGS) $1.to .libs/libcatacomb.a $(LIBS) -o $1.t')
570
571 CTESTRIG(rc4)
572 CTESTRIG(seal)
573 adorn(`nl`'CTESTRIG(', `ciphers', `)')
574 adorn(`nl`'CTESTRIG(', `hashes', `)')
575 adorn(`nl`'CTESTRIG(', join(`ciphers', `-', `cipher_modes'), `)')
576 adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
577 CTESTRIG(lcrand)
578 CTESTRIG(oaep)
579 CTESTRIG(tlsprf)
580 CTESTRIG(sslprf)
581 CTESTRIG(mpx)
582 CTESTRIG(mpx-kmul)
583 CTESTRIG(mpx-ksqr)
584 CTESTRIG(mp-arith)
585 CTESTRIG(mp-modsqrt)
586 CTESTRIG(mp-gcd)
587 CTESTRIG(mp-jacobi)
588 CTESTRIG(mp-sqrt)
589 CTESTRIG(mptext)
590 CTESTRIG(mpint)
591 CTESTRIG(mpbarrett)
592 CTESTRIG(mpbarrett-exp)
593 CTESTRIG(mpbarrett-mexp)
594 CTESTRIG(mpmont)
595 CTESTRIG(mpmont-exp)
596 CTESTRIG(mpmont-mexp)
597 CTESTRIG(mpreduce)
598 CTESTRIG(mpcrt)
599 CTESTRIG(mpmul)
600 CTESTRIG(gfx)
601 CTESTRIG(gfx-sqr)
602 CTESTRIG(gfx-kmul)
603 CTESTRIG(gf-arith)
604 CTESTRIG(gf-gcd)
605 CTESTRIG(gfreduce)
606 CTESTRIG(ec-prime)
607 CTESTRIG(ec-bin)
608 CTESTRIG(ec-test)
609 CTESTRIG(ec-info)
610 CTESTRIG(dh-param)
611 CTESTRIG(group-test)
612 CTESTRIG(pgen)
613 CTESTRIG(dsa-gen)
614 CTESTRIG(dsa-sign)
615 CTESTRIG(dsa-verify)
616 CTESTRIG(bbs-rand)
617 CTESTRIG(bbs-jump)
618 CTESTRIG(gfshare)
619 CTESTRIG(share)
620 CTESTRIG(rho)
621
622 TESTS = serpent-check bittest testprogs
623
624 CLEANFILES = \
625 *.t *.to \
626 mptypes.h primetab.c primetab.h ectab.c \
627 addsuffix(`gen_tables', `-tab.h')
628
629 ## --- Makefile building (haha!) ---
630
631 $(srcdir)/Makefile.am: $(srcdir)/Makefile.m4
632 m4 $(srcdir)/Makefile.m4 >$(srcdir)/Makefile.am.new
633 mv $(srcdir)/Makefile.am.new $(srcdir)/Makefile.am
634
635 DISTCLEANFILES = libtool
636
637 MAINTAINERCLEANFILES = \
638 $(srcdir)/Makefile.am \
639 $(srcdir)/getdate.c getdate.c \
640 $(MODES) modes-stamp $(srcdir)/modes-stamp
641
642 ##----- That's all, folks ---------------------------------------------------