3 ## $Id: Makefile.m4,v 1.3 1999/10/24 10:04:26 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.3 1999/10/24 10:04:26 mdw
33 ## Install headers in the right directory.
35 ## Modify for standalone distribution. The library's getting far too large
36 ## to be sensibly embedded in other programs.
38 ## Revision 1.3 1999/10/24 10:04:26 mdw
39 ## Install headers in the right directory.
41 ## Revision 1.2 1999/10/23 12:55:35 mdw
42 ## The `CVS' directory can't be hardlinked. Don't worry about this
47 AUTOMAKE_OPTIONS = foreign
49 archincludedir = $(libdir)/catacomb/include
51 ## --- List handling macros ---
53 ## List handling is nice, usually. Unfortunately, I based this design on
54 ## TeX list macros rather than anything sensible...
56 define(`_', `define(`_item', $1)define(`_item_2', $2)emit`'')
57 define(`adorn', `pushdef(`emit', `$1`'_item`'$3')$2`'popdef(`emit')')
59 `pushdef(`emit', `adorn(``_(''_item`$2', `$3', ``)'')`'')$1`'popdef(`emit')')
60 define(`addsuffix', `adorn(`', `$1', `$2')')
61 define(`lit', `adorn(`', `$1', `')')
65 define(`allwithsuffix',
66 `addsuffix(`$1', `$3') addsuffix(`$2', `$3') dnl
67 addsuffix(join(`$1', `-', `$2'), `$3')')
69 ## --- Autogenerated source files ---
71 define(`ciphers', `_(des) _(des3) _(blowfish) _(idea) _(rc5)')
72 define(`cipher_modes', `_(ecb) _(cbc) _(cfb) _(ofb)')
74 define(`hashes', `_(md5) _(md4) _(rmd160) _(sha)')
75 define(`hash_modes', `_(hmac)')
78 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.c') \
79 adorn(`$(srcdir)/', join(`ciphers', `-', `cipher_modes'), `.h') \
80 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.c') \
81 adorn(`$(srcdir)/', join(`hashes', `-', `hash_modes'), `.h')
83 $(MODES): $(srcdir)/genmodes
85 archinclude_HEADERS = mptypes.h
93 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
94 addsuffix(join(`ciphers', `-', `cipher_modes'), `.h') \
95 INCLUDES = -I$(srcdir)/..
96 addsuffix(join(`hashes', `-', `hash_modes'), `.c') \
97 addsuffix(join(`hashes', `-', `hash_modes'), `.h')
98 lib_LIBRARIES = libcatacomb.a
99 libcatacomb_la_LDFLAGS = -version-info 0:4:0
100 ## Middle number is the patchlevel. Final number is the minor version. The
101 ## difference between the first and last numbers is major version.
103 define(`emit', `$1.h ')
104 pkginclude_HEADERS = \
107 mpx.h mpw.h mpscan.h mparena.h mp.h mptext.h mpmont.h \
108 ptab.h pgen.h rabin.h \
110 allwithsuffix(`ciphers', `cipher_modes', `.h') \
111 libcatacomb_a_SOURCES = \
113 define(`emit', `$1.c ')
114 libcatacomb_la_SOURCES = \
115 des-base.c des-base.h des_sp.h bf_ikey.h daftstory.h \
116 ptab.c pgen.c rabin.c \
117 dsa-sign.c dsa-verify.c dsa-gen.c \
119 addsuffix(join(`ciphers', `-', `cipher_modes'), `.c') \
120 noinst_PROGRAMS = des-mktab
121 LDADD = libcatacomb.a ../mLib/libmLib.a
122 ## --- Utility programs ---
123 noinst_PROGRAMS = des-mktab mptypes
124 LDADD = libcatacomb.a
125 bin_SCRIPTS = catacomb-config
126 noinst_PROGRAMS = des-mktab genprimes mptypes
127 LDADD = libcatacomb.la
128 genprimes_SOURCES = genprimes.c
131 mptypes_SOURCES = mptypes.c
134 ## --- Documentation ---
136 man_MANS = key.1 keyring.5
138 ## --- Other handy definitions ---
140 EXTRA_DIST = Makefile.m4 genmodes $(man_MANS)
143 @ln getdate.c $(distdir) || ln $(srcdir)/getdate.c $(distdir) || true
144 @mkdir $(distdir)/tests
145 @ln $(srcdir)/tests/* $(distdir)/tests || true
146 @rm -f $(distdir)/tests/*~
149 addsuffix(join(`ciphers', `-', `cipher_modes'), `.t') \
150 addsuffix(join(`hashes', `-', `hash_modes'), `.t') \
151 addsuffix(`ciphers', `.t') addsuffix(`hashes', `.t')
152 $(COMPILE) -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
153 $(srcdir)/$1.c libcatacomb.a ../mLib/libmLib.a -o $1.t')
155 `$1.t: $1.c libcatacomb.a
156 $(COMPILE) -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $(srcdir)/$1.c libcatacomb.a $(LIBS) -o $1.t')
158 $1.t: $1.c libcatacomb.la
160 adorn(`nl`'CTESTRIG(', `ciphers', `)')
161 adorn(`nl`'CTESTRIG(', `hashes', `)')
163 adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
165 CLEANFILES = *.t mptypes.h
168 CLEANFILES = *.t mptypes.h des_sp.h ptab.c ptab.h
170 ## --- Makefile building (haha!) ---
172 $(srcdir)/Makefile.am: $(srcdir)/Makefile.m4
173 m4 $(srcdir)/Makefile.m4 >$(srcdir)/Makefile.am
174 $(MODES) $(srcdir)/des_sp.h \
175 $(srcdir)/getdate.c getdate.c
176 $(srcdir)/Makefile.am \
177 $(srcdir)/getdate.c getdate.c \
180 ##----- That's all, folks ---------------------------------------------------