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