c04dd1ab074a8a1d4cd3b02b1a08a55361794afc
[become] / src / Makefile.am
1 ## Process this file with `automake' to generate `Makefile.in'
2 ## -*-makefile-*-
3 ##
4 ## $Id: Makefile.am,v 1.15 2003/10/12 00:15:34 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.15 2003/10/12 00:15:34 mdw
33 ## Fix to makefile install rules.
34 ##
35 ## Revision 1.14 2003/10/12 00:14:55 mdw
36 ## Major overhaul. Now uses DSA signatures rather than the bogus symmetric
37 ## encrypt-and-hope thing. Integrated with mLib and Catacomb.
38 ##
39 ## Revision 1.13 1999/05/04 16:50:59 mdw
40 ## Change library to `libbecome.a', for aesthetic reasons.
41 ##
42 ## Revision 1.12 1999/05/04 16:36:03 mdw
43 ## Changes for new Automake version.
44 ##
45 ## Revision 1.11 1998/06/18 15:52:05 mdw
46 ## Remove the IDEA test case.
47 ##
48 ## Revision 1.10 1998/04/23 13:17:17 mdw
49 ## New program `bcquery', and `ypstuff' module added.
50 ##
51 ## Revision 1.9 1998/02/20 18:12:35 mdw
52 ## Make the `become' program setuid root when installing.
53 ##
54 ## Revision 1.8 1998/01/12 16:45:36 mdw
55 ## Fix copyright date.
56 ##
57 ## Revision 1.7 1997/09/26 09:14:57 mdw
58 ## Merged blowfish branch into trunk.
59 ##
60 ## Revision 1.6.2.1 1997/09/26 09:07:56 mdw
61 ## Use the Blowfish encryption algorithm instead of IDEA. This is partly
62 ## because I prefer Blowfish (without any particularly strong evidence) but
63 ## mainly because IDEA is patented and Blowfish isn't.
64 ##
65 ## Revision 1.6 1997/09/18 11:17:18 mdw
66 ## Fix comment leaders. Don't know why this CVS keeps breaking them.
67 ## Could be DEC's bogus version of RCS being picked up.
68 ##
69 ## Revision 1.5 1997/09/17 10:28:25 mdw
70 ## Remove `set.c'. No longer necessary.
71 ##
72 ## Revision 1.4 1997/08/20 16:14:12 mdw
73 ## Build parser and lexer into the source directory. Other cosmetic
74 ## things.
75 ##
76 ## Revision 1.3 1997/08/07 09:39:36 mdw
77 ## Add new source files, and remove options inappropriate for subsidiary
78 ## Makefiles.
79 ##
80 ## Revision 1.2 1997/08/04 10:24:19 mdw
81 ## Sources placed under CVS control.
82 ##
83
84 ##----- General setup things ------------------------------------------------
85
86 ## --- What to make ---
87
88 bin_PROGRAMS = become bcquery
89 noinst_LIBRARIES = libbecome.a
90
91 ##----- Building the main code ----------------------------------------------
92
93 ## --- The library contains most of the interesting stuff ---
94
95 libbecome_a_SOURCES = \
96 check.c daemon.c \
97 lexer.l parser.y \
98 class.c name.c netg.c rule.c userdb.c ypstuff.c \
99 \
100 become.h \
101 check.h daemon.h \
102 lexer.h parse.h \
103 class.h name.h netg.h rule.h userdb.h ypstuff.h
104
105 BUILT_SOURCES = \
106 parser.c parser.h lexer.c
107
108 ## --- Yaccing and lexing ---
109
110 YFLAGS = -d -v
111
112 dist-hook:
113 for i in $(BUILT_SOURCES); do \
114 [ -r $(distdir)/$$i ] || ln $$i $(distdir)/$$i; \
115 done
116
117 ## --- The main programs ---
118
119 LDADD = libbecome.a @LEXLIB@
120
121 become_SOURCES = become.c
122 bcquery_SOURCES = bcquery.c
123
124 become_DEPENDENCIES = libbecome.a
125 bcquery_DEPENDENCIES = libbecome.a
126
127 ##----- Become must be setuid root ------------------------------------------
128
129 install-exec-hook:
130 become_prog=$(DESTDIR)/${bindir}/`echo become|sed '${transform}'`; \
131 { chown root $${become_prog} && \
132 chmod 4755 $${become_prog}; } || \
133 { echo ">>>>>"; \
134 echo ">>>>> $${become_prog} must be installed setuid-root"; \
135 echo ">>>>>"; \
136 }
137
138 ##----- Testing -------------------------------------------------------------
139
140 ## --- The test programs ---
141
142 TESTS = \
143 name-test netg-test sym-test userdb-test \
144 crypt-test \
145 blowfish-test idea-test md5-test
146
147 ## --- How to build a test rig ---
148
149 SUFFIXES = .tro
150 .c.tro:
151 $(COMPILE) -DTEST_RIG $< -o $@
152
153 ## --- Now build all the test programs ---
154 ##
155 ## This is a right pain. However, `automake' provides no way of automating
156 ## this. (A drop-out to raw perl would be nice, for example.)
157
158 name-test: name.tro libbecome.a
159 $(LINK) name.tro libbecome.a $(LIBS)
160 sym-test: sym.tro libbecome.a
161 $(LINK) sym.tro libbecome.a $(LIBS)
162 userdb-test: userdb.tro libbecome.a
163 $(LINK) userdb.tro libbecome.a $(LIBS)
164 crypt-test: crypt.tro libbecome.a
165 $(LINK) crypt.tro libbecome.a $(LIBS)
166 blowfish-test: blowfish.tro libbecome.a
167 $(LINK) blowfish.tro libbecome.a $(LIBS)
168 md5-test: md5.tro libbecome.a
169 $(LINK) md5.tro libbecome.a $(LIBS)
170 netg-test: netg.tro libbecome.a
171 $(LINK) netg.tro libbecome.a
172
173 CLEANFILES = *.tro y.output
174
175 ##----- That's all, folks ---------------------------------------------------