Don't be pedantic, because using `long long' as a multiprecision type
[u/mdw/catacomb] / Makefile.m4
CommitLineData
d03ab969 1## -*-makefile-*-
2##
ffc086db 3## $Id: Makefile.m4,v 1.7 1999/11/11 19:01:02 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 $
ffc086db 32## Revision 1.7 1999/11/11 19:01:02 mdw
33## Use `libtool' to generate a shared library.
a094cab7 34##
35## Revision 1.7 1999/11/11 19:01:02 mdw
36## Use `libtool' to generate a shared library.
8149619d 37##
38## Revision 1.6 1999/11/11 17:47:34 mdw
39## Updates for new configuration system, and `mptypes' generator.
748ed8dc 40##
8149619d 41## Revision 1.5 1999/11/11 00:59:17 mdw
748ed8dc 42## Minor reformatting.
3701c54f 43##
748ed8dc 44## Revision 1.4 1999/10/24 10:20:36 mdw
3701c54f 45## Modify for standalone distribution. The library's getting far too large
46## to be sensibly embedded in other programs.
d03ab969 47##
3701c54f 48## Revision 1.3 1999/10/24 10:04:26 mdw
9183ab7b 49## Install headers in the right directory.
50##
51## Revision 1.2 1999/10/23 12:55:35 mdw
d03ab969 52## The `CVS' directory can't be hardlinked. Don't worry about this
53## overmuch.
54##
a094cab7 55## Revision 1.1 1999/09/03 08:41:11 mdw
56## Initial import.
d03ab969 57##
58
59AUTOMAKE_OPTIONS = foreign
60
61archincludedir = $(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
68define(`_', `define(`_item', $1)define(`_item_2', $2)emit`'')
69define(`adorn', `pushdef(`emit', `$1`'_item`'$3')$2`'popdef(`emit')')
70define(`join',
71`pushdef(`emit', `adorn(``_(''_item`$2', `$3', ``)'')`'')$1`'popdef(`emit')')
72define(`addsuffix', `adorn(`', `$1', `$2')')
73define(`lit', `adorn(`', `$1', `')')
74define(`nl', `
75')
76
77define(`allwithsuffix',
78`addsuffix(`$1', `$3') addsuffix(`$2', `$3') dnl
79addsuffix(join(`$1', `-', `$2'), `$3')')
80
81## --- Autogenerated source files ---
82
83define(`ciphers', `_(des) _(des3) _(blowfish) _(idea) _(rc5)')
84define(`cipher_modes', `_(ecb) _(cbc) _(cfb) _(ofb)')
85
86define(`hashes', `_(md5) _(md4) _(rmd160) _(sha)')
87define(`hash_modes', `_(hmac)')
88
89MODES = \
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
a094cab7 96$(srcdir)/des_sp.h: des-mktab
97 ./des-mktab >$(srcdir)/des_sp.h
98
99ptab.c ptab.h: genprimes
100 ./genprimes -h ptab.h -c ptab.c -m 256 -t "unsigned char" -i ptab
d03ab969 101
102archinclude_HEADERS = mptypes.h
103
104mptypes.h: mptypes
105 des_sp.h \
106 ./mptypes >mptypes.h
107
108BUILT_SOURCES = \
109 getdate.c \
110 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
111 addsuffix(join(`ciphers', `-', `cipher_modes'), `.h') \
d03ab969 112 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
113 addsuffix(join(`hashes', `-', `hash_modes'), `.h')
ffc086db 114
115## --- Building the main library ---
116libcatacomb_la_LDFLAGS = -version-info 0:3:0
117lib_LTLIBRARIES = libcatacomb.la
118
d03ab969 119libcatacomb_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
123define(`emit', `$1.h ')
124pkginclude_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') \
ffc086db 131 allwithsuffix(`hashes', `hash_modes', `.h')
d03ab969 132
133define(`emit', `$1.c ')
134libcatacomb_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') \
a094cab7 140des-base.lo: des_sp.h
141mpx.lo: mptypes.h
748ed8dc 142
d03ab969 143## --- Utility programs ---
144noinst_PROGRAMS = des-mktab mptypes
ffc086db 145bin_PROGRAMS = key
d03ab969 146bin_SCRIPTS = catacomb-config
147noinst_PROGRAMS = des-mktab genprimes mptypes
148LDADD = libcatacomb.la
a094cab7 149
150key_SOURCES = keyutil.c getdate.y getdate.h
151
d03ab969 152genprimes_SOURCES = genprimes.c
153genprimes_LDADD =
154
155mptypes_SOURCES = mptypes.c
156mptypes_LDADD =
157
158## --- Documentation ---
159
160man_MANS = key.1 keyring.5
161
162## --- Other handy definitions ---
9183ab7b 163
d03ab969 164EXTRA_DIST = Makefile.m4 genmodes $(man_MANS)
165
166dist-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/*~
171TESTS = \
172 rc4.t \
173 addsuffix(join(`ciphers', `-', `cipher_modes'), `.t') \
174 addsuffix(join(`hashes', `-', `hash_modes'), `.t') \
175 addsuffix(`ciphers', `.t') addsuffix(`hashes', `.t')
a094cab7 176## --- Testing ---
d03ab969 177
ffc086db 178`$1.t: $1.c libcatacomb.la
179`define(`testprogs', testprogs \
d03ab969 180 $1.t)dnl
181$1.t: $1.c libcatacomb.la
182
183adorn(`nl`'CTESTRIG(', `ciphers', `)')
184adorn(`nl`'CTESTRIG(', `hashes', `)')
a094cab7 185adorn(`nl`'CTESTRIG(', join(`ciphers', `-', `cipher_modes'), `)')
d03ab969 186adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
187CTESTRIG(dsa-verify)
188CLEANFILES = *.t mptypes.h
189TESTS = testprogs
190
191CLEANFILES = *.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 ---------------------------------------------------