3 ## $Id: Makefile.m4,v 1.4 1999/10/24 10:20:36 mdw Exp $
5 ## Makefile for Catacomb
7 ## (c) 1999 Straylight/Edgeware
10 ##----- Licensing notice ----------------------------------------------------
12 ## This file is part of Catacomb.
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.
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.
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.
29 ##----- Revision history ----------------------------------------------------
31 ## $Log: Makefile.m4,v $
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.
36 ## Minor reformatting.
38 ## Revision 1.4 1999/10/24 10:20:36 mdw
39 ## Modify for standalone distribution. The library's getting far too large
40 ## to be sensibly embedded in other programs.
42 ## Revision 1.3 1999/10/24 10:04:26 mdw
43 ## Install headers in the right directory.
45 ## Revision 1.2 1999/10/23 12:55:35 mdw
46 ## The `CVS' directory can't be hardlinked. Don't worry about this
51 AUTOMAKE_OPTIONS = foreign
53 archincludedir = $(libdir)/catacomb/include
55 ## --- List handling macros ---
57 ## List handling is nice, usually. Unfortunately, I based this design on
58 ## TeX list macros rather than anything sensible...
60 define(`_', `define(`_item', $1)define(`_item_2', $2)emit`'')
61 define(`adorn', `pushdef(`emit', `$1`'_item`'$3')$2`'popdef(`emit')')
63 `pushdef(`emit', `adorn(``_(''_item`$2', `$3', ``)'')`'')$1`'popdef(`emit')')
64 define(`addsuffix', `adorn(`', `$1', `$2')')
65 define(`lit', `adorn(`', `$1', `')')
69 define(`allwithsuffix',
70 `addsuffix(`$1', `$3') addsuffix(`$2', `$3') dnl
71 addsuffix(join(`$1', `-', `$2'), `$3')')
73 ## --- Autogenerated source files ---
75 define(`ciphers', `_(des) _(des3) _(blowfish) _(idea) _(rc5)')
76 define(`cipher_modes', `_(ecb) _(cbc) _(cfb) _(ofb)')
78 define(`hashes', `_(md5) _(md4) _(rmd160) _(sha)')
79 define(`hash_modes', `_(hmac)')
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')
87 $(MODES): $(srcdir)/genmodes
89 archinclude_HEADERS = mptypes.h
97 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
98 addsuffix(join(`ciphers', `-', `cipher_modes'), `.h') \
99 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
100 addsuffix(join(`hashes', `-', `hash_modes'), `.h')
101 lib_LIBRARIES = libcatacomb.a
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.
106 define(`emit', `$1.h ')
107 pkginclude_HEADERS = \
110 mpx.h mpw.h mpscan.h mparena.h mp.h mptext.h mpmont.h \
111 ptab.h pgen.h rabin.h \
113 allwithsuffix(`ciphers', `cipher_modes', `.h') \
114 libcatacomb_a_SOURCES = \
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 \
122 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
123 noinst_PROGRAMS = des-mktab
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
134 mptypes_SOURCES = mptypes.c
137 ## --- Documentation ---
139 man_MANS = key.1 keyring.5
141 ## --- Other handy definitions ---
143 EXTRA_DIST = Makefile.m4 genmodes $(man_MANS)
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/*~
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)\" \
156 $(srcdir)/$1.c libcatacomb.a $(LIBS) -o $1.t')
158 `$1.t: $1.c libcatacomb.a
159 $(COMPILE) -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $(srcdir)/$1.c libcatacomb.a $(LIBS) -o $1.t')
161 $1.t: $1.c libcatacomb.la
163 adorn(`nl`'CTESTRIG(', `ciphers', `)')
164 adorn(`nl`'CTESTRIG(', `hashes', `)')
166 adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
168 CLEANFILES = *.t mptypes.h
171 CLEANFILES = *.t mptypes.h des_sp.h ptab.c ptab.h
173 ## --- Makefile building (haha!) ---
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 \
183 ##----- That's all, folks ---------------------------------------------------