Merge commit 'upstream/1.7.2p2'
[debian/sudo] / Makefile.in
1 #
2 # Copyright (c) 1996, 1998-2005, 2007-2009
3 #       Todd C. Miller <Todd.Miller@courtesan.com>
4 #
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 #
18 # Sponsored in part by the Defense Advanced Research Projects
19 # Agency (DARPA) and Air Force Research Laboratory, Air Force
20 # Materiel Command, USAF, under agreement number F39502-99-1-0512.
21 #
22 # @configure_input@
23 #
24 # $Sudo: Makefile.in,v 1.340 2009/06/15 21:18:53 millert Exp $
25 #
26
27 #### Start of system configuration section. ####
28
29 srcdir = @srcdir@
30 devdir = @devdir@
31 authdir = $(srcdir)/auth
32 top_builddir = .
33
34 # Compiler & tools to use
35 CC = @CC@
36 FLEX = @FLEX@
37 YACC = @YACC@
38 NROFF = nroff -Tascii
39 LIBTOOL = @LIBTOOL@
40
41 # Our install program supports extra flags...
42 INSTALL = $(SHELL) $(srcdir)/install-sh -c
43
44 # Libraries
45 LIBS = @LIBS@
46 NET_LIBS = @NET_LIBS@
47 SUDO_LIBS = @SUDO_LIBS@ @AFS_LIBS@ @GETGROUPS_LIB@ $(LIBS) $(NET_LIBS)
48
49 # C preprocessor flags
50 CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
51
52 # Usually -O and/or -g
53 CFLAGS = @CFLAGS@
54
55 # Flags to pass to the link stage
56 LDFLAGS = @LDFLAGS@
57 SUDO_LDFLAGS = @SUDO_LDFLAGS@ $(LDFLAGS)
58
59 # Where to install things...
60 prefix = @prefix@
61 exec_prefix = @exec_prefix@
62 bindir = @bindir@
63 sbindir = @sbindir@
64 sysconfdir = @sysconfdir@
65 libexecdir = @libexecdir@
66 datarootdir = @datarootdir@
67 mandir = @mandir@
68 noexecfile = @NOEXECFILE@
69 noexecdir = @NOEXECDIR@
70
71 # Directory in which to install sudo.
72 sudodir = $(bindir)
73
74 # Directory in which to install visudo
75 visudodir = $(sbindir)
76
77 # Directory in which to install the sudoers file
78 sudoersdir = $(sysconfdir)
79
80 # Directory in which to install the man page
81 mantype = @MANTYPE@
82 mansectsu = @mansectsu@
83 mansectform = @mansectform@
84 mandirsu = $(mandir)/$(mantype)$(mansectsu)
85 mandirform = $(mandir)/$(mantype)$(mansectform)
86
87 # User and group ids the installed files should be "owned" by
88 install_uid = 0
89 install_gid = 0
90
91 # User, group, and mode the sudoers file should be "owned" by (configure)
92 sudoers_uid = @SUDOERS_UID@
93 sudoers_gid = @SUDOERS_GID@
94 sudoers_mode = @SUDOERS_MODE@
95
96 # Pass in paths and uid/gid + OS dependent defined
97 DEFS = @OSDEFS@ -D_PATH_SUDOERS=\"$(sudoersdir)/sudoers\" -DSUDOERS_UID=$(sudoers_uid) -DSUDOERS_GID=$(sudoers_gid) -DSUDOERS_MODE=$(sudoers_mode)
98
99 #### End of system configuration section. ####
100
101 SHELL = /bin/sh
102
103 PROGS = @PROGS@
104
105 SRCS = aix.c alias.c alloc.c audit.c bsm_audit.c check.c closefrom.c \
106        def_data.c defaults.c env.c error.c fileops.c find_path.c fnmatch.c \
107        getcwd.c getprogname.c getspwuid.c gettime.c glob.c goodpath.c gram.c \
108        gram.y interfaces.c isblank.c lbuf.c ldap.c list.c logging.c match.c \
109        mkstemp.c memrchr.c parse.c pwutil.c  set_perms.c sigaction.c \
110        snprintf.c strcasecmp.c strerror.c strlcat.c strlcpy.c sudo.c \
111        sudo_noexec.c sudo_edit.c sudo_nss.c term.c testsudoers.c tgetpass.c \
112        toke.c toke.l tsgetgrpw.c utimes.c vasgroups.c visudo.c zero_bytes.c \
113        redblack.c selinux.c sesh.c $(AUTH_SRCS)
114
115 AUTH_SRCS = auth/afs.c auth/aix_auth.c auth/bsdauth.c auth/dce.c auth/fwtk.c \
116             auth/kerb4.c auth/kerb5.c auth/pam.c auth/passwd.c auth/rfc1938.c \
117             auth/secureware.c auth/securid.c auth/securid5.c auth/sia.c \
118             auth/sudo_auth.c
119
120 HDRS = bsm_audit.h compat.h def_data.h defaults.h error.h ins_2001.h \
121        ins_classic.h ins_csops.h ins_goons.h insults.h interfaces.h lbuf.h \
122        list.h logging.h nonunix.h redblack.h parse.h sudo.h sudo_nss.h gram.h \
123        auth/sudo_auth.h emul/charclass.h emul/fnmatch.h emul/glob.h \
124        emul/timespec.h emul/utime.h
125
126 AUTH_OBJS = sudo_auth.o @AUTH_OBJS@
127
128 # Note: gram.o must come first here
129 COMMON_OBJS = gram.o alias.o alloc.o defaults.o error.o list.o match.o \
130               toke.o redblack.o zero_bytes.o @NONUNIX_GROUPS_IMPL@
131
132 SUDO_OBJS = $(COMMON_OBJS) $(AUTH_OBJS) @SUDO_OBJS@ audit.o check.o env.o \
133             getspwuid.o gettime.o goodpath.o fileops.o find_path.o \
134             interfaces.o lbuf.o logging.o parse.o pwutil.o set_perms.o \
135             sudo.o sudo_edit.o sudo_nss.o term.o tgetpass.o
136
137 VISUDO_OBJS = $(COMMON_OBJS) visudo.o fileops.o gettime.o goodpath.o \
138               find_path.o pwutil.o
139
140 TEST_OBJS = $(COMMON_OBJS) interfaces.o testsudoers.o tsgetgrpw.o tspwutil.o
141
142 LIB_OBJS = @LIBOBJS@
143
144 VERSION = @PACKAGE_VERSION@
145
146 DISTFILES = $(SRCS) $(HDRS) ChangeLog HISTORY INSTALL INSTALL.configure \
147             LICENSE Makefile.in PORTING README README.LDAP TROUBLESHOOTING \
148             UPGRADE WHATSNEW aclocal.m4 acsite.m4 aixcrypt.exp config.guess \
149             config.h.in config.sub configure configure.in def_data.in \
150             indent.pro install-sh ltmain.sh mkdefaults mkinstalldirs \
151             pathnames.h.in sample.pam sample.syslog.conf sample.sudoers \
152             schema.ActiveDirectory schema.OpenLDAP schema.iPlanet sudo.cat \
153             sudo.man.in sudo.pod sudo.psf sudo_usage.h.in sudoers sudoers.cat \
154             sudoers.man.in sudoers.pod sudoers.ldap.cat sudoers.ldap.man.in \
155             sudoers.ldap.pod sudoers2ldif visudo.cat visudo.man.in visudo.pod \
156             auth/API sudo.man.pl sudoers.man.pl
157
158 BINFILES= ChangeLog HISTORY LICENSE README TROUBLESHOOTING \
159           UPGRADE install-sh mkinstalldirs sample.syslog.conf sample.sudoers \
160           sudo sudo.cat sudo.man sudo.pod sudoers sudoers.cat sudoers.man \
161           sudoers.pod visudo visudo.cat visudo.man visudo.pod
162
163 BINSPECIAL= INSTALL.binary Makefile.binary.in libtool
164
165 SUDODEP = $(srcdir)/sudo.h $(srcdir)/compat.h $(srcdir)/defaults.h \
166           $(srcdir)/error.h $(srcdir)/list.h $(srcdir)/logging.h \
167           $(srcdir)/sudo_nss.h $(devdir)/def_data.h pathnames.h config.h
168
169 AUTHDEP = $(SUDODEP) $(authdir)/sudo_auth.h
170
171 INSDEP = $(srcdir)/ins_2001.h $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
172          $(srcdir)/ins_goons.h $(srcdir)/insults.h
173
174 all: $(PROGS)
175
176 .SUFFIXES: .o .c .h .l .y .man .cat .lo
177
178 .c.o:
179         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
180
181 .c.lo:
182         $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
183
184 .man.cat:
185         @rm -f $@
186         sed '1s/^/.if n .ll 78n/' $< | $(NROFF) -man > $@
187
188 sudo: $(SUDO_OBJS) $(LIB_OBJS)
189         $(CC) -o $@ $(SUDO_OBJS) $(LIB_OBJS) $(SUDO_LDFLAGS) $(SUDO_LIBS)
190
191 visudo: $(VISUDO_OBJS) $(LIB_OBJS)
192         $(CC) -o $@ $(VISUDO_OBJS) $(LIB_OBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
193
194 testsudoers: $(TEST_OBJS) $(LIB_OBJS)
195         $(CC) -o $@ $(TEST_OBJS) $(LIB_OBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
196
197 sudo_noexec.lo: $(srcdir)/sudo_noexec.c
198         $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo_noexec.c
199
200 sudo_noexec.la: sudo_noexec.lo
201         $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir)
202
203 # Uncomment the following if you want "make distclean" to clean the parser
204 @DEV@GENERATED = gram.h gram.c toke.c def_data.c def_data.h
205
206 # Uncomment the lines before -@true if you intend to modify gram.y
207 $(devdir)/gram.c: $(srcdir)/gram.y
208 @DEV@   $(YACC) -d $(srcdir)/gram.y
209 @DEV@   mv -f y.tab.c gram.c
210 @DEV@   if cmp -s y.tab.h gram.h; then rm -f y.tab.h; else mv -f y.tab.h gram.h; fi
211         -@true
212
213 # Uncomment the lines before -@true if you intend to modify toke.l
214 $(devdir)/toke.c: $(srcdir)/toke.l
215 @DEV@   $(FLEX) $(srcdir)/toke.l
216 @DEV@   mv -f lex.yy.c toke.c
217         -@true
218
219 # Uncomment the following if you intend to modify def_data.in
220 @DEV@$(devdir)/def_data.h $(devdir)/def_data.c: $(srcdir)/def_data.in
221 @DEV@   perl $(srcdir)/mkdefaults -o def_data $(srcdir)/def_data.in
222
223 # Dependencies (not counting auth functions)
224 aix.o: $(srcdir)/aix.c
225         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/aix.c
226 alias.o: $(srcdir)/alias.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h $(srcdir)/redblack.h
227         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/alias.c
228 alloc.o: $(srcdir)/alloc.c $(SUDODEP)
229         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/alloc.c
230 audit.o: $(srcdir)/audit.c $(SUDODEP)
231         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/audit.c
232 bsm_audit.o: $(srcdir)/bsm_audit.c $(SUDODEP) bsm_audit.h
233         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/bsm_audit.c
234 check.o: $(srcdir)/check.c $(SUDODEP)
235         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/check.c
236 closefrom.o: $(srcdir)/closefrom.c config.h
237         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/closefrom.c
238 defaults.o: $(srcdir)/defaults.c $(SUDODEP) $(srcdir)/def_data.c $(authdir)/sudo_auth.h $(devdir)/gram.h
239         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/defaults.c
240 env.o: $(srcdir)/env.c $(SUDODEP)
241         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/env.c
242 error.o: $(srcdir)/error.c $(srcdir)/compat.h $(srcdir)/error.h config.h
243         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/error.c
244 fileops.o: $(srcdir)/fileops.c $(SUDODEP)
245         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/fileops.c
246 find_path.o: $(srcdir)/find_path.c $(SUDODEP)
247         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/find_path.c
248 fnmatch.o: $(srcdir)/fnmatch.c $(srcdir)/emul/fnmatch.h $(srcdir)/compat.h config.h
249         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/fnmatch.c
250 getcwd.o: $(srcdir)/getcwd.c $(srcdir)/compat.h config.h
251         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getcwd.c
252 getprogname.o: $(srcdir)/getprogname.c config.h
253         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getprogname.c
254 getspwuid.o: $(srcdir)/getspwuid.c $(SUDODEP)
255         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getspwuid.c
256 gettime.o: $(srcdir)/gettime.c $(SUDODEP)
257         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/gettime.c
258 glob.o: $(srcdir)/glob.c $(srcdir)/emul/glob.h $(srcdir)/compat.h config.h
259         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/glob.c
260 goodpath.o: $(srcdir)/goodpath.c $(SUDODEP)
261         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/goodpath.c
262 gram.o: $(devdir)/gram.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h $(devdir)/gram.h
263         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(devdir)/gram.c
264 interfaces.o: $(srcdir)/interfaces.c $(SUDODEP) $(srcdir)/interfaces.h
265         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/interfaces.c
266 isblank.o: $(srcdir)/isblank.c $(srcdir)/compat.h config.h
267         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/isblank.c
268 lbuf.o: $(srcdir)/lbuf.c $(SUDODEP)
269         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/lbuf.c
270 ldap.o: $(srcdir)/ldap.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h
271         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/ldap.c
272 list.o: $(srcdir)/list.c $(SUDODEP)
273         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/list.c
274 logging.o: $(srcdir)/logging.c $(SUDODEP)
275         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/logging.c
276 match.o: $(srcdir)/match.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h $(srcdir)/interfaces.h $(devdir)/gram.h
277         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/match.c
278 memrchr.o: $(srcdir)/memrchr.c $(SUDODEP)
279         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/memrchr.c
280 mkstemp.o: $(srcdir)/mkstemp.c $(SUDODEP)
281         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/mkstemp.c
282 parse.o: $(srcdir)/parse.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h $(devdir)/gram.h
283         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/parse.c
284 pwutil.o: $(srcdir)/pwutil.c $(SUDODEP)
285         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/pwutil.c
286 redblack.o: $(srcdir)/redblack.c $(SUDODEP) $(srcdir)/redblack.h
287         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/redblack.c
288 set_perms.o: $(srcdir)/set_perms.c $(SUDODEP)
289         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/set_perms.c
290 sigaction.o: $(srcdir)/sigaction.c $(srcdir)/compat.h
291         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sigaction.c
292 snprintf.o: $(srcdir)/snprintf.c $(srcdir)/compat.h config.h
293         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/snprintf.c
294 strcasecmp.o: $(srcdir)/strcasecmp.c $(srcdir)/compat.h  config.h
295         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/strcasecmp.c
296 strerror.o: $(srcdir)/strerror.c $(srcdir)/compat.h config.h
297         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/strerror.c
298 strlcat.o: $(srcdir)/strlcat.c $(srcdir)/compat.h config.h
299         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/strlcat.c
300 strlcpy.o: $(srcdir)/strlcpy.c $(srcdir)/compat.h config.h
301         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/strlcpy.c
302 selinux.o: $(srcdir)/selinux.c $(SUDODEP)
303         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/selinux.c
304 sudo.o: $(srcdir)/sudo.c $(SUDODEP) sudo_usage.h $(srcdir)/interfaces.h
305         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo.c
306 sudo_edit.o: $(srcdir)/sudo_edit.c $(SUDODEP)
307         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo_edit.c
308 sudo_noexec.o: $(srcdir)/sudo_noexec.c $(srcdir)/compat.h config.h
309         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo_noexec.c
310 sudo_nss.o: $(srcdir)/sudo_nss.c $(SUDODEP)
311         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo_nss.c
312 term.o: $(srcdir)/term.c $(SUDODEP)
313         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/term.c
314 testsudoers.o: $(srcdir)/testsudoers.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h $(srcdir)/interfaces.h $(devdir)/gram.h
315         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/testsudoers.c
316 tgetpass.o: $(srcdir)/tgetpass.c $(SUDODEP)
317         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/tgetpass.c
318 toke.o: $(devdir)/toke.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h $(devdir)/gram.h
319         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(devdir)/toke.c
320 tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(SUDODEP)
321         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/tsgetgrpw.c
322 utimes.o: $(srcdir)/utimes.c $(srcdir)/compat.h $(srcdir)/emul/utime.h config.h
323         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/utimes.c
324 vasgroups.o: $(srcdir)/vasgroups.c $(srcdir)/nonunix.h $(SUDODEP)
325         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/vasgroups.c
326 visudo.o: $(srcdir)/visudo.c $(SUDODEP) $(devdir)/gram.h
327         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/visudo.c
328 zero_bytes.o: $(srcdir)/zero_bytes.c $(srcdir)/compat.h config.h
329         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/zero_bytes.c
330
331 # Private copy of pwutil.o with MYPW defined for testsudoers
332 tspwutil.o: $(srcdir)/pwutil.c $(SUDODEP)
333         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) -DMYPW -o tspwutil.o $(srcdir)/pwutil.c
334
335 sudo_auth.o: $(authdir)/sudo_auth.c $(AUTHDEP) $(INSDEP)
336         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sudo_auth.c
337 afs.o: $(authdir)/afs.c $(AUTHDEP)
338         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/afs.c
339 aix_auth.o: $(authdir)/aix_auth.c $(AUTHDEP)
340         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/aix_auth.c
341 bsdauth.o: $(authdir)/bsdauth.c $(AUTHDEP)
342         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/bsdauth.c
343 dce.o: $(authdir)/dce.c $(AUTHDEP)
344         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/dce.c
345 fwtk.o: $(authdir)/fwtk.c $(AUTHDEP)
346         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/fwtk.c
347 kerb4.o: $(authdir)/kerb4.c $(AUTHDEP)
348         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb4.c
349 kerb5.o: $(authdir)/kerb5.c $(AUTHDEP)
350         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb5.c
351 pam.o: $(authdir)/pam.c $(AUTHDEP)
352         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/pam.c
353 passwd.o: $(authdir)/passwd.c $(AUTHDEP)
354         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/passwd.c
355 rfc1938.o: $(authdir)/rfc1938.c $(AUTHDEP)
356         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/rfc1938.c
357 secureware.o: $(authdir)/secureware.c $(AUTHDEP)
358         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/secureware.c
359 securid.o: $(authdir)/securid.c $(AUTHDEP)
360         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/securid.c
361 securid5.o: $(authdir)/securid5.c $(AUTHDEP)
362         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/securid5.c
363 sia.o: $(authdir)/sia.c $(AUTHDEP)
364         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c
365
366 sudo.man.in: $(srcdir)/sudo.pod
367         @rm -f $(srcdir)/$@
368         ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -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)/" | perl -p sudo.man.pl >> $@ )
369
370 sudo.man: sudo.man.in
371         CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
372
373 sudo.cat: sudo.man
374
375 visudo.man.in: $(srcdir)/visudo.pod
376         @rm -f $(srcdir)/$@
377         ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -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)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ )
378
379 visudo.man: visudo.man.in
380         CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
381
382 visudo.cat: visudo.man
383
384 sudoers.man.in: $(srcdir)/sudoers.pod
385         @rm -f $(srcdir)/$@
386         ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -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)/" | perl -p sudoers.man.pl >> $@ )
387
388 sudoers.man:: sudoers.man.in
389         CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
390
391 sudoers.cat: sudoers.man
392
393 sudoers.ldap.man.in: $(srcdir)/sudoers.ldap.pod
394         @rm -f $(srcdir)/$@
395         ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.ldap.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.ldap.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ )
396
397 sudoers.ldap.man:: sudoers.ldap.man.in
398         CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
399
400 sudoers.ldap.cat: sudoers.ldap.man
401
402 @DEV@HISTORY: history.pod
403 @DEV@   pod2text -l -i0 $> > $@
404 @DEV@
405 @DEV@LICENSE: license.pod
406 @DEV@   pod2text -l -i0 $> | sed '1,2d' > $@
407
408 ChangeLog:
409         cvs2cl --follow-only trunk
410
411 install: install-dirs install-binaries @INSTALL_NOEXEC@ install-sudoers install-man
412
413 install-dirs:
414         $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(sudodir) \
415             $(DESTDIR)$(visudodir) $(DESTDIR)$(sudoersdir) \
416             $(DESTDIR)$(mandirsu) $(DESTDIR)$(mandirform) \
417             $(DESTDIR)$(noexecdir)
418
419 install-binaries: install-dirs $(PROGS)
420         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 4111 -s sudo $(DESTDIR)$(sudodir)/sudo
421         rm -f $(DESTDIR)$(sudodir)/sudoedit
422         ln $(DESTDIR)$(sudodir)/sudo $(DESTDIR)$(sudodir)/sudoedit
423         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0111 -s visudo $(DESTDIR)$(visudodir)/visudo
424 @SELINUX@       $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0111 -s sesh $(DESTDIR)$(libexecdir)/sesh
425
426 install-noexec: install-dirs sudo_noexec.la
427         test -f .libs/$(noexecfile) && $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0755 .libs/$(noexecfile) $(DESTDIR)$(noexecdir)
428
429 install-sudoers: install-dirs
430         test -f $(DESTDIR)$(sudoersdir)/sudoers || \
431             $(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
432                 $(srcdir)/sudoers $(DESTDIR)$(sudoersdir)/sudoers
433
434 install-man: install-dirs
435         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudo.$(mantype) $(DESTDIR)$(mandirsu)/sudo.$(mansectsu)
436         @rm -f $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
437         ln $(DESTDIR)$(mandirsu)/sudo.$(mansectsu) $(DESTDIR)$(mandirsu)/sudoedit.$(mansectsu)
438         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/visudo.$(mantype) $(DESTDIR)$(mandirsu)/visudo.$(mansectsu)
439         $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoers.$(mantype) $(DESTDIR)$(mandirform)/sudoers.$(mansectform)
440         @LDAP@$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoers.ldap.$(mantype) $(DESTDIR)$(mandirform)/sudoers.ldap.$(mansectform)
441 @MAN_POSTINSTALL@
442
443 check:
444         @echo nothing to check
445
446 clean:
447         -rm -f *.o *.lo stamp-* $(PROGS) testsudoers core *.core core.*
448
449 mostlyclean: clean
450
451 distclean: clean
452         -rm -rf Makefile pathnames.h config.h config.status config.cache \
453                 config.log libtool sudo_noexec.lo .libs $(GENERATED) \
454                 sudo.man sudoers.man sudoers.ldap.man visudo.man sudo_usage.h \
455                 Makefile.binary
456
457 clobber: distclean
458
459 realclean: distclean
460         rm -f TAGS tags
461
462 cleandir: realclean
463
464 dist:
465         rm -f ../sudo-$(VERSION).tar.gz
466         ( cd .. ; TF="/tmp/sudo.dist$$$$" ; rm -f $$TF ; for i in $(DISTFILES) ; \
467           do echo sudo-$(VERSION)/$$i >> $$TF ; done ; \
468           tar Ocf sudo-$(VERSION).tar \
469           `cat $$TF` && gzip --best sudo-$(VERSION).tar && rm -f $$TF)
470         ls -l ../sudo-$(VERSION).tar.gz
471
472 bindist:
473         ( \
474           ARCH=`uname -m|sed 's:/:_:g'`+`uname -sr|sed 's/ /_/g'` ; \
475           mkdir tmp.$$ARCH ; \
476           tdir=tmp.$$ARCH/sudo-$(VERSION) ; \
477           mkdir $$tdir ; \
478           for i in $(BINFILES) ; do \
479             if [ -f $$i ]; then \
480               cp $$i $$tdir ; \
481             elif [ -f $(srcdir)/$$i ]; then \
482               cp $(srcdir)/$$i $$tdir ; \
483             else \
484               echo cannot find $$i ; \
485               exit 1 ; \
486             fi ; \
487           done ; \
488           if [ -f sudo_noexec.la ]; then \
489             cp libtool $$tdir ; \
490             $(LIBTOOL) --mode=install $(INSTALL) sudo_noexec.la `pwd`/$$tdir ; \
491             ln $$tdir/sudo_noexec.la $$tdir/sudo_noexec.lai ; \
492             ln -s . $$tdir/.libs ; \
493           fi ; \
494           cp $(srcdir)/INSTALL.binary $$tdir/INSTALL ; \
495           sh ./config.status --file=Makefile.binary && cp Makefile.binary $$tdir/Makefile ; \
496           strip $$tdir/sudo ; \
497           strip $$tdir/visudo ; \
498           cd tmp.$$ARCH && tar Ocf ../sudo-$(VERSION)-$$ARCH.tar sudo-$(VERSION) && cd .. ; \
499           gzip -f --best sudo-$(VERSION)-$$ARCH.tar ; \
500           rm -rf tmp.$$ARCH ; \
501         )
502
503 depot:
504         ( \
505           tdir=tmp.depot ; \
506           mkdir $$tdir ; \
507           for i in sudo visudo sudo.man visudo.man sudoers.man sudoers ChangeLog HISTORY LICENSE README TROUBLESHOOTING UPGRADE sample.syslog.conf sample.sudoers; do \
508             if [ -f $$i ]; then \
509               cp $$i $$tdir ; \
510             elif [ -f $(srcdir)/$$i ]; then \
511               cp $(srcdir)/$$i $$tdir ; \
512             else \
513               echo cannot find $$i ; \
514               exit 1 ; \
515             fi ; \
516           done ; \
517           if [ -f sudo_noexec.la ]; then \
518             cp libtool $$tdir ; \
519             $(LIBTOOL) --mode=install $(INSTALL) sudo_noexec.la `pwd`/$$tdir ; \
520           fi ; \
521           sed 's/@VERSION@/$(VERSION)/g' <$(srcdir)/sudo.psf >$$tdir/sudo.psf ; \
522           printf '#!/sbin/sh\nrm -f /usr/local/bin/sudoedit\nln /usr/local/bin/sudo /usr/local/bin/sudoedit\n' > $$tdir/sudo-exec.postinstall ; \
523           printf '#!/sbin/sh\nrm -f /usr/local/man/man1m/sudoedit.1m\nln /usr/local/man/man1m/sudo.1m /usr/local/man/man1m/sudoedit.1m\n' > $$tdir/sudo-man.postinstall ; \
524           printf '#!/sbin/sh\nif [ ! -s /etc/sudoers ]; then\n\techo installing /usr/local/doc/sudo/sudoers as /etc/sudoers\n\techo use /usr/local/sbin/visudo to configure sudo\n\tcp /usr/local/doc/sudo/sudoers /etc/sudoers\n\tchmod 440 /etc/sudoers\n\tchown root:root /etc/sudoers\nfi\n' > $$tdir/sudo-config.postinstall ; \
525           chmod 755 $$tdir/sudo-exec.postinstall $$tdir/sudo-man.postinstall $$tdir/sudo-config.postinstall ; \
526           strip $$tdir/sudo ; \
527           strip $$tdir/visudo ; \
528           cd $$tdir ; \
529           swpackage -x target_type=tape -d ../sudo-$(VERSION).depot -s sudo.psf ; \
530           cd .. ; \
531           gzip -f --best sudo-$(VERSION).depot; \
532           rm -rf tmp.depot ; \
533         )
534
535 .PHONY: ChangeLog