Annotation of src/usr.bin/sudo/Makefile.in, Revision 1.17
1.1 millert 1: #
1.14 millert 2: # Copyright (c) 1996, 1998-2003 Todd C. Miller <Todd.Miller@courtesan.com>
1.1 millert 3: # All rights reserved.
4: #
5: # Redistribution and use in source and binary forms, with or without
6: # modification, are permitted provided that the following conditions
7: # are met:
8: #
9: # 1. Redistributions of source code must retain the above copyright
10: # notice, this list of conditions and the following disclaimer.
11: #
12: # 2. Redistributions in binary form must reproduce the above copyright
13: # notice, this list of conditions and the following disclaimer in the
14: # documentation and/or other materials provided with the distribution.
15: #
16: # 3. The name of the author may not be used to endorse or promote products
17: # derived from this software without specific prior written permission
18: # from the author.
19: #
20: # 4. Products derived from this software may not be called "Sudo" nor
21: # may "Sudo" appear in their names without specific prior written
22: # permission from the author.
23: #
24: # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25: # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26: # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27: # THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28: # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29: # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
30: # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31: # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
32: # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33: # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34: #
35: # @configure_input@
36: #
1.16 millert 37: # $Sudo: Makefile.in,v 1.232 2003/04/02 18:45:35 millert Exp $
1.1 millert 38: #
39:
40: #### Start of system configuration section. ####
41:
42: srcdir = @srcdir@
43: authdir = $(srcdir)/auth
44: VPATH = @srcdir@
45:
46: # Compiler & tools to use
47: CC = @CC@
48: LEX = flex
49: YACC = @YACC@
50: NROFF = nroff
51:
1.8 millert 52: # Our install program supports extra flags...
1.2 millert 53: INSTALL = $(SHELL) $(srcdir)/install-sh -c
1.1 millert 54:
55: # Libraries
56: LIBS = @LIBS@
57: NET_LIBS = @NET_LIBS@
58: SUDO_LIBS = @SUDO_LIBS@ @AFS_LIBS@ $(LIBS) $(NET_LIBS)
59:
60: # C preprocessor flags
61: CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
62:
63: # Usually -O and/or -g
64: CFLAGS = @CFLAGS@
65:
66: # Flags to pass to the link stage
67: LDFLAGS = @LDFLAGS@
68: SUDO_LDFLAGS = @SUDO_LDFLAGS@ $(LDFLAGS)
69:
70: # Where to install things...
71: prefix = @prefix@
72: exec_prefix = @exec_prefix@
73: bindir = @bindir@
74: sbindir = @sbindir@
75: sysconfdir = @sysconfdir@
76: mandir = @mandir@
77:
78: # Directory in which to install sudo.
79: sudodir = $(bindir)
80:
81: # Directory in which to install visudo
82: visudodir = $(sbindir)
83:
84: # Directory in which to install the sudoers file
85: sudoersdir = $(sysconfdir)
86:
87: # Directory in which to install the man page
88: mantype = @MANTYPE@
1.6 millert 89: mansectsu = @mansectsu@
90: mansectform = @mansectform@
91: mandirsu = $(mandir)/$(mantype)$(mansectsu)
92: mandirform = $(mandir)/$(mantype)$(mansectform)
1.1 millert 93:
94: # User and group ids the installed files should be "owned" by
95: install_uid = 0
96: install_gid = 0
97:
98: # User, group, and mode the sudoers file should be "owned" by (configure)
99: sudoers_uid = @SUDOERS_UID@
100: sudoers_gid = @SUDOERS_GID@
101: sudoers_mode = @SUDOERS_MODE@
102:
103: # Pass in paths and uid/gid + OS dependent defined
104: 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)
105:
106: #### End of system configuration section. ####
107:
108: SHELL = /bin/sh
109:
110: PROGS = @PROGS@
111:
1.16 millert 112: SRCS = alloc.c alloca.c check.c def_data.c defaults.c env.c err.c fileops.c \
113: find_path.c fnmatch.c getcwd.c getprogname.c getspwuid.c goodpath.c \
1.8 millert 114: interfaces.c lex.yy.c lsearch.c logging.c parse.c parse.lex \
115: parse.yacc set_perms.c sigaction.c snprintf.c strcasecmp.c strerror.c \
1.14 millert 116: strlcat.c strlcpy.c sudo.c sudo.tab.c testsudoers.c tgetpass.c utime.c \
117: visudo.c $(AUTH_SRCS)
1.1 millert 118:
1.7 millert 119: AUTH_SRCS = auth/afs.c auth/aix_auth.c auth/bsdauth.c auth/dce.c auth/fwtk.c \
120: auth/kerb4.c auth/kerb5.c auth/pam.c auth/passwd.c auth/rfc1938.c \
1.14 millert 121: auth/secureware.c auth/securid.c auth/securid5.c auth/sia.c \
122: auth/sudo_auth.c
1.1 millert 123:
1.8 millert 124: HDRS = compat.h def_data.h defaults.h ins_2001.h ins_classic.h ins_csops.h \
125: ins_goons.h insults.h interfaces.h logging.h parse.h sudo.h sudo.tab.h \
1.16 millert 126: version.h auth/sudo_auth.h emul/err.h emul/fnmatch.h emul/search.h \
127: emul/utime.h
1.1 millert 128:
129: AUTH_OBJS = sudo_auth.o @AUTH_OBJS@
130:
131: PARSEOBJS = sudo.tab.o lex.yy.o alloc.o defaults.o
132:
1.8 millert 133: SUDOBJS = check.o env.o getspwuid.o goodpath.o fileops.o find_path.o \
134: interfaces.o logging.o parse.o set_perms.o sudo.o tgetpass.o \
1.1 millert 135: $(AUTH_OBJS) $(PARSEOBJS)
136:
1.8 millert 137: VISUDOBJS = visudo.o fileops.o goodpath.o find_path.o $(PARSEOBJS)
1.1 millert 138:
139: TESTOBJS = interfaces.o testsudoers.o $(PARSEOBJS)
140:
141: LIBOBJS = @LIBOBJS@ @ALLOCA@
142:
1.17 ! millert 143: VERSION = 1.6.7p3
1.1 millert 144:
1.8 millert 145: DISTFILES = $(SRCS) $(HDRS) BUGS CHANGES HISTORY INSTALL INSTALL.configure \
1.1 millert 146: LICENSE Makefile.in PORTING README RUNSON TODO TROUBLESHOOTING \
1.8 millert 147: UPGRADE aclocal.m4 aixcrypt.exp config.guess config.h.in \
148: config.sub configure configure.in def_data.in fnmatch.3 indent.pro \
149: install-sh mkdefaults mkinstalldirs pathnames.h.in sample.pam \
150: sample.syslog.conf sample.sudoers sudo.cat sudo.man.in sudo.pod \
151: sudoers sudoers.cat sudoers.man.in sudoers.pod visudo.cat \
152: visudo.man.in visudo.pod auth/API
1.2 millert 153:
1.5 millert 154: BINFILES= BUGS CHANGES HISTORY LICENSE README TODO TROUBLESHOOTING \
1.2 millert 155: UPGRADE install-sh mkinstalldirs sample.syslog.conf sample.sudoers \
156: sudo sudo.cat sudo.man sudo.pod sudoers sudoers.cat sudoers.man \
157: sudoers.pod visudo visudo.cat visudo.man visudo.pod
158:
159: BINSPECIAL= INSTALL.binary Makefile.binary
1.1 millert 160:
161: SUDODEP = $(srcdir)/sudo.h $(srcdir)/compat.h $(srcdir)/defaults.h \
1.8 millert 162: $(srcdir)/logging.h config.h def_data.h pathnames.h
1.1 millert 163:
164: AUTHDEP = $(SUDODEP) $(authdir)/sudo_auth.h
165:
166: INSDEP = $(srcdir)/ins_2001.h $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
167: $(srcdir)/ins_goons.h $(srcdir)/insults.h
168:
169: all: $(PROGS)
170:
171: .SUFFIXES: .o .c .h .lex .yacc .man .cat
172:
173: .c.o:
174: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
175:
176: .man.cat:
177: @rm -f $(srcdir)/$@
178: $(NROFF) -man $< > $(srcdir)/$@
179:
180: sudo: $(SUDOBJS) $(LIBOBJS)
181: $(CC) -o $@ $(SUDOBJS) $(LIBOBJS) $(SUDO_LDFLAGS) $(SUDO_LIBS)
182:
183: visudo: $(VISUDOBJS) $(LIBOBJS)
1.6 millert 184: $(CC) -o $@ $(VISUDOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
1.1 millert 185:
186: testsudoers: $(TESTOBJS) $(LIBOBJS)
187: $(CC) -o $@ $(TESTOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
188:
189: # Uncomment the following if you want "make clean" to clean the parser
190: @DEV@PARSESRCS = sudo.tab.h sudo.tab.c lex.yy.c
191:
192: # Uncomment the following if you intend to modify parse.yacc
193: @DEV@sudo.tab.c sudo.tab.h: parse.yacc
194: @DEV@ rm -f sudo.tab.h sudo.tab.c
195: @DEV@ $(YACC) -d -b sudo $(srcdir)/parse.yacc
196:
197: # Uncomment the following if you intend to modify parse.lex
198: @DEV@lex.yy.c: parse.lex
199: @DEV@ rm -f lex.yy.c
200: @DEV@ $(LEX) $(srcdir)/parse.lex
201:
1.8 millert 202: # Uncomment the following if you intend to modify def_data.in
203: @DEV@def_data.h def_data.c: def_data.in
204: @DEV@ perl $(srcdir)/mkdefaults -o def_data $(srcdir)/def_data.in
205:
1.1 millert 206: # Dependencies (not counting auth functions)
207: alloc.o: alloc.c $(SUDODEP)
208: check.o: check.c $(SUDODEP)
1.8 millert 209: env.o: env.c $(SUDODEP)
1.16 millert 210: err.o: err.c config.h compat.h emul/err.h
1.1 millert 211: fileops.o: fileops.c $(SUDODEP)
212: find_path.o: find_path.c $(SUDODEP)
1.16 millert 213: getprogname.o: getprogname.c config.h
1.1 millert 214: getspwuid.o: getspwuid.c $(SUDODEP)
215: goodpath.o: goodpath.c $(SUDODEP)
216: logging.o: logging.c $(SUDODEP)
1.8 millert 217: set_perms.o: set_perms.c $(SUDODEP)
1.1 millert 218: tgetpass.o: tgetpass.c $(SUDODEP)
219: visudo.o: visudo.c $(SUDODEP) version.h
220: sudo.o: sudo.c $(SUDODEP) interfaces.h version.h
221: interfaces.o: interfaces.c $(SUDODEP) interfaces.h
222: testsudoers.o: testsudoers.c $(SUDODEP) parse.h interfaces.h
223: parse.o: parse.c $(SUDODEP) parse.h interfaces.h
224: lex.yy.o: lex.yy.c $(SUDODEP) parse.h sudo.tab.h
1.8 millert 225: sudo.tab.o: sudo.tab.c $(SUDODEP) parse.h sudo.tab.c sudo.tab.h
226: defaults.o: defaults.c $(SUDODEP) def_data.c auth/sudo_auth.h
1.1 millert 227: fnmatch.o: fnmatch.c config.h compat.h emul/fnmatch.h
228: getcwd.o: getcwd.c config.h compat.h
229: lsearch.o: lsearch.c config.h compat.h emul/search.h
230: snprintf.o: snprintf.c config.h compat.h
231: strcasecmp.o: strcasecmp.c config.h
1.14 millert 232: strlcat.o: strlcat.c config.h
233: strlcpy.o: strlcpy.c config.h
1.1 millert 234: strerror.o: strerror.c config.h
235: utime.o: utime.c config.h pathnames.h compat.h emul/utime.h
236:
237: # Authentication functions live in "auth" dir and so need extra care
238: sudo_auth.o: $(authdir)/sudo_auth.c $(AUTHDEP) $(INSDEP)
239: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sudo_auth.c
240: afs.o: $(authdir)/afs.c $(AUTHDEP)
241: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/afs.c
242: aix_auth.o: $(authdir)/aix_auth.c $(AUTHDEP)
243: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/aix_auth.c
1.7 millert 244: bsdauth.o: $(authdir)/bsdauth.c $(AUTHDEP)
245: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/bsdauth.c
1.1 millert 246: dce.o: $(authdir)/dce.c $(AUTHDEP)
247: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/dce.c
248: fwtk.o: $(authdir)/fwtk.c $(AUTHDEP)
249: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/fwtk.c
250: kerb4.o: $(authdir)/kerb4.c $(AUTHDEP)
251: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb4.c
252: kerb5.o: $(authdir)/kerb5.c $(AUTHDEP)
253: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb5.c
254: pam.o: $(authdir)/pam.c $(AUTHDEP)
255: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/pam.c
256: passwd.o: $(authdir)/passwd.c $(AUTHDEP)
257: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/passwd.c
258: rfc1938.o: $(authdir)/rfc1938.c $(AUTHDEP)
259: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/rfc1938.c
260: secureware.o: $(authdir)/secureware.c $(AUTHDEP)
261: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/secureware.c
262: securid.o: $(authdir)/securid.c $(AUTHDEP)
263: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/securid.c
1.14 millert 264: securid5.o: $(authdir)/securid5.c $(AUTHDEP)
265: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/securid5.c
1.1 millert 266: sia.o: $(authdir)/sia.c $(AUTHDEP)
267: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c
268:
1.6 millert 269: sudo.man.in: $(srcdir)/sudo.pod
1.1 millert 270: @rm -f $(srcdir)/$@
1.14 millert 271: ( 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)/" >> $@ )
1.6 millert 272:
273: sudo.man: sudo.man.in
274: CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
1.1 millert 275:
276: sudo.cat: sudo.man
277:
1.6 millert 278: visudo.man.in: $(srcdir)/visudo.pod
1.1 millert 279: @rm -f $(srcdir)/$@
1.14 millert 280: ( 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)/" >> $@ )
1.6 millert 281:
282: visudo.man: visudo.man.in
283: CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
1.1 millert 284:
285: visudo.cat: visudo.man
286:
1.6 millert 287: sudoers.man.in: $(srcdir)/sudoers.pod
1.1 millert 288: @rm -f $(srcdir)/$@
1.14 millert 289: ( 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)/" >> $@ )
1.6 millert 290:
291: sudoers.man:: sudoers.man.in
292: CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
1.1 millert 293:
294: sudoers.cat: sudoers.man
295:
296: install: install-dirs install-binaries install-sudoers install-man
297:
298: install-dirs:
1.12 millert 299: $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(sudodir) \
300: $(DESTDIR)$(visudodir) $(DESTDIR)$(sudoersdir) \
301: $(DESTDIR)$(mandirsu) $(DESTDIR)$(mandirform)
1.1 millert 302:
303: install-binaries: $(PROGS)
1.12 millert 304: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 4111 -s sudo $(DESTDIR)$(sudodir)/sudo
305: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0111 -s visudo $(DESTDIR)$(visudodir)/visudo
1.1 millert 306:
307: install-sudoers:
1.12 millert 308: test -f $(DESTDIR)$(sudoersdir)/sudoers || \
1.8 millert 309: $(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
1.12 millert 310: $(srcdir)/sudoers $(DESTDIR)$(sudoersdir)/sudoers
1.1 millert 311:
312: install-man:
1.12 millert 313: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudo.$(mantype) $(DESTDIR)$(mandirsu)/sudo.$(mansectsu)
314: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/visudo.$(mantype) $(DESTDIR)$(mandirsu)/visudo.$(mansectsu)
315: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoers.$(mantype) $(DESTDIR)$(mandirform)/sudoers.$(mansectform)
1.1 millert 316: @MAN_POSTINSTALL@
1.4 millert 317:
318: check:
319: @echo nothing to check
1.1 millert 320:
321: tags: $(SRCS)
322: ctags $(SRCS)
323:
324: TAGS: $(SRCS)
325: etags $(SRCS)
326:
327: clean:
328: -rm -f *.o $(PROGS) testsudoers core sudo.core visudo.core \
329: testsudoers.core
330:
331: mostlyclean: clean
332:
333: distclean: clean
1.6 millert 334: -rm -f Makefile *.man pathnames.h config.h config.status config.cache \
1.3 millert 335: config.log $(PARSESRCS)
1.1 millert 336:
337: clobber: distclean
338:
339: realclean: distclean
340: rm -f TAGS tags
341:
342: cleandir: realclean
343:
1.6 millert 344: dist:
1.1 millert 345: rm -f ../sudo-$(VERSION).tar.gz
346: ( cd .. ; TF="/tmp/sudo.dist$$$$" ; rm -f $$TF ; for i in $(DISTFILES) ; \
347: do echo sudo-$(VERSION)/$$i >> $$TF ; done ; \
348: tar Ocf sudo-$(VERSION).tar \
349: `cat $$TF` && gzip --best sudo-$(VERSION).tar && rm -f $$TF)
350: ls -l ../sudo-$(VERSION).tar.gz
1.2 millert 351:
352: bindist:
353: @mkdir tmp.`arch -l`
354: @mkdir tmp.`arch -l`/sudo-$(VERSION)
1.10 millert 355: ( \
356: tdir=tmp.`arch -l`/sudo-$(VERSION) ; \
1.2 millert 357: for i in $(BINFILES) ; do \
1.10 millert 358: if [ -f $$i ]; then \
359: cp $$i $$tdir ; \
1.2 millert 360: elif [ -f $(srcdir)/$$i ]; then \
1.10 millert 361: cp $(srcdir)/$$i $$tdir ; \
1.2 millert 362: else \
1.10 millert 363: echo cannot find $$i ; \
364: exit 1 ; \
1.2 millert 365: fi ; \
366: done ; \
1.10 millert 367: cp $(srcdir)/INSTALL.binary $$tdir/INSTALL ; \
368: sed -e 's/@_MANTYPE@/$(mantype)/g' -e 's/@_mansectsu@/$(mansectsu)/g' \
369: -e 's/@_mansectform@/$(mansectform)/g' $(srcdir)/Makefile.binary \
370: > $$tdir/Makefile ; \
1.2 millert 371: )
1.10 millert 372: strip sudo
373: strip visudo
374: ( cd tmp.`arch -l` && tar Ocf ../sudo-$(VERSION)-`arch -l`.tar sudo-$(VERSION) )
1.2 millert 375: gzip --best sudo-$(VERSION)-`arch -l`.tar
376: rm -rf tmp.`arch -l`