3 # $Id: Makefile.in,v 1.1 1997/07/21 13:47:55 mdw Exp $
5 # Makefile for `become'
10 #----- Licencing notice -----------------------------------------------------
12 # This file is part of `become'
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.
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.
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.
28 #----- Revision history -----------------------------------------------------
30 # $Log: Makefile.in,v $
31 # Revision 1.1 1997/07/21 13:47:55 mdw
35 #----- Configuration section ------------------------------------------------
37 # --- Miscellaneous stuff ---
42 # --- Finding source code ---
47 # --- Where to put things ---
50 exec_prefix= @exec_prefix@
59 CPPFLAGS= @CPPFLAGS@ -I$(srcdir) -I.
60 TEST_DEFINES= -DTEST_RIG
68 DEPEND= gcc -MM -MG -x c
78 # --- Installation ---
81 INSTALL_PROG= @INSTALL_PROGRAM@
82 INSTALL_DATA= @INSTALL_DATA@
84 # --- Other useful things ---
91 #----- Interesting files ----------------------------------------------------
93 # --- Library of common things ---
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 \
101 BCMLIBSRC= $(addprefix $(srcdir)/, $(BCMLIBSRCF))
102 BCMLIBOBJ= $(addsuffix .o, $(basename $(BCMLIBSRCF)))
104 # --- The `become' program ---
108 BECOMESRC= $(addprefix $(srcdir)/, $(BECOMESRCF))
109 BECOMEOBJ= $(addsuffix .o, $(basename $(BECOMESRCF)))
111 # --- The `keygen' program ---
115 KEYGENSRC= $(addprefix $(srcdir)/, $(KEYGENSRCF))
116 KEYGENOBJ= $(addsuffix .o, $(basename $(KEYGENSRCF)))
118 # --- Various tests for some important modules ---
120 TESTS= crypt-test icrypt-test idea-test md5-test \
121 name-test sym-test userdb-test \
123 TESTOBJ= $(addsuffix .o, $(TESTS))
127 ALLSRC= $(BCMLIBSRC) $(BECOMESRC) $(KEYGENSRC)
128 ALLOBJ= $(BCMLIBOBJ) $(BCMLIB) $(BECOMEOBJ) $(KEYGENOBJ) $(TESTOBJ)
130 # --- Generated source files ---
132 GENSRCF= parser.c parser.tab.h lexer.c
133 GENSRC= $(addprefix $(srcdir)/, $(GENSRCF))
135 # --- Installed files ---
137 INSTALLABLES= $(bindir)/$(BECOME) $(bindir)/$(KEYGEN)
139 #----- Parser tokens header file --------------------------------------------
144 #----- Main target ----------------------------------------------------------
146 all: $(BECOME) $(KEYGEN)
148 #----- Compiling the code ---------------------------------------------------
150 $(BCMLIB): $(BCMLIBOBJ)
151 $(AR) rc $(BCMLIB) $?
154 $(BECOME): $(BECOMEOBJ) $(BCMLIB)
155 $(LD) $(LDFLAGS) $^ $(LIBS) -o $(BECOME)
157 $(KEYGEN): $(KEYGENOBJ) $(BCMLIB)
158 $(LD) $(LDFLAGS) $^ $(LIBS) -o $(KEYGEN)
160 #----- Installation ---------------------------------------------------------
164 install: $(INSTALLABLES)
166 $(bindir):; $(srcdir)/mkinstalldirs $(bindir)
168 $(bindir)/%: % $(bindir)
169 $(INSTALL_PROG) $< $(bindir)
171 # --- Uninstalling ---
173 uninstall:; $(RM) $(INSTALLABLES)
175 #----- Environmental luxuries -----------------------------------------------
178 $(srcdir)/TAGS: $(ALLSRC)
179 $(ETAGS) $(ALLSRC) -o $(srcdir)/TAGS
181 depend: $(srcdir)/depend
182 $(srcdir)/depend: $(ALLSRC)
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
192 #----- Distribution building ------------------------------------------------
195 $(srcdir)/mkdist -p $(BECOME) -v $(VERSION) \
196 -m $(srcdir)/MANIFEST -i $(srcdir)
198 #----- Cleanliness ----------------------------------------------------------
200 mostlyclean:; $(RM) \
201 $(BECOME) $(KEYGEN) $(TESTS) $(ALLOBJ) \
203 $(srcdir)/core $(srcdir)/\#* $(srcdir)/*~ core \#* ~*
209 config.status config.cache config.h config.log
211 maintainer-clean: distclean
212 $(RM) $(srcdir)/TAGS $(srcdir)/depend $(GENSRC) \
214 #----- Test rigs for various pieces of code ---------------------------------
218 %-test.o: %.c config.h
219 $(CC) $(CFLAGS) $(CPPFLAGS) $(TEST_DEFINES) -c $< -o $@
221 %-test: %-test.o $(BCMLIB)
222 $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
224 #----- Administrivia --------------------------------------------------------
226 .PHONY: all tags install instdirs uninstall tests depend \
227 mostlyclean clean distclean maintainer-clean
229 #----- Automatic dependencies -----------------------------------------------
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 \
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 \
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 \
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 \
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