Annotation of src/usr.bin/sudo/Makefile.in, Revision 1.8
1.1 millert 1: #
1.8 ! millert 2: # Copyright (c) 1996, 1998-2001 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.8 ! millert 37: # $Sudo: Makefile.in,v 1.218 2002/01/01 21:53:12 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.8 ! millert 112: SRCS = alloc.c alloca.c check.c def_data.c defaults.c env.c fileops.c \
! 113: find_path.c fnmatch.c getcwd.c getspwuid.c goodpath.c \
! 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 \
! 116: sudo.c sudo.tab.c testsudoers.c tgetpass.c utime.c visudo.c \
! 117: $(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.1 millert 121: auth/secureware.c auth/securid.c auth/sia.c auth/sudo_auth.c
122:
1.8 ! millert 123: HDRS = compat.h def_data.h defaults.h ins_2001.h ins_classic.h ins_csops.h \
! 124: ins_goons.h insults.h interfaces.h logging.h parse.h sudo.h sudo.tab.h \
! 125: version.h auth/sudo_auth.h emul/fnmatch.h emul/search.h emul/utime.h
1.1 millert 126:
127: AUTH_OBJS = sudo_auth.o @AUTH_OBJS@
128:
129: PARSEOBJS = sudo.tab.o lex.yy.o alloc.o defaults.o
130:
1.8 ! millert 131: SUDOBJS = check.o env.o getspwuid.o goodpath.o fileops.o find_path.o \
! 132: interfaces.o logging.o parse.o set_perms.o sudo.o tgetpass.o \
1.1 millert 133: $(AUTH_OBJS) $(PARSEOBJS)
134:
1.8 ! millert 135: VISUDOBJS = visudo.o fileops.o goodpath.o find_path.o $(PARSEOBJS)
1.1 millert 136:
137: TESTOBJS = interfaces.o testsudoers.o $(PARSEOBJS)
138:
139: LIBOBJS = @LIBOBJS@ @ALLOCA@
140:
1.8 ! millert 141: VERSION = 1.6.4
1.1 millert 142:
1.8 ! millert 143: DISTFILES = $(SRCS) $(HDRS) BUGS CHANGES HISTORY INSTALL INSTALL.configure \
1.1 millert 144: LICENSE Makefile.in PORTING README RUNSON TODO TROUBLESHOOTING \
1.8 ! millert 145: UPGRADE aclocal.m4 aixcrypt.exp config.guess config.h.in \
! 146: config.sub configure configure.in def_data.in fnmatch.3 indent.pro \
! 147: install-sh mkdefaults mkinstalldirs pathnames.h.in sample.pam \
! 148: sample.syslog.conf sample.sudoers sudo.cat sudo.man.in sudo.pod \
! 149: sudoers sudoers.cat sudoers.man.in sudoers.pod visudo.cat \
! 150: visudo.man.in visudo.pod auth/API
1.2 millert 151:
1.5 millert 152: BINFILES= BUGS CHANGES HISTORY LICENSE README TODO TROUBLESHOOTING \
1.2 millert 153: UPGRADE install-sh mkinstalldirs sample.syslog.conf sample.sudoers \
154: sudo sudo.cat sudo.man sudo.pod sudoers sudoers.cat sudoers.man \
155: sudoers.pod visudo visudo.cat visudo.man visudo.pod
156:
157: BINSPECIAL= INSTALL.binary Makefile.binary
1.1 millert 158:
159: SUDODEP = $(srcdir)/sudo.h $(srcdir)/compat.h $(srcdir)/defaults.h \
1.8 ! millert 160: $(srcdir)/logging.h config.h def_data.h pathnames.h
1.1 millert 161:
162: AUTHDEP = $(SUDODEP) $(authdir)/sudo_auth.h
163:
164: INSDEP = $(srcdir)/ins_2001.h $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
165: $(srcdir)/ins_goons.h $(srcdir)/insults.h
166:
167: all: $(PROGS)
168:
169: .SUFFIXES: .o .c .h .lex .yacc .man .cat
170:
171: .c.o:
172: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
173:
174: .man.cat:
175: @rm -f $(srcdir)/$@
176: $(NROFF) -man $< > $(srcdir)/$@
177:
178: sudo: $(SUDOBJS) $(LIBOBJS)
179: $(CC) -o $@ $(SUDOBJS) $(LIBOBJS) $(SUDO_LDFLAGS) $(SUDO_LIBS)
180:
181: visudo: $(VISUDOBJS) $(LIBOBJS)
1.6 millert 182: $(CC) -o $@ $(VISUDOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
1.1 millert 183:
184: testsudoers: $(TESTOBJS) $(LIBOBJS)
185: $(CC) -o $@ $(TESTOBJS) $(LIBOBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS)
186:
187: # Uncomment the following if you want "make clean" to clean the parser
188: @DEV@PARSESRCS = sudo.tab.h sudo.tab.c lex.yy.c
189:
190: # Uncomment the following if you intend to modify parse.yacc
191: @DEV@sudo.tab.c sudo.tab.h: parse.yacc
192: @DEV@ rm -f sudo.tab.h sudo.tab.c
193: @DEV@ $(YACC) -d -b sudo $(srcdir)/parse.yacc
194:
195: # Uncomment the following if you intend to modify parse.lex
196: @DEV@lex.yy.c: parse.lex
197: @DEV@ rm -f lex.yy.c
198: @DEV@ $(LEX) $(srcdir)/parse.lex
199:
1.8 ! millert 200: # Uncomment the following if you intend to modify def_data.in
! 201: @DEV@def_data.h def_data.c: def_data.in
! 202: @DEV@ perl $(srcdir)/mkdefaults -o def_data $(srcdir)/def_data.in
! 203:
1.1 millert 204: # Dependencies (not counting auth functions)
205: alloc.o: alloc.c $(SUDODEP)
206: check.o: check.c $(SUDODEP)
1.8 ! millert 207: env.o: env.c $(SUDODEP)
1.1 millert 208: fileops.o: fileops.c $(SUDODEP)
209: find_path.o: find_path.c $(SUDODEP)
210: getspwuid.o: getspwuid.c $(SUDODEP)
211: goodpath.o: goodpath.c $(SUDODEP)
212: logging.o: logging.c $(SUDODEP)
1.8 ! millert 213: set_perms.o: set_perms.c $(SUDODEP)
1.1 millert 214: tgetpass.o: tgetpass.c $(SUDODEP)
215: visudo.o: visudo.c $(SUDODEP) version.h
216: sudo.o: sudo.c $(SUDODEP) interfaces.h version.h
217: interfaces.o: interfaces.c $(SUDODEP) interfaces.h
218: testsudoers.o: testsudoers.c $(SUDODEP) parse.h interfaces.h
219: parse.o: parse.c $(SUDODEP) parse.h interfaces.h
220: lex.yy.o: lex.yy.c $(SUDODEP) parse.h sudo.tab.h
1.8 ! millert 221: sudo.tab.o: sudo.tab.c $(SUDODEP) parse.h sudo.tab.c sudo.tab.h
! 222: defaults.o: defaults.c $(SUDODEP) def_data.c auth/sudo_auth.h
1.1 millert 223: fnmatch.o: fnmatch.c config.h compat.h emul/fnmatch.h
224: getcwd.o: getcwd.c config.h compat.h
225: lsearch.o: lsearch.c config.h compat.h emul/search.h
226: snprintf.o: snprintf.c config.h compat.h
227: strcasecmp.o: strcasecmp.c config.h
228: strerror.o: strerror.c config.h
229: utime.o: utime.c config.h pathnames.h compat.h emul/utime.h
230:
231: # Authentication functions live in "auth" dir and so need extra care
232: sudo_auth.o: $(authdir)/sudo_auth.c $(AUTHDEP) $(INSDEP)
233: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sudo_auth.c
234: afs.o: $(authdir)/afs.c $(AUTHDEP)
235: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/afs.c
236: aix_auth.o: $(authdir)/aix_auth.c $(AUTHDEP)
237: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/aix_auth.c
1.7 millert 238: bsdauth.o: $(authdir)/bsdauth.c $(AUTHDEP)
239: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/bsdauth.c
1.1 millert 240: dce.o: $(authdir)/dce.c $(AUTHDEP)
241: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/dce.c
242: fwtk.o: $(authdir)/fwtk.c $(AUTHDEP)
243: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/fwtk.c
244: kerb4.o: $(authdir)/kerb4.c $(AUTHDEP)
245: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb4.c
246: kerb5.o: $(authdir)/kerb5.c $(AUTHDEP)
247: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/kerb5.c
248: pam.o: $(authdir)/pam.c $(AUTHDEP)
249: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/pam.c
250: passwd.o: $(authdir)/passwd.c $(AUTHDEP)
251: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/passwd.c
252: rfc1938.o: $(authdir)/rfc1938.c $(AUTHDEP)
253: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/rfc1938.c
254: secureware.o: $(authdir)/secureware.c $(AUTHDEP)
255: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/secureware.c
256: securid.o: $(authdir)/securid.c $(AUTHDEP)
257: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/securid.c
258: sia.o: $(authdir)/sia.c $(AUTHDEP)
259: $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c
260:
1.6 millert 261: sudo.man.in: $(srcdir)/sudo.pod
1.1 millert 262: @rm -f $(srcdir)/$@
1.8 ! millert 263: ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; 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 264:
265: sudo.man: sudo.man.in
266: CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
1.1 millert 267:
268: sudo.cat: sudo.man
269:
1.6 millert 270: visudo.man.in: $(srcdir)/visudo.pod
1.1 millert 271: @rm -f $(srcdir)/$@
1.8 ! millert 272: ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; 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 273:
274: visudo.man: visudo.man.in
275: CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
1.1 millert 276:
277: visudo.cat: visudo.man
278:
1.6 millert 279: sudoers.man.in: $(srcdir)/sudoers.pod
1.1 millert 280: @rm -f $(srcdir)/$@
1.8 ! millert 281: ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; 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 282:
283: sudoers.man:: sudoers.man.in
284: CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status
1.1 millert 285:
286: sudoers.cat: sudoers.man
287:
288: install: install-dirs install-binaries install-sudoers install-man
289:
290: install-dirs:
1.8 ! millert 291: $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)/$(sudodir) \
! 292: $(DESTDIR)/$(visudodir) $(DESTDIR)/$(sudoersdir) \
! 293: $(DESTDIR)/$(mandirsu) $(DESTDIR)/$(mandirform)
1.1 millert 294:
295: install-binaries: $(PROGS)
1.8 ! millert 296: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 4111 -s sudo $(DESTDIR)/$(sudodir)/sudo
! 297: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0111 -s visudo $(DESTDIR)/$(visudodir)/visudo
1.1 millert 298:
299: install-sudoers:
1.8 ! millert 300: test -f $(DESTDIR)/$(sudoersdir)/sudoers || \
! 301: $(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
! 302: $(srcdir)/sudoers $(DESTDIR)/$(sudoersdir)/sudoers
1.1 millert 303:
304: install-man:
1.8 ! millert 305: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudo.$(mantype) $(DESTDIR)/$(mandirsu)/sudo.$(mansectsu)
! 306: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/visudo.$(mantype) $(DESTDIR)/$(mandirsu)/visudo.$(mansectsu)
! 307: $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0444 @mansrcdir@/sudoers.$(mantype) $(DESTDIR)/$(mandirform)/sudoers.$(mansectform)
1.1 millert 308: @MAN_POSTINSTALL@
1.4 millert 309:
310: check:
311: @echo nothing to check
1.1 millert 312:
313: tags: $(SRCS)
314: ctags $(SRCS)
315:
316: TAGS: $(SRCS)
317: etags $(SRCS)
318:
319: clean:
320: -rm -f *.o $(PROGS) testsudoers core sudo.core visudo.core \
321: testsudoers.core
322:
323: mostlyclean: clean
324:
325: distclean: clean
1.6 millert 326: -rm -f Makefile *.man pathnames.h config.h config.status config.cache \
1.3 millert 327: config.log $(PARSESRCS)
1.1 millert 328:
329: clobber: distclean
330:
331: realclean: distclean
332: rm -f TAGS tags
333:
334: cleandir: realclean
335:
1.6 millert 336: dist:
1.1 millert 337: rm -f ../sudo-$(VERSION).tar.gz
338: ( cd .. ; TF="/tmp/sudo.dist$$$$" ; rm -f $$TF ; for i in $(DISTFILES) ; \
339: do echo sudo-$(VERSION)/$$i >> $$TF ; done ; \
340: tar Ocf sudo-$(VERSION).tar \
341: `cat $$TF` && gzip --best sudo-$(VERSION).tar && rm -f $$TF)
342: ls -l ../sudo-$(VERSION).tar.gz
1.2 millert 343:
344: bindist:
345: @mkdir tmp.`arch -l`
346: @mkdir tmp.`arch -l`/sudo-$(VERSION)
347: ( cd tmp.`arch -l`/sudo-$(VERSION) ; \
348: for i in $(BINFILES) ; do \
349: if [ -f ../../$$i ]; then \
350: cp ../../$$i . ; \
351: elif [ -f $(srcdir)/$$i ]; then \
352: cp $(srcdir)/$$i . ; \
353: else \
354: cp ../../$(srcdir)/$$i . ; \
355: fi ; \
356: done ; \
1.8 ! millert 357: strip sudo ; \
! 358: strip visudo ; \
1.2 millert 359: cd .. ; tar Ocf ../sudo-$(VERSION)-`arch -l`.tar sudo-$(VERSION) ; \
360: )
361: gzip --best sudo-$(VERSION)-`arch -l`.tar
362: rm -rf tmp.`arch -l`