A bit of reformatting. Initialize the uid and gid correctly.
[u/mdw/catacomb] / Makefile.m4
... / ...
CommitLineData
1## -*-makefile-*-
2##
3## $Id: Makefile.m4,v 1.4 1999/10/24 10:20:36 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.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.
37##
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.
41##
42## Revision 1.3 1999/10/24 10:04:26 mdw
43## Install headers in the right directory.
44##
45## Revision 1.2 1999/10/23 12:55:35 mdw
46## The `CVS' directory can't be hardlinked. Don't worry about this
47## overmuch.
48##
49##
50
51AUTOMAKE_OPTIONS = foreign
52
53archincludedir = $(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
60define(`_', `define(`_item', $1)define(`_item_2', $2)emit`'')
61define(`adorn', `pushdef(`emit', `$1`'_item`'$3')$2`'popdef(`emit')')
62define(`join',
63`pushdef(`emit', `adorn(``_(''_item`$2', `$3', ``)'')`'')$1`'popdef(`emit')')
64define(`addsuffix', `adorn(`', `$1', `$2')')
65define(`lit', `adorn(`', `$1', `')')
66define(`nl', `
67')
68
69define(`allwithsuffix',
70`addsuffix(`$1', `$3') addsuffix(`$2', `$3') dnl
71addsuffix(join(`$1', `-', `$2'), `$3')')
72
73## --- Autogenerated source files ---
74
75define(`ciphers', `_(des) _(des3) _(blowfish) _(idea) _(rc5)')
76define(`cipher_modes', `_(ecb) _(cbc) _(cfb) _(ofb)')
77
78define(`hashes', `_(md5) _(md4) _(rmd160) _(sha)')
79define(`hash_modes', `_(hmac)')
80
81MODES = \
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
89archinclude_HEADERS = mptypes.h
90
91mptypes.h: mptypes
92 des_sp.h \
93 ./mptypes >mptypes.h
94
95BUILT_SOURCES = \
96 getdate.c \
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')
101lib_LIBRARIES = libcatacomb.a
102libcatacomb_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
106define(`emit', `$1.h ')
107pkginclude_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') \
114libcatacomb_a_SOURCES = \
115
116define(`emit', `$1.c ')
117libcatacomb_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') \
123noinst_PROGRAMS = des-mktab
124
125## --- Utility programs ---
126noinst_PROGRAMS = des-mktab mptypes
127LDADD = libcatacomb.a
128bin_SCRIPTS = catacomb-config
129noinst_PROGRAMS = des-mktab genprimes mptypes
130LDADD = libcatacomb.la
131genprimes_SOURCES = genprimes.c
132genprimes_LDADD =
133
134mptypes_SOURCES = mptypes.c
135mptypes_LDADD =
136
137## --- Documentation ---
138
139man_MANS = key.1 keyring.5
140
141## --- Other handy definitions ---
142
143EXTRA_DIST = Makefile.m4 genmodes $(man_MANS)
144
145dist-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/*~
150TESTS = \
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)\" \
156 $(srcdir)/$1.c libcatacomb.a $(LIBS) -o $1.t')
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
163adorn(`nl`'CTESTRIG(', `ciphers', `)')
164adorn(`nl`'CTESTRIG(', `hashes', `)')
165CLEANFILES = *.t
166adorn(`nl`'CTESTRIG(', join(`hashes', `-', `hash_modes'), `)')
167CTESTRIG(dsa-verify)
168CLEANFILES = *.t mptypes.h
169TESTS = testprogs
170
171CLEANFILES = *.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 ---------------------------------------------------