Make the `become' program setuid root when installing.
[become] / src / Makefile.am
CommitLineData
8ddbfc62 1## Process this file with `automake' to generate `Makefile.in'
2## -*-makefile-*-
3##
5b175cbb 4## $Id: Makefile.am,v 1.9 1998/02/20 18:12:35 mdw Exp $
8ddbfc62 5##
6## Makefile for `become'
7##
c758e654 8## (c) 1998 EBI
8ddbfc62 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 $
5b175cbb 32## Revision 1.9 1998/02/20 18:12:35 mdw
33## Make the `become' program setuid root when installing.
34##
c758e654 35## Revision 1.8 1998/01/12 16:45:36 mdw
36## Fix copyright date.
37##
9e5602f0 38## Revision 1.7 1997/09/26 09:14:57 mdw
39## Merged blowfish branch into trunk.
40##
41## Revision 1.6.2.1 1997/09/26 09:07:56 mdw
42## Use the Blowfish encryption algorithm instead of IDEA. This is partly
43## because I prefer Blowfish (without any particularly strong evidence) but
44## mainly because IDEA is patented and Blowfish isn't.
45##
07d8362a 46## Revision 1.6 1997/09/18 11:17:18 mdw
47## Fix comment leaders. Don't know why this CVS keeps breaking them.
48## Could be DEC's bogus version of RCS being picked up.
49##
50## Revision 1.5 1997/09/17 10:28:25 mdw
c426c3c9 51## Remove `set.c'. No longer necessary.
0d036225 52##
07d8362a 53## Revision 1.4 1997/08/20 16:14:12 mdw
54## Build parser and lexer into the source directory. Other cosmetic
55## things.
56##
a68d9c21 57## Revision 1.3 1997/08/07 09:39:36 mdw
58## Add new source files, and remove options inappropriate for subsidiary
59## Makefiles.
60##
03f996bd 61## Revision 1.2 1997/08/04 10:24:19 mdw
8ddbfc62 62## Sources placed under CVS control.
63##
64
65##----- General setup things ------------------------------------------------
66
8ddbfc62 67## --- What to make ---
68
69bin_PROGRAMS = become keygen
70noinst_LIBRARIES = bcm
71
72##----- Building the main code ----------------------------------------------
73
74## --- The library contains most of the interesting stuff ---
75
76bcm_SOURCES = \
77 check.c daemon.c \
78 lexer.l parser.y \
c426c3c9 79 class.c name.c netg.c rule.c sym.c userdb.c \
8ddbfc62 80 crypt.c \
81 noise.c rand.c \
9e5602f0 82 icrypt.c blowfish.c md5.c \
8ddbfc62 83 mdwopt.c tx.c utils.c \
84 \
85 become.h \
86 check.h daemon.h \
87 lexer.h parser.h \
c426c3c9 88 class.h name.h netg.h rule.h sym.h userdb.h \
8ddbfc62 89 crypt.h \
90 noise.h rand.h \
9e5602f0 91 icrypt.h blowfish.h blowfish-sbox.h md5.h \
a68d9c21 92 mdwopt.h tx.h utils.h \
93 dbutils.h
8ddbfc62 94
95BUILT_SOURCES = \
96 parser.c lexer.c parser.tab.h
97
98## --- Yaccing and lexing ---
99
0d036225 100$(srcdir)/parser.c $(srcdir)/parser.tab.h: $(srcdir)/parser.y
8ddbfc62 101 @YACC@ -d -v $(srcdir)/parser.y
0d036225 102 mv y.tab.c $(srcdir)/parser.c
103 mv y.tab.h $(srcdir)/parser.tab.h
8ddbfc62 104
0d036225 105$(srcdir)/lexer.c: $(srcdir)/lexer.l
8ddbfc62 106 @LEX@ $(srcdir)/lexer.l
0d036225 107 mv lex.yy.c $(srcdir)/lexer.c
8ddbfc62 108
109## --- The main programs ---
110
a68d9c21 111LDADD = libbcm.a @LEXLIB@
0d036225 112
8ddbfc62 113become_SOURCES = become.c
114keygen_SOURCES = keygen.c
115
0d036225 116become_DEPENDENCIES = libbcm.a
117keygen_DEPENDENCIES = libbcm.a
8ddbfc62 118
5b175cbb 119##----- Become must be setuid root ------------------------------------------
120
121install-data-hook:
122 become_prog=${bindir}/`echo become|sed '${transform}'`; \
123 { chown root $${become_prog} && \
124 chmod 4755 $${become_prog}; } || \
125 { echo ">>>>>"; \
126 echo ">>>>> $${become_prog} must be installed setuid-root"; \
127 echo ">>>>>"; \
128 }
129
8ddbfc62 130##----- Testing -------------------------------------------------------------
131
132## --- The test programs ---
133
134TESTS = \
a68d9c21 135 name-test netg-test sym-test userdb-test \
8ddbfc62 136 crypt-test \
137 blowfish-test idea-test md5-test
138
139## --- How to build a test rig ---
140
141SUFFIXES = .tro
142.c.tro:
143 $(COMPILE) -DTEST_RIG $< -o $@
144
145## --- Now build all the test programs ---
146##
147## This is a right pain. However, `automake' provides no way of automating
148## this. (A drop-out to raw perl would be nice, for example.)
149
150name-test: name.tro libbcm.a
151 $(LINK) name.tro libbcm.a $(LIBS)
152sym-test: sym.tro libbcm.a
153 $(LINK) sym.tro libbcm.a $(LIBS)
154userdb-test: userdb.tro libbcm.a
155 $(LINK) userdb.tro libbcm.a $(LIBS)
156crypt-test: crypt.tro libbcm.a
157 $(LINK) crypt.tro libbcm.a $(LIBS)
158blowfish-test: blowfish.tro libbcm.a
159 $(LINK) blowfish.tro libbcm.a $(LIBS)
160idea-test: idea.tro libbcm.a
161 $(LINK) idea.tro libbcm.a $(LIBS)
162md5-test: md5.tro libbcm.a
163 $(LINK) md5.tro libbcm.a $(LIBS)
164netg-test: netg.tro libbcm.a
165 $(LINK) netg.tro libbcm.a
166
0d036225 167CLEANFILES = *.tro y.output
168
8ddbfc62 169##----- That's all, folks ---------------------------------------------------