2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00
sudo/plugins/sudoers/Makefile.in
Todd C. Miller e6b48d415c Replace built-in non-unix group support with a sudoers group plugin.
Include a sample plugin that can read Unix-format group files.
2010-07-02 11:11:25 -04:00

289 lines
10 KiB
Makefile

#
# Copyright (c) 1996, 1998-2005, 2007-2010
# Todd C. Miller <Todd.Miller@courtesan.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Sponsored in part by the Defense Advanced Research Projects
# Agency (DARPA) and Air Force Research Laboratory, Air Force
# Materiel Command, USAF, under agreement number F39502-99-1-0512.
#
# @configure_input@
#
#### Start of system configuration section. ####
srcdir = @srcdir@
devdir = @devdir@
authdir = $(srcdir)/auth
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
incdir = $(top_srcdir)/include
# For out of tree builds
VPATH = $(devdir):$(srcdir):$(srcdir)/auth
# Compiler & tools to use
CC = @CC@
LIBTOOL = @LIBTOOL@
FLEX = @FLEX@
YACC = @YACC@
# Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
# Libraries
LIBS = $(top_builddir)/common/libcommon.la $(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@
# C preprocessor flags
CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(srcdir) -I$(top_srcdir) @CPPFLAGS@
# Usually -O and/or -g
CFLAGS = @CFLAGS@
# Flags to pass to the link stage
LDFLAGS =
SUDOERS_LDFLAGS = @SUDOERS_LDFLAGS@
# Where to install things...
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
# Directory in which to install the sudoers plugin
plugindir = @PLUGINDIR@
# Directory in which to install the sudoers file
sudoersdir = $(sysconfdir)
# Directory in which to install sudoreplay.
replaydir = $(bindir)
# Directory in which to install visudo
visudodir = $(sbindir)
# User and group ids the installed files should be "owned" by
install_uid = 0
install_gid = 0
# User, group, and mode the sudoers file should be "owned" by (configure)
sudoers_uid = @SUDOERS_UID@
sudoers_gid = @SUDOERS_GID@
sudoers_mode = @SUDOERS_MODE@
# Pass in paths and uid/gid + OS dependent defines
DEFS = @OSDEFS@ -D_PATH_SUDOERS=\"$(sudoersdir)/sudoers\" -DSUDOERS_UID=$(sudoers_uid) -DSUDOERS_GID=$(sudoers_gid) -DSUDOERS_MODE=$(sudoers_mode)
#### End of system configuration section. ####
SHELL = @SHELL@
PROGS = sudoers.la visudo sudoreplay testsudoers
AUTH_OBJS = sudo_auth.lo @AUTH_OBJS@
LIBSUDOERS_OBJS = alias.lo audit.lo defaults.lo gram.lo match.lo pwutil.lo \
timestr.lo toke.lo redblack.lo @NONUNIX_GROUPS_IMPL@
SUDOERS_OBJS = $(AUTH_OBJS) boottime.lo check.lo \
plugin_error.lo env.lo getspwuid.lo \
goodpath.lo group_plugin.lo find_path.lo interfaces.lo \
logging.lo parse.lo set_perms.lo sudoers.lo sudo_nss.lo \
iolog.lo @SUDOERS_OBJS@
VISUDO_OBJS = visudo.o goodpath.o find_path.o error.o
REPLAY_OBJS = getdate.o sudoreplay.o error.o
TEST_OBJS = interfaces.o testsudoers.o tsgetgrpw.o error.o group_plugin.o
VERSION = @PACKAGE_VERSION@
SUDODEP = $(srcdir)/sudoers.h $(incdir)/compat.h \
$(srcdir)/defaults.h $(incdir)/error.h $(incdir)/list.h \
$(srcdir)/logging.h $(incdir)/missing.h $(srcdir)/sudo_nss.h \
$(devdir)/def_data.h $(top_builddir)/pathnames.h $(top_builddir)/config.h
AUTHDEP = $(SUDODEP) $(authdir)/sudo_auth.h
INSDEP = $(srcdir)/ins_2001.h $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
$(srcdir)/ins_goons.h $(srcdir)/insults.h
all: $(PROGS)
.SUFFIXES: .o .c .h .l .y .lo
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
.c.lo:
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
# Prevent default rules from building .c files from .l and .y files
.l.c:
.y.c:
libsudoers.la: $(LIBSUDOERS_OBJS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(LIBSUDOERS_OBJS) -no-install
sudoers.la: $(SUDOERS_OBJS) libsudoers.la
$(LIBTOOL) --tag=disable-static --mode=link $(CC) $(SUDOERS_LDFLAGS) -o $@ $(SUDOERS_OBJS) libsudoers.la $(SUDOERS_LIBS) -module -avoid-version -rpath $(plugindir)
visudo: libsudoers.la $(VISUDO_OBJS) $(LIBS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(VISUDO_OBJS) $(LDFLAGS) libsudoers.la $(LIBS) $(NET_LIBS)
sudoreplay: libsudoers.la $(REPLAY_OBJS) $(LIBS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(REPLAY_OBJS) $(LDFLAGS) timestr.lo $(REPLAY_LIBS) $(LIBS)
testsudoers: $(TEST_OBJS) $(LIBS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(TEST_OBJS) $(LDFLAGS) libsudoers.la $(LIBS) $(NET_LIBS)
# Uncomment the following if you want "make distclean" to clean the parser
@DEV@GENERATED = gram.h gram.c toke.c def_data.c def_data.h getdate.c
# Uncomment the lines before -@true if you intend to modify gram.y
$(devdir)/gram.c $(devdir)/gram.h: $(srcdir)/gram.y
@DEV@ $(YACC) -d $(srcdir)/gram.y
@DEV@ mv -f y.tab.c $(devdir)/gram.c
@DEV@ mv -f y.tab.h $(devdir)/gram.h
-@true
# Uncomment the lines before -@true if you intend to modify toke.l
$(devdir)/toke.c: $(srcdir)/toke.l
@DEV@ $(FLEX) $(srcdir)/toke.l
@DEV@ mv -f lex.yy.c $(devdir)/toke.c
-@true
# Uncomment the lines before -@true if you intend to modify getdate.y
$(devdir)/getdate.c: $(srcdir)/getdate.y
@DEV@ echo "expect 10 shift/reduce conflicts"
@DEV@ $(YACC) $(srcdir)/getdate.y
@DEV@ mv -f y.tab.c $(devdir)/getdate.c
-@true
# Uncomment the following if you intend to modify def_data.in
@DEV@$(devdir)/def_data.c $(devdir)/def_data.h: $(srcdir)/def_data.in
@DEV@ perl $(srcdir)/mkdefaults -o $(devdir)/def_data $(srcdir)/def_data.in
# Sudoers dependencies
alias.lo: $(srcdir)/alias.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(srcdir)/redblack.h
audit.lo: $(srcdir)/audit.c $(SUDODEP)
bsm_audit.lo: $(srcdir)/bsm_audit.c $(SUDODEP) $(srcdir)/bsm_audit.h
boottime.lo: $(srcdir)/boottime.c $(top_builddir)/config.h
check.lo: $(srcdir)/check.c $(SUDODEP)
defaults.lo: $(srcdir)/defaults.c $(SUDODEP) $(devdir)/def_data.c $(authdir)/sudo_auth.h $(devdir)/gram.h
env.lo: $(srcdir)/env.c $(SUDODEP)
find_path.lo: $(srcdir)/find_path.c $(SUDODEP)
getspwuid.lo: $(srcdir)/getspwuid.c $(SUDODEP)
goodpath.lo: $(srcdir)/goodpath.c $(SUDODEP)
gram.lo: $(devdir)/gram.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(devdir)/gram.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(devdir)/gram.c
group_plugin.lo: $(srcdir)/group_plugin.c $(SUDODEP)
interfaces.lo: $(srcdir)/interfaces.c $(SUDODEP) $(srcdir)/interfaces.h
iolog.lo: $(srcdir)/iolog.c $(SUDODEP)
ldap.lo: $(srcdir)/ldap.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h
linux_audit.lo: $(srcdir)/linux_audit.c $(SUDODEP) $(srcdir)/linux_audit.h
logging.lo: $(srcdir)/logging.c $(SUDODEP)
match.lo: $(srcdir)/match.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(srcdir)/interfaces.h $(devdir)/gram.h
parse.lo: $(srcdir)/parse.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(devdir)/gram.h
pwutil.lo: $(srcdir)/pwutil.c $(SUDODEP)
redblack.lo: $(srcdir)/redblack.c $(SUDODEP) $(srcdir)/redblack.h
set_perms.lo: $(srcdir)/set_perms.c $(SUDODEP)
sudo_nss.lo: $(srcdir)/sudo_nss.c $(SUDODEP)
sudoers.lo: $(srcdir)/sudoers.c $(SUDODEP) $(srcdir)/interfaces.h
timestr.lo: $(srcdir)/timestr.c $(incdir)/compat.h $(top_builddir)/config.h
toke.lo: $(devdir)/toke.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(devdir)/gram.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(devdir)/toke.c
tsgetgrpw.lo: $(srcdir)/tsgetgrpw.c $(SUDODEP)
plugin_error.lo: $(srcdir)/plugin_error.c $(incdir)/error.h $(incdir)/compat.h $(top_builddir)/config.h
# Auth dependencies
sudo_auth.lo: $(authdir)/sudo_auth.c $(AUTHDEP) $(INSDEP)
afs.lo: $(authdir)/afs.c $(AUTHDEP)
aix_auth.lo: $(authdir)/aix_auth.c $(AUTHDEP)
bsdauth.lo: $(authdir)/bsdauth.c $(AUTHDEP)
dce.lo: $(authdir)/dce.c $(AUTHDEP)
fwtk.lo: $(authdir)/fwtk.c $(AUTHDEP)
kerb4.lo: $(authdir)/kerb4.c $(AUTHDEP)
kerb5.lo: $(authdir)/kerb5.c $(AUTHDEP)
pam.lo: $(authdir)/pam.c $(AUTHDEP)
passwd.lo: $(authdir)/passwd.c $(AUTHDEP)
rfc1938.lo: $(authdir)/rfc1938.c $(AUTHDEP)
secureware.lo: $(authdir)/secureware.c $(AUTHDEP)
securid.lo: $(authdir)/securid.c $(AUTHDEP)
securid5.lo: $(authdir)/securid5.c $(AUTHDEP)
sia.lo: $(authdir)/sia.c $(AUTHDEP)
# Command dependencies (sudoreplay, testsudoers, visudo)
error.o: $(top_srcdir)/src/error.c $(incdir)/error.h $(incdir)/compat.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(top_srcdir)/src/error.c
find_path.o: find_path.lo
getdate.o: $(devdir)/getdate.c $(incdir)/compat.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(devdir)/getdate.c
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
testsudoers.o: $(srcdir)/testsudoers.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(srcdir)/interfaces.h $(devdir)/gram.h
tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(SUDODEP)
visudo.o: $(srcdir)/visudo.c $(SUDODEP) $(devdir)/gram.h
install: install-dirs install-plugin install-binaries install-sudoers
install-dirs:
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(plugindir) \
$(DESTDIR)$(visudodir) $(DESTDIR)$(replaydir) \
$(DESTDIR)$(sudoersdir)
install-binaries: visudo sudoreplay install-dirs
$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0111 -s sudoreplay $(DESTDIR)$(replaydir)/sudoreplay
$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0111 -s visudo $(DESTDIR)$(visudodir)/visudo
install-includes:
install-man:
install-plugin: sudoers.la install-dirs
$(LIBTOOL) --mode=install --quiet $(INSTALL) sudoers.la $(DESTDIR)$(plugindir)
install-sudoers: install-dirs
test -f $(DESTDIR)$(sudoersdir)/sudoers || \
$(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
$(srcdir)/sudoers $(DESTDIR)$(sudoersdir)/sudoers
check:
@echo nothing to check
clean:
-$(LIBTOOL) --mode=clean rm -f $(PROGS) *.lo *.o *.la *.a stamp-* core *.core core.*
mostlyclean: clean
distclean: clean
-rm -rf Makefile sudoers.lo .libs $(LINKS)
clobber: distclean
realclean: distclean
rm -f TAGS tags
cleandir: realclean