Initial revision
[become] / Makefile.in
CommitLineData
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
39SHELL= /bin/sh
40VERSION= @VERSION@
41
42# --- Finding source code ---
43
44srcdir= @srcdir@
45VPATH= @srcdir@
46
47# --- Where to put things ---
48
49prefix= @prefix@
50exec_prefix= @exec_prefix@
51bindir= @bindir@
52libdir= @libdir@
53etcdir= @sysconfdir@
54
55# --- Compiling ---
56
57CC= @CC@
58CFLAGS= @CFLAGS@
59CPPFLAGS= @CPPFLAGS@ -I$(srcdir) -I.
60TEST_DEFINES= -DTEST_RIG
61
62YACC= @YACC@
63YFLAGS= -d -v
64
65LEX= @LEX@
66LEXFLAGS=
67
68DEPEND= gcc -MM -MG -x c
69
70# --- Linking ---
71
72LD= @CC@
73LIBS= @LIBS@ @LEXLIB@
74LDFLAGS= @LDFLAGS@
75AR= @AR@
76RANLIB= @RANLIB@
77
78# --- Installation ---
79
80INSTALL= @INSTALL@
81INSTALL_PROG= @INSTALL_PROGRAM@
82INSTALL_DATA= @INSTALL_DATA@
83
84# --- Other useful things ---
85
86SED= sed
87MV= mv -f
88RM= rm -f
89ETAGS= etags
90
91#----- Interesting files ----------------------------------------------------
92
93# --- Library of common things ---
94
95BCMLIB= libbecome.a
96BCMLIBSRCF= 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
101BCMLIBSRC= $(addprefix $(srcdir)/, $(BCMLIBSRCF))
102BCMLIBOBJ= $(addsuffix .o, $(basename $(BCMLIBSRCF)))
103
104# --- The `become' program ---
105
106BECOME= become
107BECOMESRCF= become.c
108BECOMESRC= $(addprefix $(srcdir)/, $(BECOMESRCF))
109BECOMEOBJ= $(addsuffix .o, $(basename $(BECOMESRCF)))
110
111# --- The `keygen' program ---
112
113KEYGEN= keygen
114KEYGENSRCF= keygen.c
115KEYGENSRC= $(addprefix $(srcdir)/, $(KEYGENSRCF))
116KEYGENOBJ= $(addsuffix .o, $(basename $(KEYGENSRCF)))
117
118# --- Various tests for some important modules ---
119
120TESTS= crypt-test icrypt-test idea-test md5-test \
121 name-test sym-test userdb-test \
122 become-test
123TESTOBJ= $(addsuffix .o, $(TESTS))
124
125# --- Everything ---
126
127ALLSRC= $(BCMLIBSRC) $(BECOMESRC) $(KEYGENSRC)
128ALLOBJ= $(BCMLIBOBJ) $(BCMLIB) $(BECOMEOBJ) $(KEYGENOBJ) $(TESTOBJ)
129
130# --- Generated source files ---
131
132GENSRCF= parser.c parser.tab.h lexer.c
133GENSRC= $(addprefix $(srcdir)/, $(GENSRCF))
134
135# --- Installed files ---
136
137INSTALLABLES= $(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
146all: $(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
164install: $(INSTALLABLES)
165
166$(bindir):; $(srcdir)/mkinstalldirs $(bindir)
167
168$(bindir)/%: % $(bindir)
169 $(INSTALL_PROG) $< $(bindir)
170
171# --- Uninstalling ---
172
173uninstall:; $(RM) $(INSTALLABLES)
174
175#----- Environmental luxuries -----------------------------------------------
176
177tags: $(srcdir)/TAGS
178$(srcdir)/TAGS: $(ALLSRC)
179 $(ETAGS) $(ALLSRC) -o $(srcdir)/TAGS
180
181depend: $(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
194dist: $(GENSRC)
195 $(srcdir)/mkdist -p $(BECOME) -v $(VERSION) \
196 -m $(srcdir)/MANIFEST -i $(srcdir)
197
198#----- Cleanliness ----------------------------------------------------------
199
200mostlyclean:; $(RM) \
201 $(BECOME) $(KEYGEN) $(TESTS) $(ALLOBJ) \
202 y.output \
203 $(srcdir)/core $(srcdir)/\#* $(srcdir)/*~ core \#* ~*
204
205clean: mostlyclean
206
207distclean: clean
208 $(RM) Makefile \
209 config.status config.cache config.h config.log
210
211maintainer-clean: distclean
212 $(RM) $(srcdir)/TAGS $(srcdir)/depend $(GENSRC) \
213
214#----- Test rigs for various pieces of code ---------------------------------
215
216test: $(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]
232idea.o: idea.c config.h idea.h config.h utils.h
233md5.o: md5.c config.h md5.h config.h utils.h
234icrypt.o: icrypt.c config.h icrypt.h config.h idea.h config.h
235crypt.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
238tx.o: tx.c config.h tx.h
239class.o: class.c class.h sym.h set.h utils.h
240name.o: name.c class.h sym.h name.h userdb.h utils.h
241rule.o: rule.c become.h config.h class.h sym.h rule.h \
242 utils.h
243set.o: set.c set.h sym.h utils.h
244sym.o: sym.c sym.h utils.h
245userdb.o: userdb.c config.h sym.h userdb.h utils.h
246check.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
249daemon.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
253parser.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
256lexer.l.o: lexer.l become.h config.h lexer.h parser.h \
257 class.h sym.h name.h parser.tab.h utils.h
258mdwopt.o: mdwopt.c mdwopt.h
259utils.o: utils.c config.h utils.h
260become.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
263keygen.o: keygen.c config.h tx.h mdwopt.h utils.h