RANLIB=@RANLIB@
# C preprocessor flags
-CPPFLAGS = -I. -I$(top_srcdir) -I$(incdir) @CPPFLAGS@
+CPPFLAGS = -I. -I$(top_builddir) -I$(incdir) @CPPFLAGS@
# Usually -O and/or -g
CFLAGS = @CFLAGS@
SHELL = /bin/sh
-LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/
+LIBOBJDIR =
LTLIBOBJS = @LTLIBOBJS@
@DEV@$(srcdir)/mksiglist.h: $(srcdir)/siglist.in
@DEV@ awk 'BEGIN {print "/* public domain */\n"} /^ [A-Z]/ {printf("#ifdef SIG%s\n if (my_sys_siglist[SIG%s] == NULL)\n\tmy_sys_siglist[SIG%s] = \"%s\";\n#endif\n", $1, $1, $1, substr($0, 13))}' < $(srcdir)/siglist.in > $@
-$(LIBOBJDIR)siglist.lo: siglist.c $(incdir)/compat.h $(top_builddir)/config.h
+siglist.lo: siglist.c $(incdir)/compat.h $(top_builddir)/config.h
# Dependencies
-$(LIBOBJDIR)closefrom.lo: $(compat)/closefrom.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)fnmatch.lo: $(compat)/fnmatch.c $(compat)/fnmatch.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)getcwd.lo: $(compat)/getcwd.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)getline.lo: $(compat)/getline.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)getprogname.lo: $(compat)/getprogname.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)glob.lo: $(compat)/glob.c $(compat)/glob.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)isblank.lo: $(compat)/isblank.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)memrchr.lo: $(compat)/memrchr.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)mkstemp.lo: $(compat)/mkstemp.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)nanosleep.lo: $(compat)/nanosleep.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)sigaction.lo: $(compat)/sigaction.c $(incdir)/compat.h $(incdir)/compat.h
-$(LIBOBJDIR)snprintf.lo: $(compat)/snprintf.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)strcasecmp.lo: $(compat)/strcasecmp.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)strdup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)strndup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)strerror.lo: $(compat)/strerror.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)strlcat.lo: $(compat)/strlcat.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)strlcpy.lo: $(compat)/strlcpy.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)strsignal.lo: $(compat)/strsignal.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)utimes.lo: $(compat)/utimes.c $(incdir)/compat.h $(compat)/utime.h $(top_builddir)/config.h
+closefrom.lo: $(compat)/closefrom.c $(incdir)/compat.h $(top_builddir)/config.h
+fnmatch.lo: $(compat)/fnmatch.c $(compat)/fnmatch.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
+getcwd.lo: $(compat)/getcwd.c $(incdir)/compat.h $(top_builddir)/config.h
+getline.lo: $(compat)/getline.c $(incdir)/compat.h $(top_builddir)/config.h
+getprogname.lo: $(compat)/getprogname.c $(incdir)/compat.h $(top_builddir)/config.h
+glob.lo: $(compat)/glob.c $(compat)/glob.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
+isblank.lo: $(compat)/isblank.c $(incdir)/compat.h $(top_builddir)/config.h
+memrchr.lo: $(compat)/memrchr.c $(incdir)/compat.h $(top_builddir)/config.h
+mkstemp.lo: $(compat)/mkstemp.c $(incdir)/compat.h $(top_builddir)/config.h
+nanosleep.lo: $(compat)/nanosleep.c $(incdir)/compat.h $(top_builddir)/config.h
+sigaction.lo: $(compat)/sigaction.c $(incdir)/compat.h $(incdir)/compat.h
+snprintf.lo: $(compat)/snprintf.c $(incdir)/compat.h $(top_builddir)/config.h
+strcasecmp.lo: $(compat)/strcasecmp.c $(incdir)/compat.h $(top_builddir)/config.h
+strdup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
+strndup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
+strerror.lo: $(compat)/strerror.c $(incdir)/compat.h $(top_builddir)/config.h
+strlcat.lo: $(compat)/strlcat.c $(incdir)/compat.h $(top_builddir)/config.h
+strlcpy.lo: $(compat)/strlcpy.c $(incdir)/compat.h $(top_builddir)/config.h
+strsignal.lo: $(compat)/strsignal.c $(incdir)/compat.h $(top_builddir)/config.h
+utimes.lo: $(compat)/utimes.c $(incdir)/compat.h $(compat)/utime.h $(top_builddir)/config.h
install:
VERSION = @PACKAGE_VERSION@
-# XXX - add DEV dependencies to build .man.in and .cat files
+# XXX - add DEV dependencies to avoid always building .man.in and .cat files
all: $(DOCS)
.SUFFIXES: .man .cat
@rm -f $@
sed '1s/^/.if n .ll 78n/' $< | $(NROFF) -man > $@
-sudo.man.in: $(srcdir)/sudo.pod
+$(srcdir)/sudo.man.in: $(srcdir)/sudo.pod
@rm -f $(srcdir)/$@
( 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 >> $@ )
-sudo.man: sudo.man.in
- CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status
+sudo.man: $(srcdir)/sudo.man.in
+ (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status)
-sudo.cat: sudo.man
+$(srcdir)/sudo.cat: sudo.man
-visudo.man.in: $(srcdir)/visudo.pod
+$(srcdir)/visudo.man.in: $(srcdir)/visudo.pod
@rm -f $(srcdir)/$@
( 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' >> $@ )
-visudo.man: visudo.man.in
- CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status
+visudo.man: $(srcdir)/visudo.man.in
+ (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status)
-visudo.cat: visudo.man
+$(srcdir)/visudo.cat: visudo.man
-sudoers.man.in: $(srcdir)/sudoers.pod
+$(srcdir)/sudoers.man.in: $(srcdir)/sudoers.pod
@rm -f $(srcdir)/$@
( 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 >> $@ )
-sudoers.man:: sudoers.man.in
- CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status
+sudoers.man:: $(srcdir)/sudoers.man.in
+ (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status)
-sudoers.cat: sudoers.man
+$(srcdir)/sudoers.cat: sudoers.man
-sudoers.ldap.man.in: $(srcdir)/sudoers.ldap.pod
+$(srcdir)/sudoers.ldap.man.in: $(srcdir)/sudoers.ldap.pod
@rm -f $(srcdir)/$@
( 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' >> $@ )
-sudoers.ldap.man:: sudoers.ldap.man.in
- CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status
+sudoers.ldap.man:: $(srcdir)/sudoers.ldap.man.in
+ (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status)
-sudoers.ldap.cat: sudoers.ldap.man
+$(srcdir)/sudoers.ldap.cat: sudoers.ldap.man
-sudoreplay.man.in: $(srcdir)/sudoreplay.pod
+$(srcdir)/sudoreplay.man.in: $(srcdir)/sudoreplay.pod
@rm -f $(srcdir)/$@
( 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' sudoreplay.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoreplay.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ )
-sudoreplay.man:: sudoreplay.man.in
- CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status
+sudoreplay.man:: $(srcdir)/sudoreplay.man.in
+ (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status)
-sudoreplay.cat: sudoreplay.man
+$(srcdir)/sudoreplay.cat: sudoreplay.man
-sudo_plugin.man.in: $(srcdir)/sudo_plugin.pod
+$(srcdir)/sudo_plugin.man.in: $(srcdir)/sudo_plugin.pod
@rm -f $(srcdir)/$@
( 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_plugin.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo_plugin.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ )
-sudo_plugin.man:: sudo_plugin.man.in
- CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status
+sudo_plugin.man:: $(srcdir)/sudo_plugin.man.in
+ (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status)
-sudo_plugin.cat: sudo_plugin.man
+$(srcdir)/sudo_plugin.cat: sudo_plugin.man
@DEV@HISTORY: history.pod
@DEV@ pod2text -l -i0 $> > $@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
incdir = $(top_srcdir)/include
-compat = $(top_srcdir)/compat
# Compiler & tools to use
CC = @CC@
OBJS = sample_plugin.lo
-LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/
+LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/
VERSION = @PACKAGE_VERSION@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
incdir = $(top_srcdir)/include
-compat = $(top_srcdir)/compat
# Compiler & tools to use
CC = @CC@
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
# Libraries
-LIBS = $(top_srcdir)/@ac_config_libobj_dir@/libreplace.la
+LIBS = $(top_builddir)/@ac_config_libobj_dir@/libreplace.la
NET_LIBS = @NET_LIBS@
SUDOERS_LIBS = @SUDOERS_LIBS@ @AFS_LIBS@ @GETGROUPS_LIB@ $(LIBS) $(NET_LIBS) @ZLIB@
REPLAY_LIBS = @REPLAY_LIBS@ @ZLIB@
logging.lo parse.lo set_perms.lo sudoers.lo sudo_nss.lo \
iolog.lo @SUDOERS_OBJS@
-# XXX - need top level error.o; perhaps make #ifdef PIC?
VISUDO_OBJS = visudo.o fileops.o gettime.o goodpath.o find_path.o error.o
REPLAY_OBJS = getdate.o sudoreplay.o term.o error.o
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/env.c
find_path.lo: $(srcdir)/find_path.c $(SUDODEP)
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/find_path.c
-getdate.lo: $(srcdir)/getdate.c $(incdir)/compat.h $(top_builddir)/config.h
- $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getdate.c
getspwuid.lo: $(srcdir)/getspwuid.c $(SUDODEP)
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getspwuid.c
gettime.lo: $(srcdir)/gettime.c $(SUDODEP)
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/lbuf.c
zero_bytes.lo: $(top_srcdir)/src/zero_bytes.c $(incdir)/compat.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/zero_bytes.c
-# XXX - for sudoreplay
-term.o: $(top_srcdir)/src/term.c $(incdir)/compat.h $(top_builddir)/config.h
- $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/term.c
# Auth dependencies
sudo_auth.lo: $(authdir)/sudo_auth.c $(AUTHDEP) $(INSDEP)
sia.lo: $(authdir)/sia.c $(AUTHDEP)
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c
+# Command dependencies (sudoreplay, testsudoers, visudo)
error.o: $(top_srcdir)/src/error.c $(incdir)/error.h $(incdir)/compat.h $(top_builddir)/config.h
- $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/error.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/error.c
+fileops.o: fileops.lo
+find_path.o: find_path.lo
+getdate.o: $(srcdir)/getdate.c $(incdir)/compat.h $(top_builddir)/config.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getdate.c
+gettime.o: gettime.lo
+goodpath.o: goodpath.lo
+interfaces.o: interfaces.lo
+sudoreplay.o: $(srcdir)/sudoreplay.c $(incdir)/alloc.h $(incdir)/compat.h $(incdir)/error.h $(incdir)/missing.h $(top_builddir)/config.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudoreplay.c
+term.o: $(top_srcdir)/src/term.c $(incdir)/compat.h $(top_builddir)/config.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/term.c
+testsudoers.o: $(srcdir)/testsudoers.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(srcdir)/interfaces.h $(devdir)/gram.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/testsudoers.c
+tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(SUDODEP)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/tsgetgrpw.c
+visudo.o: $(srcdir)/visudo.c $(SUDODEP) $(devdir)/gram.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/visudo.c
install: install-dirs install-plugin install-binaries install-sudoers
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
incdir = $(top_srcdir)/include
-compat = $(top_srcdir)/compat
# Compiler & tools to use
CC = @CC@
load_plugins.o conversation.o list.o fmt_string.o tgetpass.o \
fileops.o term.o ttysize.o atobool.o script.o pty.o @SUDO_OBJS@
-LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/
+LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/
VERSION = @PACKAGE_VERSION@