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