#
# Copyright (c) 2010-2017 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.
#
# @configure_input@
#

#### Start of system configuration section. ####

srcdir = @srcdir@
devdir = @devdir@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
incdir = $(top_srcdir)/include
rundir = @rundir@
cross_compiling = @CROSS_COMPILING@

# Compiler & tools to use
CC = @CC@
LIBTOOL = @LIBTOOL@
SED = @SED@

# Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@

# Libraries
LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la
LIBS = @LIBS@ @SUDO_LIBS@ @GETGROUPS_LIB@ @NET_LIBS@ $(LT_LIBS)

# C preprocessor defines
CPPDEFS = -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\" \
	  -DLOCALEDIR=\"$(localedir)\"

# C preprocessor flags
CPPFLAGS = -I$(incdir) -I$(top_builddir) -I. -I$(srcdir) -I$(top_srcdir) \
	   $(CPPDEFS) @CPPFLAGS@

# Usually -O and/or -g
CFLAGS = @CFLAGS@

# Flags to pass to the link stage
LDFLAGS = @LDFLAGS@
SUDO_LDFLAGS = $(LDFLAGS) @SUDO_LDFLAGS@
LT_LDFLAGS = @LT_LDFLAGS@

# Flags to pass to libtool
LTFLAGS = --tag=disable-static

# Address sanitizer flags
ASAN_CFLAGS = @ASAN_CFLAGS@
ASAN_LDFLAGS = @ASAN_LDFLAGS@

# PIE flags
PIE_CFLAGS = @PIE_CFLAGS@
PIE_LDFLAGS = @PIE_LDFLAGS@

# Stack smashing protection flags
SSP_CFLAGS = @SSP_CFLAGS@
SSP_LDFLAGS = @SSP_LDFLAGS@

# cppcheck options, usually set in the top-level Makefile
CPPCHECK_OPTS = -q --force --enable=warning,performance,portability --suppress=constStatement --error-exitcode=1 --inline-suppr -Dva_copy=va_copy -U__cplusplus -UQUAD_MAX -UQUAD_MIN -UUQUAD_MAX -U_POSIX_HOST_NAME_MAX -U_POSIX_PATH_MAX -U__NBBY -DNSIG=64

# splint options, usually set in the top-level Makefile
SPLINT_OPTS = -D__restrict= -checks

# Where to install things...
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
localedir = @localedir@
localstatedir = @localstatedir@
noexecfile = @NOEXECFILE@
noexecdir = @NOEXECDIR@
tmpfiles_d = @TMPFILES_D@

# User and group ids the installed files should be "owned" by
install_uid = 0
install_gid = 0

# File mode to use for shared libraries
shlib_mode = @SHLIB_MODE@

# Optional init script and rc.d link
INIT_DIR=@INIT_DIR@
INIT_SCRIPT=@INIT_SCRIPT@
RC_LINK=@RC_LINK@

TEST_PROGS = check_ttyname @CHECK_NOEXEC@
TEST_LIBS = @LIBS@ $(LT_LIBS)
TEST_LDFLAGS = @LDFLAGS@

#### End of system configuration section. ####

SHELL = @SHELL@

PROGS = @PROGS@

OBJS = conversation.o env_hooks.o exec.o exec_common.o exec_monitor.o \
       exec_nopty.o exec_pty.o get_pty.o hooks.o net_ifs.o load_plugins.o \
       parse_args.o preserve_fds.o signal.o sudo.o sudo_edit.o \
       tcsetpgrp_nobg.o tgetpass.o ttyname.o utmp.o @SUDO_OBJS@

SESH_OBJS = sesh.o exec_common.o

CHECK_NOEXEC_OBJS = check_noexec.o exec_common.o

CHECK_TTYNAME_OBJS = check_ttyname.o ttyname.o

LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/

VERSION = @PACKAGE_VERSION@

all: $(PROGS)

Makefile: $(srcdir)/Makefile.in
	cd $(top_builddir) && ./config.status --file src/Makefile

