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