Implementation of the Digital Signature Algorithm.
[u/mdw/catacomb] / Makefile.m4
1 ## -*-makefile-*-
2 ##
3 ## $Id: Makefile.m4,v 1.9 1999/11/17 18:05:35 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.9 1999/11/17 18:05:35 mdw
33 ## Many new files and test cases for multiprecision arithmetic.
34 ##
35 ## Revision 1.9 1999/11/17 18:05:35 mdw
36 ## Many new files and test cases for multiprecision arithmetic.
37 ##
38 ## Revision 1.8 1999/11/13 01:56:07 mdw
39 ## Include multiprecision maths stuff.
40 ##
41 ## Revision 1.7 1999/11/11 19:01:02 mdw
42 ## Use `libtool' to generate a shared library.
43 ##
44 ## Revision 1.6 1999/11/11 17:47:34 mdw
45 ## Updates for new configuration system, and `mptypes' generator.
46 ##
47 ## Revision 1.5 1999/11/11 00:59:17 mdw
48 ## Minor reformatting.
49 ##
50 ## Revision 1.4 1999/10/24 10:20:36 mdw
51 ## Modify for standalone distribution. The library's getting far too large
52 ## to be sensibly embedded in other programs.
53 ##
54 ## Revision 1.3 1999/10/24 10:04:26 mdw
55 ## Install headers in the right directory.
56 ##
57 ## Revision 1.2 1999/10/23 12:55:35 mdw
58 ## The `CVS' directory can't be hardlinked. Don't worry about this
59 ## overmuch.
60 ##
61 ## Revision 1.1 1999/09/03 08:41:11 mdw
62 ## Initial import.
63 ##
64
65 AUTOMAKE_OPTIONS = foreign
66
67 archincludedir = $(libdir)/catacomb/include
68
69 ## --- List handling macros ---
70 ##
71 ## List handling is nice, usually. Unfortunately, I based this design on
72 ## TeX list macros rather than anything sensible...
73
74 define(`_', `define(`_item', $1)define(`_item_2', $2)emit`'')
75 define(`adorn', `pushdef(`emit', `$1`'_item`'$3')$2`'popdef(`emit')')
76 define(`join',
77 `pushdef(`emit', `adorn(``_(''_item`$2', `$3', ``)'')`'')$1`'popdef(`emit')')
78 define(`addsuffix', `adorn(`', `$1', `$2')')
79 define(`lit', `adorn(`', `$1', `')')
80 define(`nl', `
81 ')
82
83 define(`allwithsuffix',
84 `addsuffix(`$1', `$3') addsuffix(`$2', `$3') dnl
85 addsuffix(join(`$1', `-', `$2'), `$3')')
86
87 ## --- Autogenerated source files ---
88
89 define(`ciphers', `_(des) _(des3) _(blowfish) _(idea) _(rc5)')
90 define(`cipher_modes', `_(ecb) _(cbc) _(cfb) _(ofb)')
91
92 define(`hashes', `_(md5) _(md4) _(rmd160) _(sha)')
93 define(`hash_modes', `_(hmac)')
94
95 MODES = \
96 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.c') \
97 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.h') \
98 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.c') \
99 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.h')
100
101 $(MODES): $(srcdir)/genmodes
102 $(srcdir)/des_sp.h: des-mktab
103 ./des-mktab >$(srcdir)/des_sp.h
104
105 ptab.c ptab.h: genprimes
106 ./genprimes -h ptab.h -c ptab.c -m 256 -t "unsigned char" -i ptab
107
108 archinclude_HEADERS = mptypes.h
109
110 mptypes.h: mptypes
111 des_sp.h \
112 ./mptypes >mptypes.h
113
114 BUILT_SOURCES = \
115 getdate.c \
116 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
117 addsuffix(join(`ciphers', `-', `cipher_modes'), `.h') \
118 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
119 addsuffix(join(`hashes', `-', `hash_modes'), `.h')
120
121 ## --- Building the main library ---
122 libcatacomb_la_LDFLAGS = -version-info 0:3:0
123 lib_LTLIBRARIES = libcatacomb.la
124
125 libcatacomb_la_LDFLAGS = -version-info 0:4:0
126 ## Middle number is the patchlevel. Final number is the minor version. The
127 ## difference between the first and last numbers is major version.
128
129 define(`emit', `$1.h ')
130 pkginclude_HEADERS = \
131 paranoia.h \
132 blkc.h hash.h \
133 rc4.h \
134 mpx.h mpw.h mpscan.h mparena.h mp.h mptext.h mpmont.h \
135 ptab.h pgen.h rabin.h \
136 dsa.h dh.h \
137 allwithsuffix(`ciphers', `cipher_modes', `.h') \
138 allwithsuffix(`hashes', `hash_modes', `.h')
139
140 define(`emit', `$1.c ')
141 libcatacomb_la_SOURCES = \
142 des-base.c des-base.h des_sp.h bf_ikey.h daftstory.h \
143 rc4.c \
144 rand.c noise.c \
145 key.c \
146 mpx.c mpscan.c mparena.c \
147 mpmont.c \
148 ptab.c pgen.c rabin.c \
149 dsa-sign.c dsa-verify.c dsa-gen.c \
150 dh-prime.c \
151 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
152 addsuffix(`ciphers', `.c') addsuffix(`hashes', `.c')
153
154 des-base.lo: des_sp.h
155 mpx.lo: mptypes.h
156
157 ## --- Utility programs ---
158 noinst_PROGRAMS = des-mktab mptypes
159 bin_PROGRAMS = key
160 bin_SCRIPTS = catacomb-config
161 noinst_PROGRAMS = des-mktab genprimes mptypes
162 LDADD = libcatacomb.la
163
164 key_SOURCES = keyutil.c getdate.y getdate.h
165
166 genprimes_SOURCES = genprimes.c
167 genprimes_LDADD =
168
169 mptypes_SOURCES = mptypes.c
170 mptypes_LDADD =
171
172 ## --- Documentation ---
173
174 man_MANS = key.1 keyring.5
175
176 ## --- Other handy definitions ---
177
178 EXTRA_DIST = Makefile.m4 genmodes $(man_MANS)
179
180 dist-hook:
181 @ln getdate.c $(distdir) || ln $(srcdir)/getdate.c $(distdir) || true
182 @mkdir $(distdir)/tests
183 @ln $(srcdir)/tests/* $(distdir)/tests || true
184 @rm -f $(distdir)/tests/*~
185
186 ## --- Testing ---
187
188 define(`testprogs', `')
189
190 define(`CTESTRIG',
191 `define(`testprogs', testprogs \
192 $1.t)dnl
193 $1.t: $1.c libcatacomb.la
194 CTESTRIG(mpx-test)
195 adorn(`nl`'CTESTRIG(', join(`ciphers', `-', `cipher_modes'), `)')
196 adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
197 CTESTRIG(mpx)
198 CTESTRIG(mptext)
199
200 adorn(`nl`'CTESTRIG(', `ciphers', `)')
201 adorn(`nl`'CTESTRIG(', `hashes', `)')
202 adorn(`nl`'CTESTRIG(', join(`ciphers', `-', `cipher_modes'), `)')
203 adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
204 CTESTRIG(dsa-gen)
205 CTESTRIG(dsa-sign)
206 CTESTRIG(dsa-verify)
207 CLEANFILES = *.t mptypes.h
208 TESTS = testprogs
209
210 CLEANFILES = *.t mptypes.h des_sp.h ptab.c ptab.h
211
212 ## --- Makefile building (haha!) ---
213
214 $(srcdir)/Makefile.am: $(srcdir)/Makefile.m4
215 m4 $(srcdir)/Makefile.m4 >$(srcdir)/Makefile.am
216 $(MODES) $(srcdir)/des_sp.h \
217 $(srcdir)/getdate.c getdate.c
218 $(srcdir)/Makefile.am \
219 $(srcdir)/getdate.c getdate.c \
220 $(MODES)
221
222 ##----- That's all, folks ---------------------------------------------------