./sudo_usage.h: $(srcdir)/sudo_usage.h.in
	cd $(top_builddir) && ./config.status --file src/sudo_usage.h

.SUFFIXES: .c .h .lo .o

.c.o:
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $<

.c.lo:
	$(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $<

sudo: $(OBJS) $(LT_LIBS) @STATIC_SUDOERS@
	$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(OBJS) $(SUDO_LDFLAGS) $(ASAN_LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(LIBS) @STATIC_SUDOERS@

# We can't use -module here since you cannot preload a module on Darwin
libsudo_noexec.la: sudo_noexec.lo
	$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) $(SSP_LDFLAGS) @LIBDL@ -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir) -shrext .so

# Some hackery is required to install this as sudo_noexec, not libsudo_noexec
sudo_noexec.la: libsudo_noexec.la
	sed 's/libsudo_noexec/sudo_noexec/g' libsudo_noexec.la > sudo_noexec.la
	if test -f .libs/libsudo_noexec.lai; then sed 's/libsudo_noexec/sudo_noexec/g' .libs/libsudo_noexec.lai > .libs/sudo_noexec.lai; fi
	cp -p .libs/libsudo_noexec.so .libs/sudo_noexec.so

sesh: $(SESH_OBJS) $(LT_LIBS)
	$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(SESH_OBJS) $(LDFLAGS) $(ASAN_LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(LIBS)

check_noexec: $(CHECK_NOEXEC_OBJS) $(top_builddir)/lib/util/libsudo_util.la sudo_noexec.la
	$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(CHECK_NOEXEC_OBJS) $(TEST_LDFLAGS) $(ASAN_LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(TEST_LIBS)

check_ttyname: $(CHECK_TTYNAME_OBJS) $(top_builddir)/lib/util/libsudo_util.la
	$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(CHECK_TTYNAME_OBJS) $(TEST_LDFLAGS) $(ASAN_LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(TEST_LIBS)

pre-install:

install: install-binaries install-rc @INSTALL_NOEXEC@

install-dirs:
	# We only create the rc.d dir when installing to the actual system dir
	$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
	    $(DESTDIR)$(libexecdir)/sudo $(DESTDIR)$(noexecdir)
	if test -n "$(INIT_SCRIPT)"; then \
	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(INIT_DIR); \
	    if test -z "$(DESTDIR)"; then \
		$(SHELL) $(top_srcdir)/mkinstalldirs \
		    `echo $(RC_LINK) | $(SED) 's,/[^/]*$$,,'`; \
	    fi; \
	elif test -n "$(tmpfiles_d)"; then \
	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(tmpfiles_d); \
	fi

install-rc: install-dirs
	# We only create the rc.d link when installing to the actual system dir
	if [ -n "$(INIT_SCRIPT)" ]; then \
	    $(INSTALL) $(INSTALL_OWNER) -m 0755 $(top_builddir)/init.d/$(INIT_SCRIPT) $(DESTDIR)$(INIT_DIR)/sudo; \
	    if test -z "$(DESTDIR)"; then \
		rm -f $(RC_LINK); \
		ln -s $(INIT_DIR)/sudo $(RC_LINK); \
	    fi; \
	elif test -n "$(tmpfiles_d)"; then \
	    $(INSTALL) $(INSTALL_OWNER) -m 0644 $(top_builddir)/init.d/sudo.conf $(DESTDIR)$(tmpfiles_d)/sudo.conf; \
	fi

install-binaries: install-dirs $(PROGS)
	INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 04755 sudo $(DESTDIR)$(bindir)/sudo
	rm -f $(DESTDIR)$(bindir)/sudoedit
	ln -s sudo $(DESTDIR)$(bindir)/sudoedit
	if [ -f sesh ]; then \
	    INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 sesh $(DESTDIR)$(libexecdir)/sudo/sesh; \
	fi

install-doc:

install-includes:

install-noexec: install-dirs sudo_noexec.la
	INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sudo_noexec.la $(DESTDIR)$(noexecdir)

install-plugin:

uninstall:
	-$(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(noexecdir)/sudo_noexec.la
	-rm -f	$(DESTDIR)$(bindir)/sudo \
		$(DESTDIR)$(bindir)/sudoedit \
		$(DESTDIR)$(libexecdir)/sudo/sesh \
		$(DESTDIR)/usr/lib/tmpfiles.d/sudo.conf
	-test -z "$(INSTALL_BACKUP)" || \
	    rm -f $(DESTDIR)$(bindir)/sudo$(INSTALL_BACKUP) \
		  $(DESTDIR)$(libexecdir)/sudo/sesh$(INSTALL_BACKUP) \
		  $(DESTDIR)$(noexecdir)/sudo_noexec.so$(INSTALL_BACKUP)
	-test -z "$(INIT_SCRIPT)" || \
	    rm -f $(DESTDIR)$(RC_LINK) $(DESTDIR)$(INIT_DIR)/sudo

splint:
	splint $(SPLINT_OPTS) -I$(incdir) -I$(top_builddir) -I. -I$(srcdir) -I$(top_srcdir) $(srcdir)/*.c

cppcheck:
	cppcheck $(CPPCHECK_OPTS) -I$(incdir) -I$(top_builddir) -I. -I$(srcdir) -I$(top_srcdir) $(srcdir)/*.c

check: $(TEST_PROGS)
	@if test X"$(cross_compiling)" != X"yes"; then \
	    ./check_ttyname; \
	    if test X"@CHECK_NOEXEC@" != X""; then \
		./check_noexec .libs/$(noexecfile); \
	    fi; \
	fi

clean:
	-$(LIBTOOL) $(LTFLAGS) --mode=clean rm -f $(PROGS) $(TEST_PROGS) \
	    *.lo *.o *.la *.a stamp-* core *.core core.* nohup.out

mostlyclean: clean

distclean: clean
	-rm -rf Makefile .libs sudo_usage.h

clobber: distclean

realclean: distclean
	rm -f TAGS tags

cleandir: realclean

# *Not* auto-generated to avoid building with ASAN
sudo_noexec.lo: $(srcdir)/sudo_noexec.c $(incdir)/sudo_compat.h \
                $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sudo_noexec.c

# Autogenerated dependencies, do not modify
check_noexec.o: $(srcdir)/regress/noexec/check_noexec.c \
                $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
                $(incdir)/sudo_fatal.h $(incdir)/sudo_util.h \
                $(srcdir)/sudo_exec.h $(top_builddir)/config.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/regress/noexec/check_noexec.c
check_ttyname.o: $(srcdir)/regress/ttyname/check_ttyname.c \
                 $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
                 $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
                 $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
                 $(top_builddir)/config.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/regress/ttyname/check_ttyname.c
conversation.o: $(srcdir)/conversation.c $(incdir)/compat/stdbool.h \
                $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
                $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
                $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
                $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
                $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
                $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/conversation.c
env_hooks.o: $(srcdir)/env_hooks.c $(incdir)/compat/stdbool.h \
             $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
             $(incdir)/sudo_debug.h $(incdir)/sudo_dso.h \
             $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
             $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
             $(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
             $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/env_hooks.c
exec.o: $(srcdir)/exec.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
        $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
        $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
        $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
        $(srcdir)/sudo.h $(srcdir)/sudo_exec.h $(srcdir)/sudo_plugin_int.h \
        $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/exec.c
exec_common.o: $(srcdir)/exec_common.c $(incdir)/compat/stdbool.h \
               $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
               $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
               $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
               $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
               $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/exec_common.c
exec_monitor.o: $(srcdir)/exec_monitor.c $(incdir)/compat/stdbool.h \
                $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
                $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
                $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
                $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
                $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
                $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
                $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/exec_monitor.c
exec_nopty.o: $(srcdir)/exec_nopty.c $(incdir)/compat/stdbool.h \
              $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
              $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
              $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
              $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
              $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
              $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
              $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/exec_nopty.c
exec_pty.o: $(srcdir)/exec_pty.c $(incdir)/compat/stdbool.h \
            $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
            $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
            $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
            $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
            $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
            $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
            $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/exec_pty.c
get_pty.o: $(srcdir)/get_pty.c $(incdir)/compat/stdbool.h \
           $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
           $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
           $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
           $(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
           $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/get_pty.c
hooks.o: $(srcdir)/hooks.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
         $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
         $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
         $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
         $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
         $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/hooks.c
load_plugins.o: $(srcdir)/load_plugins.c $(incdir)/compat/stdbool.h \
                $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
                $(incdir)/sudo_debug.h $(incdir)/sudo_dso.h \
                $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
                $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
                $(incdir)/sudo_util.h $(srcdir)/sudo.h \
                $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
                $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/load_plugins.c
net_ifs.o: $(srcdir)/net_ifs.c $(incdir)/compat/stdbool.h \
           $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
           $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
           $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
           $(top_builddir)/config.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/net_ifs.c
openbsd.o: $(srcdir)/openbsd.c $(incdir)/compat/stdbool.h \
           $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
           $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
           $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
           $(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
           $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/openbsd.c
parse_args.o: $(srcdir)/parse_args.c $(incdir)/compat/getopt.h \
              $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
              $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
              $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
              $(incdir)/sudo_lbuf.h $(incdir)/sudo_queue.h \
              $(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
              $(top_builddir)/pathnames.h ./sudo_usage.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/parse_args.c
preload.o: $(srcdir)/preload.c $(incdir)/sudo_compat.h $(incdir)/sudo_dso.h \
           $(incdir)/sudo_plugin.h $(top_builddir)/config.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/preload.c
preserve_fds.o: $(srcdir)/preserve_fds.c $(incdir)/compat/stdbool.h \
                $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
                $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
                $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
                $(incdir)/sudo_util.h $(srcdir)/sudo.h \
                $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/preserve_fds.c
selinux.o: $(srcdir)/selinux.c $(incdir)/compat/stdbool.h \
           $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
           $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
           $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
           $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
           $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/selinux.c
sesh.o: $(srcdir)/sesh.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
        $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
        $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
        $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo_exec.h \
        $(top_builddir)/config.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sesh.c
signal.o: $(srcdir)/signal.c $(incdir)/compat/stdbool.h \
          $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
          $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
          $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
          $(srcdir)/sudo_exec.h $(top_builddir)/config.h \
          $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/signal.c
solaris.o: $(srcdir)/solaris.c $(incdir)/compat/stdbool.h \
           $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
           $(incdir)/sudo_debug.h $(incdir)/sudo_dso.h $(incdir)/sudo_fatal.h \
           $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
           $(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
           $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/solaris.c
sudo.o: $(srcdir)/sudo.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
        $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
        $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
        $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
        $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
        $(top_builddir)/pathnames.h ./sudo_usage.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sudo.c
sudo_edit.o: $(srcdir)/sudo_edit.c $(incdir)/compat/stdbool.h \
             $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
             $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
             $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
             $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
             $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sudo_edit.c
tcsetpgrp_nobg.o: $(srcdir)/tcsetpgrp_nobg.c $(incdir)/compat/stdbool.h \
                  $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
                  $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
                  $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
                  $(incdir)/sudo_util.h $(srcdir)/sudo.h \
                  $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/tcsetpgrp_nobg.c
tgetpass.o: $(srcdir)/tgetpass.c $(incdir)/compat/stdbool.h \
            $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
            $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
            $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
            $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
            $(top_builddir)/config.h $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/tgetpass.c
ttyname.o: $(srcdir)/ttyname.c $(incdir)/compat/stdbool.h \
           $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
           $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
           $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h \
           $(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
           $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/ttyname.c
utmp.o: $(srcdir)/utmp.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
        $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
        $(incdir)/sudo_gettext.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
        $(srcdir)/sudo.h $(srcdir)/sudo_exec.h $(top_builddir)/config.h \
        $(top_builddir)/pathnames.h
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/utmp.c
