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