| 1 | ## Process this file with `automake' to generate `Makefile.in' |
| 2 | ## -*-makefile-*- |
| 3 | ## |
| 4 | ## $Id: Makefile.am,v 1.10 1998/04/23 13:17:17 mdw Exp $ |
| 5 | ## |
| 6 | ## Makefile for `become' |
| 7 | ## |
| 8 | ## (c) 1998 EBI |
| 9 | ## |
| 10 | |
| 11 | ##----- Licensing notice ---------------------------------------------------- |
| 12 | ## |
| 13 | ## This file is part of `become' |
| 14 | ## |
| 15 | ## `Become' is free software; you can redistribute it and/or modify |
| 16 | ## it under the terms of the GNU General Public License as published by |
| 17 | ## the Free Software Foundation; either version 2 of the License, or |
| 18 | ## (at your option) any later version. |
| 19 | ## |
| 20 | ## `Become' is distributed in the hope that it will be useful, |
| 21 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | ## GNU General Public License for more details. |
| 24 | ## |
| 25 | ## You should have received a copy of the GNU General Public License |
| 26 | ## along with `become'; if not, write to the Free Software Foundation, |
| 27 | ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 28 | |
| 29 | ##----- Revision history ---------------------------------------------------- |
| 30 | ## |
| 31 | ## $Log: Makefile.am,v $ |
| 32 | ## Revision 1.10 1998/04/23 13:17:17 mdw |
| 33 | ## New program `bcquery', and `ypstuff' module added. |
| 34 | ## |
| 35 | ## Revision 1.9 1998/02/20 18:12:35 mdw |
| 36 | ## Make the `become' program setuid root when installing. |
| 37 | ## |
| 38 | ## Revision 1.8 1998/01/12 16:45:36 mdw |
| 39 | ## Fix copyright date. |
| 40 | ## |
| 41 | ## Revision 1.7 1997/09/26 09:14:57 mdw |
| 42 | ## Merged blowfish branch into trunk. |
| 43 | ## |
| 44 | ## Revision 1.6.2.1 1997/09/26 09:07:56 mdw |
| 45 | ## Use the Blowfish encryption algorithm instead of IDEA. This is partly |
| 46 | ## because I prefer Blowfish (without any particularly strong evidence) but |
| 47 | ## mainly because IDEA is patented and Blowfish isn't. |
| 48 | ## |
| 49 | ## Revision 1.6 1997/09/18 11:17:18 mdw |
| 50 | ## Fix comment leaders. Don't know why this CVS keeps breaking them. |
| 51 | ## Could be DEC's bogus version of RCS being picked up. |
| 52 | ## |
| 53 | ## Revision 1.5 1997/09/17 10:28:25 mdw |
| 54 | ## Remove `set.c'. No longer necessary. |
| 55 | ## |
| 56 | ## Revision 1.4 1997/08/20 16:14:12 mdw |
| 57 | ## Build parser and lexer into the source directory. Other cosmetic |
| 58 | ## things. |
| 59 | ## |
| 60 | ## Revision 1.3 1997/08/07 09:39:36 mdw |
| 61 | ## Add new source files, and remove options inappropriate for subsidiary |
| 62 | ## Makefiles. |
| 63 | ## |
| 64 | ## Revision 1.2 1997/08/04 10:24:19 mdw |
| 65 | ## Sources placed under CVS control. |
| 66 | ## |
| 67 | |
| 68 | ##----- General setup things ------------------------------------------------ |
| 69 | |
| 70 | ## --- What to make --- |
| 71 | |
| 72 | bin_PROGRAMS = become keygen bcquery |
| 73 | noinst_LIBRARIES = bcm |
| 74 | |
| 75 | ##----- Building the main code ---------------------------------------------- |
| 76 | |
| 77 | ## --- The library contains most of the interesting stuff --- |
| 78 | |
| 79 | bcm_SOURCES = \ |
| 80 | check.c daemon.c \ |
| 81 | lexer.l parser.y \ |
| 82 | class.c name.c netg.c rule.c sym.c userdb.c ypstuff.c \ |
| 83 | crypt.c \ |
| 84 | noise.c rand.c \ |
| 85 | icrypt.c blowfish.c md5.c \ |
| 86 | mdwopt.c tx.c utils.c \ |
| 87 | \ |
| 88 | become.h \ |
| 89 | check.h daemon.h \ |
| 90 | lexer.h parser.h \ |
| 91 | class.h name.h netg.h rule.h sym.h userdb.h ypstuff.h \ |
| 92 | crypt.h \ |
| 93 | noise.h rand.h \ |
| 94 | icrypt.h blowfish.h blowfish-sbox.h md5.h \ |
| 95 | mdwopt.h tx.h utils.h \ |
| 96 | dbutils.h |
| 97 | |
| 98 | BUILT_SOURCES = \ |
| 99 | parser.c lexer.c parser.tab.h |
| 100 | |
| 101 | ## --- Yaccing and lexing --- |
| 102 | |
| 103 | $(srcdir)/parser.c $(srcdir)/parser.tab.h: $(srcdir)/parser.y |
| 104 | @YACC@ -d -v $(srcdir)/parser.y |
| 105 | mv y.tab.c $(srcdir)/parser.c |
| 106 | mv y.tab.h $(srcdir)/parser.tab.h |
| 107 | |
| 108 | $(srcdir)/lexer.c: $(srcdir)/lexer.l |
| 109 | @LEX@ $(srcdir)/lexer.l |
| 110 | mv lex.yy.c $(srcdir)/lexer.c |
| 111 | |
| 112 | ## --- The main programs --- |
| 113 | |
| 114 | LDADD = libbcm.a @LEXLIB@ |
| 115 | |
| 116 | become_SOURCES = become.c |
| 117 | keygen_SOURCES = keygen.c |
| 118 | bcquery_SOURCES = bcquery.c |
| 119 | |
| 120 | become_DEPENDENCIES = libbcm.a |
| 121 | keygen_DEPENDENCIES = libbcm.a |
| 122 | bcquery_DEPENDENCIES = libbcm.a |
| 123 | |
| 124 | ##----- Become must be setuid root ------------------------------------------ |
| 125 | |
| 126 | install-data-hook: |
| 127 | become_prog=${bindir}/`echo become|sed '${transform}'`; \ |
| 128 | { chown root $${become_prog} && \ |
| 129 | chmod 4755 $${become_prog}; } || \ |
| 130 | { echo ">>>>>"; \ |
| 131 | echo ">>>>> $${become_prog} must be installed setuid-root"; \ |
| 132 | echo ">>>>>"; \ |
| 133 | } |
| 134 | |
| 135 | ##----- Testing ------------------------------------------------------------- |
| 136 | |
| 137 | ## --- The test programs --- |
| 138 | |
| 139 | TESTS = \ |
| 140 | name-test netg-test sym-test userdb-test \ |
| 141 | crypt-test \ |
| 142 | blowfish-test idea-test md5-test |
| 143 | |
| 144 | ## --- How to build a test rig --- |
| 145 | |
| 146 | SUFFIXES = .tro |
| 147 | .c.tro: |
| 148 | $(COMPILE) -DTEST_RIG $< -o $@ |
| 149 | |
| 150 | ## --- Now build all the test programs --- |
| 151 | ## |
| 152 | ## This is a right pain. However, `automake' provides no way of automating |
| 153 | ## this. (A drop-out to raw perl would be nice, for example.) |
| 154 | |
| 155 | name-test: name.tro libbcm.a |
| 156 | $(LINK) name.tro libbcm.a $(LIBS) |
| 157 | sym-test: sym.tro libbcm.a |
| 158 | $(LINK) sym.tro libbcm.a $(LIBS) |
| 159 | userdb-test: userdb.tro libbcm.a |
| 160 | $(LINK) userdb.tro libbcm.a $(LIBS) |
| 161 | crypt-test: crypt.tro libbcm.a |
| 162 | $(LINK) crypt.tro libbcm.a $(LIBS) |
| 163 | blowfish-test: blowfish.tro libbcm.a |
| 164 | $(LINK) blowfish.tro libbcm.a $(LIBS) |
| 165 | idea-test: idea.tro libbcm.a |
| 166 | $(LINK) idea.tro libbcm.a $(LIBS) |
| 167 | md5-test: md5.tro libbcm.a |
| 168 | $(LINK) md5.tro libbcm.a $(LIBS) |
| 169 | netg-test: netg.tro libbcm.a |
| 170 | $(LINK) netg.tro libbcm.a |
| 171 | |
| 172 | CLEANFILES = *.tro y.output |
| 173 | |
| 174 | ##----- That's all, folks --------------------------------------------------- |