Imported Upstream version 1.6.8p12
[debian/sudo] / Makefile.in
1 #
2 # Copyright (c) 1996, 1998-2004 Todd C. Miller <Todd.Miller@courtesan.com>
3 #
4 # Permission to use, copy, modify, and distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
7 #
8 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 #
17 # Sponsored in part by the Defense Advanced Research Projects
18 # Agency (DARPA) and Air Force Research Laboratory, Air Force
19 # Materiel Command, USAF, under agreement number F39502-99-1-0512.
20 #
21 # @configure_input@
22 #
23 # $Sudo: Makefile.in,v 1.253 2004/09/15 20:11:22 millert Exp $
24 #
25
26 #### Start of system configuration section. ####
27
28 srcdir = @srcdir@
29 authdir = $(srcdir)/auth
30 top_builddir = .
31 VPATH = @srcdir@
32
33 # Compiler & tools to use
34 CC = @CC@
35 LEX = flex
36 YACC = @YACC@
37 NROFF = nroff
38 LIBTOOL = @LIBTOOL@
39
40 # Our install program supports extra flags...
41 INSTALL = $(SHELL) $(srcdir)/install-sh -c
42
43 # Libraries
44 LIBS = @LIBS@
45 NET_LIBS = @NET_LIBS@
46 SUDO_LIBS = @SUDO_LIBS@ @AFS_LIBS@ $(LIBS) $(NET_LIBS)
47
48 # C preprocessor flags
49 CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
50
51 # Usually -O and/or -g
52 CFLAGS = @CFLAGS@
53
54 # Flags to pass to the link stage
55 LDFLAGS = @LDFLAGS@
56 SUDO_LDFLAGS = @SUDO_LDFLAGS@ $(LDFLAGS)
57
58 # Where to install things...
59 prefix = @prefix@
60 exec_prefix = @exec_prefix@
61 bindir = @bindir@
62 sbindir = @sbindir@
63 sysconfdir = @sysconfdir@
64 mandir = @mandir@
65 noexecdir = @NOEXECDIR@
66
67 # Directory in which to install sudo.
68 sudodir = $(bindir)
69
70 # Directory in which to install visudo
71 visudodir = $(sbindir)
72
73 # Directory in which to install the sudoers file
74 sudoersdir = $(sysconfdir)
75
76 # Directory in which to install the man page
77 mantype = @MANTYPE@
78 mansectsu = @mansectsu@
79 mansectform = @mansectform@
80 mandirsu = $(mandir)/$(mantype)$(mansectsu)
81 mandirform = $(mandir)/$(mantype)$(mansectform)
82
83 # User and group ids the installed files should be "owned" by
84 install_uid = 0
85 install_gid = 0
86
87 # User, group, and mode the sudoers file should be "owned" by (configure)
88 sudoers_uid = @SUDOERS_UID@
89 sudoers_gid = @SUDOERS_GID@
90 sudoers_mode = @SUDOERS_MODE@
91
92 # Pass in paths and uid/gid + OS dependent defined
93 DEFS = @OSDEFS@ -D_PATH_SUDOERS=\"$(sudoersdir)/sudoers\" -D_PATH_SUDOERS_TMP=\"$(sudoersdir)/sudoers.tmp\" -DSUDOERS_UID=$(sudoers_uid) -DSUDOERS_GID=$(sudoers_gid) -DSUDOERS_MODE=$(sudoers_mode)
94
95 #### End of system configuration section. ####
96
97 SHELL = /bin/sh
98
99 PROGS = @PROGS@
100
101 SRCS = alloc.c alloca.c check.c closefrom.c def_data.c defaults.c env.c err.c \
102        fileops.c find_path.c fnmatch.c getcwd.c getprogname.c getspwuid.c \
103        gettime.c goodpath.c interfaces.c ldap.c lex.yy.c lsearch.c logging.c \
104        parse.c parse.lex parse.yacc set_perms.c sigaction.c snprintf.c \
105        strcasecmp.c strerror.c strlcat.c strlcpy.c sudo.c sudo_noexec.c \
106        sudo.tab.c sudo_edit.c testsudoers.c tgetpass.c utimes.c visudo.c \
107        zero_bytes.c $(AUTH_SRCS)
108
109 AUTH_SRCS = auth/afs.c auth/aix_auth.c auth/bsdauth.c auth/dce.c auth/fwtk.c \
110             auth/kerb4.c auth/kerb5.c auth/pam.c auth/passwd.c auth/rfc1938.c \
111             auth/secureware.c auth/securid.c auth/securid5.c auth/sia.c \
112             auth/sudo_auth.c
113
114 HDRS = compat.h def_data.h defaults.h ins_2001.h ins_classic.h ins_csops.h \
115        ins_goons.h insults.h interfaces.h logging.h parse.h sudo.h sudo.tab.h \
116        version.h auth/sudo_auth.h emul/err.h emul/fnmatch.h emul/search.h \
117        emul/utime.h
118
119 AUTH_OBJS = sudo_auth.o @AUTH_OBJS@
120
121 PARSEOBJS = sudo.tab.o lex.yy.o alloc.o defaults.o
122
123 SUDOBJS = check.o env.o getspwuid.o gettime.o goodpath.o fileops.o find_path.o \
124           interfaces.o logging.o parse.o set_perms.o sudo.o sudo_edit.o \
125           tgetpass.o zero_bytes.o @SUDO_OBJS@ $(AUTH_OBJS) $(PARSEOBJS)
126
127 VISUDOBJS = visudo.o fileops.o gettime.o goodpath.o find_path.o $(PARSEOBJS)
128
129 TESTOBJS = interfaces.o testsudoers.o $(PARSEOBJS)
130
131 LIBOBJS = @LIBOBJS@ @ALLOCA@
132
133 VERSION = 1.6.8p12
134
135 DISTFILES = $(SRCS) $(HDRS) BUGS CHANGES HISTORY INSTALL INSTALL.configure \
136             LICENSE Makefile.in PORTING README README.LDAP RUNSON TODO \
137             TROUBLESHOOTING UPGRADE aclocal.m4 acsite.m4 aixcrypt.exp \
138             config.guess config.h.in config.sub configure configure.in \
139             def_data.in fnmatch.3 indent.pro install-sh ltmain.sh mkdefaults \
140             mkinstalldirs pathnames.h.in sample.pam sample.syslog.conf \
141             sample.sudoers sudo.cat sudo.man.in sudo.pod sudoers sudoers.cat \
142             sudoers.man.in sudoers.pod sudoers2ldif visudo.cat visudo.man.in \
143             visudo.pod auth/API
144
145 BINFILES= BUGS CHANGES HISTORY LICENSE README TODO TROUBLESHOOTING \
146           UPGRADE install-sh mkinstalldirs sample.syslog.conf sample.sudoers \
147           sudo sudo.cat sudo.man sudo.pod sudoers sudoers.cat sudoers.man \
148           sudoers.pod visudo visudo.cat visudo.man visudo.pod
149
150 BINSPECIAL= INSTALL.binary Makefile.binary libtool
151
152 SUDODEP = $(srcdir)/sudo.h $(srcdir)/compat.h $(srcdir)/defaults.h \
153           $(srcdir)/logging.h config.h def_data.h pathnames.h
154
155 AUTHDEP = $(SUDODEP) $(authdir)/sudo_auth.h
156
157 INSDEP = $(srcdir)/ins_2001.h $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
158          $(srcdir)/ins_goons.h $(srcdir)/insults.h
159
160 all: $(PROGS)
161
162 .SUFFIXES: .o .c .h .lex .yacc .man .cat .lo
163
164 .c.o:
165         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
166
167 .c.lo:
168         $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
169
170 .man.cat:
171         @rm -f $(srcdir)/$@
172         $(NROFF) -man $< > $(srcdir)/$@
173
174 sudo: $(SUDOBJS) $(LIBOBJS)
175         $(CC) -o $@ $(SUDOBJS) $(LIBOBJS) $(SUDO_LDFLAGS) $(SUDO_LIBS)
176
177 visudo: $(VISUDOBJS) $(LIBOBJS)
178         $(CC) -o $@ $(VISUDOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
179
180 testsudoers: $(TESTOBJS) $(LIBOBJS)
181         $(CC) -o $@ $(TESTOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
182
183 sudo_noexec.la: sudo_noexec.lo
184         $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir)
185
186 # Uncomment the following if you want "make distclean" to clean the parser
187 @DEV@PARSESRCS = sudo.tab.h sudo.tab.c lex.yy.c def_data.c def_data.h
188
189 # Uncomment the following if you intend to modify parse.yacc
190 @DEV@sudo.tab.c sudo.tab.h: parse.yacc
191 @DEV@   rm -f sudo.tab.h sudo.tab.c
192 @DEV@   $(YACC) -d -b sudo $(srcdir)/parse.yacc
193
194 # Uncomment the following if you intend to modify parse.lex
195 @DEV@lex.yy.c: parse.lex
196 @DEV@   rm -f lex.yy.c
197 @DEV@   $(LEX) $(srcdir)/parse.lex
198
199 # Uncomment the following if you intend to modify def_data.in
200 @DEV@def_data.h def_data.c: def_data.in
201 @DEV@   perl $(srcdir)/mkdefaults -o def_data $(srcdir)/def_data.in
202
203 # Dependencies (not counting auth functions)
204 alloc.o: alloc.c $(SUDODEP)
205 check.o: check.c $(SUDODEP)
206 closefrom.o: closefrom.c config.h
207 env.o: env.c $(SUDODEP)
208 err.o: err.c config.h compat.h emul/err.h
209 fileops.o: fileops.c $(SUDODEP)
210 find_path.o: find_path.c $(SUDODEP)
211 getprogname.o: getprogname.c config.h
212 getspwuid.o: getspwuid.c $(SUDODEP)
213 goodpath.o: goodpath.c $(SUDODEP)
214 logging.o: logging.c $(SUDODEP)
215 set_perms.o: set_perms.c $(SUDODEP)
216 tgetpass.o: tgetpass.c $(SUDODEP)
217 visudo.o: visudo.c $(SUDODEP) version.h
218 sudo.o: sudo.c $(SUDODEP) interfaces.h version.h
219 interfaces.o: interfaces.c $(SUDODEP) interfaces.h
220 testsudoers.o: testsudoers.c $(SUDODEP) parse.h interfaces.h
221 parse.o: parse.c $(SUDODEP) parse.h interfaces.h
222 lex.yy.o: lex.yy.c $(SUDODEP) parse.h sudo.tab.h
223 sudo.tab.o: sudo.tab.c $(SUDODEP) parse.h sudo.tab.c sudo.tab.h
224 defaults.o: defaults.c $(SUDODEP) def_data.c auth/sudo_auth.h
225 fnmatch.o: fnmatch.c config.h compat.h emul/fnmatch.h
226 getcwd.o: getcwd.c config.h compat.h
227 lsearch.o: lsearch.c config.h compat.h emul/search.h
228 snprintf.o: snprintf.c config.h compat.h
229 strcasecmp.o: strcasecmp.c config.h
230 strlcat.o: strlcat.c config.h
231 strlcpy.o: strlcpy.c config.h
232 strerror.o: strerror.c config.h
233 utime.o: utime.c config.h pathnames.h compat.h emul/utime.h
234 ldap.o: ldap.c $(SUDODEP) parse.h
235
236 # Authentication functions live in "auth" dir and so need extra care
237 sudo_auth.o: $(authdir)/sudo_auth.c $(AUTHDEP) $(INSDEP)
238         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sudo_auth.c
239 afs.o: $(authdir)/afs.c $(AUTHDEP)
240         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/afs.c
241 aix_auth.o: $(authdir)/aix_auth.c $(AUTHDEP)
242         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/aix_auth.c
243 bsdauth.o: $(authdir)/bsdauth.c $(AUTHDEP)
244         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/bsdauth.c
245 dce.o: $(authdir)/dce.c $(AUTHDEP)
246         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/dce.c
247 fwtk.o: $(authdir)/fwtk.c $(AUTHDEP)
248         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/fwtk.c
249 kerb4.o: $(authdir)/kerb4.c $(AUTHDEP)
250         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb4.c
251 kerb5.o: $(authdir)/kerb5.c $(AUTHDEP)
252         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb5.c
253 pam.o: $(authdir)/pam.c $(AUTHDEP)
254         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/pam.c
255 passwd.o: $(authdir)/passwd.c $(AUTHDEP)
256         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/passwd.c
257 rfc1938.o: $(authdir)/rfc1938.c $(AUTHDEP)
258         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/rfc1938.c
259 secureware.o: $(authdir)/secureware.c $(AUTHDEP)
260         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/secureware.c
261 securid.o: $(authdir)/securid.c $(AUTHDEP)
262         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/securid.c
263 securid5.o: $(authdir)/securid5.c $(AUTHDEP)
264         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/securid5.c
265 sia.o: $(authdir)/sia.c $(AUTHDEP)
266         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c
267
268 sudo.man.in: $(srcdir)/sudo.pod
269         @rm -f $(srcdir)/$@
270         ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e 1d -e '/^=pod/q' -e 's/^/.\\" /p' sudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" >> $@ )
271
272 sudo.man: sudo.man.in
273         CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
274
275 sudo.cat: sudo.man
276
277 visudo.man.in: $(srcdir)/visudo.pod
278         @rm -f $(srcdir)/$@
279         ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e 1d -e '/^=pod/q' -e 's/^/.\\" /p' visudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" visudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" >> $@ )
280
281 visudo.man: visudo.man.in
282         CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
283
284 visudo.cat: visudo.man
285
286 sudoers.man.in: $(srcdir)/sudoers.pod
287         @rm -f $(srcdir)/$@
288         ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e 1d -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" >> $@ )
289
290 sudoers.man:: sudoers.man.in
291         CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
292
293 sudoers.cat: sudoers.man
294
295 install: install-dirs install-binaries @INSTALL_NOEXEC@ install-sudoers install-man
296
297 install-dirs:
298         $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(sudodir) \
299             $(DESTDIR)$(visudodir) $(DESTDIR)$(sudoersdir) \
300             $(DESTDIR)$(mandirsu) $(DESTDIR)$(mandirform) \
301             $(DESTDIR)$(noexecdir)
302
303 install-binaries: $(PROGS)
304         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 4111 -s sudo $(DESTDIR)$(sudodir)/sudo
305         rm -f $(DESTDIR)$(sudodir)/sudoedit
306         ln $(DESTDIR)$(sudodir)/sudo $(DESTDIR)$(sudodir)/sudoedit
307
308         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0111 -s visudo $(DESTDIR)$(visudodir)/visudo
309
310 install-noexec: sudo_noexec.la
311         $(LIBTOOL) --mode=install $(INSTALL) sudo_noexec.la $(DESTDIR)$(noexecdir)
312
313 bininst-noexec: sudo_noexec.la
314         $(LIBTOOL) --mode=install $(INSTALL) sudo_noexec.la $(DESTDIR)$(noexecdir)
315
316 install-sudoers:
317         test -f $(DESTDIR)$(sudoersdir)/sudoers || \
318             $(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
319                 $(srcdir)/sudoers $(DESTDIR)$(sudoersdir)/sudoers
320
321 install-man:
322         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudo.$(mantype) $(DESTDIR)$(mandirsu)/sudo.$(mansectsu)
323         @rm -f $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
324         ln $(DESTDIR)$(mandirsu)/sudo.$(mansectsu) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
325         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/visudo.$(mantype) $(DESTDIR)$(mandirsu)/visudo.$(mansectsu)
326         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoers.$(mantype) $(DESTDIR)$(mandirform)/sudoers.$(mansectform)
327 @MAN_POSTINSTALL@
328
329 check:
330         @echo nothing to check
331
332 tags: $(SRCS)
333         ctags $(SRCS)
334
335 TAGS: $(SRCS)
336         etags $(SRCS)
337
338 clean:
339         -rm -f *.o $(PROGS) testsudoers core sudo.core visudo.core \
340                testsudoers.core
341
342 mostlyclean: clean
343
344 distclean: clean
345         -rm -rf Makefile pathnames.h config.h config.status config.cache \
346                 config.log libtool sudo_noexec.lo .libs $(PARSESRCS) \
347                 sudo.man sudoers.man visudo.man
348
349 clobber: distclean
350
351 realclean: distclean
352         rm -f TAGS tags
353
354 cleandir: realclean
355
356 dist:
357         rm -f ../sudo-$(VERSION).tar.gz
358         ( cd .. ; TF="/tmp/sudo.dist$$$$" ; rm -f $$TF ; for i in $(DISTFILES) ; \
359           do echo sudo-$(VERSION)/$$i >> $$TF ; done ; \
360           tar Ocf sudo-$(VERSION).tar \
361           `cat $$TF` && gzip --best sudo-$(VERSION).tar && rm -f $$TF)
362         ls -l ../sudo-$(VERSION).tar.gz
363
364 bindist:
365         ( \
366           ARCH=`uname -m|sed 's:/:_:g'`+`uname -sr|sed 's/ /_/g'` ; \
367           mkdir tmp.$$ARCH ; \
368           tdir=tmp.$$ARCH/sudo-$(VERSION) ; \
369           mkdir $$tdir ; \
370           for i in $(BINFILES) ; do \
371             if [ -f $$i ]; then \
372               cp $$i $$tdir ; \
373             elif [ -f $(srcdir)/$$i ]; then \
374               cp $(srcdir)/$$i $$tdir ; \
375             else \
376               echo cannot find $$i ; \
377               exit 1 ; \
378             fi ; \
379           done ; \
380           if [ -f sudo_noexec.la ]; then \
381             cp libtool $$tdir ; \
382             $(LIBTOOL) --mode=install $(INSTALL) sudo_noexec.la `pwd`/$$tdir ; \
383             ln $$tdir/sudo_noexec.la $$tdir/sudo_noexec.lai ; \
384             ln -s . $$tdir/.libs ; \
385           fi ; \
386           cp $(srcdir)/INSTALL.binary $$tdir/INSTALL ; \
387           sh ./config.status --file=Makefile.binary && cp Makefile.binary $$tdir/Makefile ; \
388           strip sudo ; \
389           strip visudo ; \
390           cd tmp.$$ARCH && tar Ocf ../sudo-$(VERSION)-$$ARCH.tar sudo-$(VERSION) && cd .. ; \
391           gzip --best sudo-$(VERSION)-$$ARCH.tar ; \
392           rm -rf tmp.$$ARCH ; \
393         )