c4f2d992 |
1 | # -*-makefile-*- |
2 | # |
3 | # $Id: Makefile.in,v 1.1 1997/07/21 13:47:55 mdw Exp $ |
4 | # |
5 | # Makefile for `become' |
6 | # |
7 | # (c) 1997 EBI |
8 | # |
9 | |
10 | #----- Licencing notice ----------------------------------------------------- |
11 | # |
12 | # This file is part of `become' |
13 | # |
14 | # `Become' is free software; you can redistribute it and/or modify |
15 | # it under the terms of the GNU General Public License as published by |
16 | # the Free Software Foundation; either version 2 of the License, or |
17 | # (at your option) any later version. |
18 | # |
19 | # `Become' 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 General Public License for more details. |
23 | # |
24 | # You should have received a copy of the GNU General Public License |
25 | # along with `become'; if not, write to the Free Software |
26 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | |
28 | #----- Revision history ----------------------------------------------------- |
29 | # |
30 | # $Log: Makefile.in,v $ |
31 | # Revision 1.1 1997/07/21 13:47:55 mdw |
32 | # Initial revision |
33 | # |
34 | |
35 | #----- Configuration section ------------------------------------------------ |
36 | |
37 | # --- Miscellaneous stuff --- |
38 | |
39 | SHELL= /bin/sh |
40 | VERSION= @VERSION@ |
41 | |
42 | # --- Finding source code --- |
43 | |
44 | srcdir= @srcdir@ |
45 | VPATH= @srcdir@ |
46 | |
47 | # --- Where to put things --- |
48 | |
49 | prefix= @prefix@ |
50 | exec_prefix= @exec_prefix@ |
51 | bindir= @bindir@ |
52 | libdir= @libdir@ |
53 | etcdir= @sysconfdir@ |
54 | |
55 | # --- Compiling --- |
56 | |
57 | CC= @CC@ |
58 | CFLAGS= @CFLAGS@ |
59 | CPPFLAGS= @CPPFLAGS@ -I$(srcdir) -I. |
60 | TEST_DEFINES= -DTEST_RIG |
61 | |
62 | YACC= @YACC@ |
63 | YFLAGS= -d -v |
64 | |
65 | LEX= @LEX@ |
66 | LEXFLAGS= |
67 | |
68 | DEPEND= gcc -MM -MG -x c |
69 | |
70 | # --- Linking --- |
71 | |
72 | LD= @CC@ |
73 | LIBS= @LIBS@ @LEXLIB@ |
74 | LDFLAGS= @LDFLAGS@ |
75 | AR= @AR@ |
76 | RANLIB= @RANLIB@ |
77 | |
78 | # --- Installation --- |
79 | |
80 | INSTALL= @INSTALL@ |
81 | INSTALL_PROG= @INSTALL_PROGRAM@ |
82 | INSTALL_DATA= @INSTALL_DATA@ |
83 | |
84 | # --- Other useful things --- |
85 | |
86 | SED= sed |
87 | MV= mv -f |
88 | RM= rm -f |
89 | ETAGS= etags |
90 | |
91 | #----- Interesting files ---------------------------------------------------- |
92 | |
93 | # --- Library of common things --- |
94 | |
95 | BCMLIB= libbecome.a |
96 | BCMLIBSRCF= idea.c md5.c icrypt.c crypt.c tx.c \ |
97 | class.c name.c rule.c set.c sym.c userdb.c \ |
98 | check.c daemon.c \ |
99 | parser.y lexer.l \ |
100 | mdwopt.c utils.c |
101 | BCMLIBSRC= $(addprefix $(srcdir)/, $(BCMLIBSRCF)) |
102 | BCMLIBOBJ= $(addsuffix .o, $(basename $(BCMLIBSRCF))) |
103 | |
104 | # --- The `become' program --- |
105 | |
106 | BECOME= become |
107 | BECOMESRCF= become.c |
108 | BECOMESRC= $(addprefix $(srcdir)/, $(BECOMESRCF)) |
109 | BECOMEOBJ= $(addsuffix .o, $(basename $(BECOMESRCF))) |
110 | |
111 | # --- The `keygen' program --- |
112 | |
113 | KEYGEN= keygen |
114 | KEYGENSRCF= keygen.c |
115 | KEYGENSRC= $(addprefix $(srcdir)/, $(KEYGENSRCF)) |
116 | KEYGENOBJ= $(addsuffix .o, $(basename $(KEYGENSRCF))) |
117 | |
118 | # --- Various tests for some important modules --- |
119 | |
120 | TESTS= crypt-test icrypt-test idea-test md5-test \ |
121 | name-test sym-test userdb-test \ |
122 | become-test |
123 | TESTOBJ= $(addsuffix .o, $(TESTS)) |
124 | |
125 | # --- Everything --- |
126 | |
127 | ALLSRC= $(BCMLIBSRC) $(BECOMESRC) $(KEYGENSRC) |
128 | ALLOBJ= $(BCMLIBOBJ) $(BCMLIB) $(BECOMEOBJ) $(KEYGENOBJ) $(TESTOBJ) |
129 | |
130 | # --- Generated source files --- |
131 | |
132 | GENSRCF= parser.c parser.tab.h lexer.c |
133 | GENSRC= $(addprefix $(srcdir)/, $(GENSRCF)) |
134 | |
135 | # --- Installed files --- |
136 | |
137 | INSTALLABLES= $(bindir)/$(BECOME) $(bindir)/$(KEYGEN) |
138 | |
139 | #----- Parser tokens header file -------------------------------------------- |
140 | |
141 | %.tab.h: %.c |
142 | $(MV) y.tab.h $@ |
143 | |
144 | #----- Main target ---------------------------------------------------------- |
145 | |
146 | all: $(BECOME) $(KEYGEN) |
147 | |
148 | #----- Compiling the code --------------------------------------------------- |
149 | |
150 | $(BCMLIB): $(BCMLIBOBJ) |
151 | $(AR) rc $(BCMLIB) $? |
152 | $(RANLIB) $(BCMLIB) |
153 | |
154 | $(BECOME): $(BECOMEOBJ) $(BCMLIB) |
155 | $(LD) $(LDFLAGS) $^ $(LIBS) -o $(BECOME) |
156 | |
157 | $(KEYGEN): $(KEYGENOBJ) $(BCMLIB) |
158 | $(LD) $(LDFLAGS) $^ $(LIBS) -o $(KEYGEN) |
159 | |
160 | #----- Installation --------------------------------------------------------- |
161 | |
162 | # --- Installing --- |
163 | |
164 | install: $(INSTALLABLES) |
165 | |
166 | $(bindir):; $(srcdir)/mkinstalldirs $(bindir) |
167 | |
168 | $(bindir)/%: % $(bindir) |
169 | $(INSTALL_PROG) $< $(bindir) |
170 | |
171 | # --- Uninstalling --- |
172 | |
173 | uninstall:; $(RM) $(INSTALLABLES) |
174 | |
175 | #----- Environmental luxuries ----------------------------------------------- |
176 | |
177 | tags: $(srcdir)/TAGS |
178 | $(srcdir)/TAGS: $(ALLSRC) |
179 | $(ETAGS) $(ALLSRC) -o $(srcdir)/TAGS |
180 | |
181 | depend: $(srcdir)/depend |
182 | $(srcdir)/depend: $(ALLSRC) |
183 | $(SED) \ |
184 | -e '/^# \[Generated dependencies]/ q' \ |
185 | $(srcdir)/Makefile.in >$(srcdir)/new-Makefile.in |
186 | $(DEPEND) $(ALLSRC) | \ |
187 | sed -e 's/'$(srcdir)'\///g' \ |
188 | >>$(srcdir)/new-Makefile.in |
189 | $(MV) $(srcdir)/new-Makefile.in $(srcdir)/Makefile.in |
190 | touch $(srcdir)/depend |
191 | |
192 | #----- Distribution building ------------------------------------------------ |
193 | |
194 | dist: $(GENSRC) |
195 | $(srcdir)/mkdist -p $(BECOME) -v $(VERSION) \ |
196 | -m $(srcdir)/MANIFEST -i $(srcdir) |
197 | |
198 | #----- Cleanliness ---------------------------------------------------------- |
199 | |
200 | mostlyclean:; $(RM) \ |
201 | $(BECOME) $(KEYGEN) $(TESTS) $(ALLOBJ) \ |
202 | y.output \ |
203 | $(srcdir)/core $(srcdir)/\#* $(srcdir)/*~ core \#* ~* |
204 | |
205 | clean: mostlyclean |
206 | |
207 | distclean: clean |
208 | $(RM) Makefile \ |
209 | config.status config.cache config.h config.log |
210 | |
211 | maintainer-clean: distclean |
212 | $(RM) $(srcdir)/TAGS $(srcdir)/depend $(GENSRC) \ |
213 | |
214 | #----- Test rigs for various pieces of code --------------------------------- |
215 | |
216 | test: $(TESTS) |
217 | |
218 | %-test.o: %.c config.h |
219 | $(CC) $(CFLAGS) $(CPPFLAGS) $(TEST_DEFINES) -c $< -o $@ |
220 | |
221 | %-test: %-test.o $(BCMLIB) |
222 | $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ |
223 | |
224 | #----- Administrivia -------------------------------------------------------- |
225 | |
226 | .PHONY: all tags install instdirs uninstall tests depend \ |
227 | mostlyclean clean distclean maintainer-clean |
228 | |
229 | #----- Automatic dependencies ----------------------------------------------- |
230 | # |
231 | # [Generated dependencies] |
232 | idea.o: idea.c config.h idea.h config.h utils.h |
233 | md5.o: md5.c config.h md5.h config.h utils.h |
234 | icrypt.o: icrypt.c config.h icrypt.h config.h idea.h config.h |
235 | crypt.o: crypt.c config.h crypt.h become.h config.h config.h \ |
236 | icrypt.h config.h idea.h config.h md5.h config.h tx.h \ |
237 | utils.h |
238 | tx.o: tx.c config.h tx.h |
239 | class.o: class.c class.h sym.h set.h utils.h |
240 | name.o: name.c class.h sym.h name.h userdb.h utils.h |
241 | rule.o: rule.c become.h config.h class.h sym.h rule.h \ |
242 | utils.h |
243 | set.o: set.c set.h sym.h utils.h |
244 | sym.o: sym.c sym.h utils.h |
245 | userdb.o: userdb.c config.h sym.h userdb.h utils.h |
246 | check.o: check.c become.h config.h config.h crypt.h config.h \ |
247 | idea.h config.h lexer.h name.h class.h sym.h rule.h \ |
248 | parser.h parser.tab.h tx.h utils.h |
249 | daemon.o: daemon.c become.h config.h config.h crypt.h \ |
250 | config.h daemon.h idea.h config.h lexer.h name.h \ |
251 | class.h sym.h parser.h parser.tab.h rule.h tx.h \ |
252 | userdb.h utils.h |
253 | parser.y.o: parser.y class.h sym.h daemon.h lexer.h \ |
254 | name.h rule.h become.h config.h set.h userdb.h \ |
255 | utils.h |
256 | lexer.l.o: lexer.l become.h config.h lexer.h parser.h \ |
257 | class.h sym.h name.h parser.tab.h utils.h |
258 | mdwopt.o: mdwopt.c mdwopt.h |
259 | utils.o: utils.c config.h utils.h |
260 | become.o: become.c become.h config.h config.h check.h \ |
261 | daemon.h lexer.h mdwopt.h name.h class.h sym.h \ |
262 | parser.h parser.tab.h rule.h utils.h |
263 | keygen.o: keygen.c config.h tx.h mdwopt.h utils.h |