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