Merge commit 'upstream/1.8.1p2'
[debian/sudo] / src / Makefile.in
1 #
2 # Copyright (c) 2011 Todd C. Miller <Todd.Miller@courtesan.com>
3 #
4 # Permission to use, copy, modify, and distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
7 #
8 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 #
17 # @configure_input@
18 #
19
20 #### Start of system configuration section. ####
21
22 srcdir = @srcdir@
23 devdir = @devdir@
24 top_builddir = @top_builddir@
25 top_srcdir = @top_srcdir@
26 incdir = $(top_srcdir)/include
27
28 # Compiler & tools to use
29 CC = @CC@
30 LIBTOOL = @LIBTOOL@ @LT_STATIC@
31
32 # Our install program supports extra flags...
33 INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
34
35 # Libraries
36 LT_LIBS = $(top_builddir)/common/libcommon.la $(LIBOBJDIR)libreplace.la
37 LIBS = @LIBS@ @SUDO_LIBS@ @GETGROUPS_LIB@ @NET_LIBS@ $(LT_LIBS)
38
39 # C preprocessor flags
40 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(srcdir) -I. @CPPFLAGS@
41
42 # Usually -O and/or -g
43 CFLAGS = @CFLAGS@
44
45 # Flags to pass to the link stage
46 LDFLAGS = @LDFLAGS@
47
48 # Where to install things...
49 prefix = @prefix@
50 exec_prefix = @exec_prefix@
51 bindir = @bindir@
52 sbindir = @sbindir@
53 sysconfdir = @sysconfdir@
54 libexecdir = @libexecdir@
55 datarootdir = @datarootdir@
56 localstatedir = @localstatedir@
57 noexecfile = @NOEXECFILE@
58 noexecdir = @NOEXECDIR@
59
60 # User and group ids the installed files should be "owned" by
61 install_uid = 0
62 install_gid = 0
63
64 # OS dependent defines
65 DEFS = @OSDEFS@ -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\"
66
67 #### End of system configuration section. ####
68
69 SHELL = @SHELL@
70
71 PROGS = @PROGS@
72
73 OBJS = conversation.o error.o exec.o exec_pty.o get_pty.o net_ifs.o \
74        load_plugins.o parse_args.o sudo.o sudo_edit.o tgetpass.o \
75        ttysize.o utmp.o @SUDO_OBJS@
76
77 LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/
78
79 VERSION = @PACKAGE_VERSION@
80
81 SUDODEP = $(srcdir)/sudo.h $(incdir)/sudo_plugin.h $(incdir)/alloc.h \
82           $(incdir)/error.h $(incdir)/list.h $(incdir)/missing.h \
83           $(top_builddir)/pathnames.h $(top_builddir)/config.h
84
85 all: $(PROGS)
86
87 Makefile: $(srcdir)/Makefile.in
88         (cd $(top_builddir) && ./config.status --file src/Makefile)
89
90 .SUFFIXES: .c .h .lo .o
91
92 .c.o:
93         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
94
95 .c.lo:
96         $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
97
98 sudo: $(OBJS) $(LT_LIBS)
99         $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) -static-libtool-libs
100
101 libsudo_noexec.la: sudo_noexec.lo
102         $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir)
103
104 sesh: sesh.o
105         $(CC) -o $@ sesh.o
106
107 # Dependencies
108 # XXX - SUDODEP is overkill for some of these
109 conversation.o: $(srcdir)/conversation.c $(SUDODEP)
110         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/conversation.c
111 error.o: $(srcdir)/error.c $(incdir)/missing.h $(incdir)/error.h $(top_builddir)/config.h
112         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/error.c
113 exec.o: $(srcdir)/exec.c $(SUDODEP) $(srcdir)/sudo_exec.h
114         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/exec.c
115 exec_pty.o: $(srcdir)/exec_pty.c $(SUDODEP) $(srcdir)/sudo_exec.h
116         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/exec_pty.c
117 get_pty.o: $(srcdir)/get_pty.c $(SUDODEP)
118         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/get_pty.c
119 net_ifs.o: $(srcdir)/net_ifs.c $(SUDODEP)
120         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/net_ifs.c
121 load_plugins.o: $(srcdir)/load_plugins.c $(SUDODEP)
122         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/load_plugins.c
123 parse_args.o: $(srcdir)/parse_args.c sudo_usage.h $(SUDODEP)
124         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/parse_args.c
125 preload.o: $(srcdir)/preload.c $(incdir)/sudo_plugin.h $(top_builddir)/config.h
126         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/preload.c
127 selinux.o: $(srcdir)/selinux.c $(SUDODEP)
128         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/selinux.c
129 sesh.o: $(srcdir)/sesh.c $(incdir)/missing.h $(top_builddir)/config.h
130         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/sesh.c
131 sudo.o: $(srcdir)/sudo.c $(SUDODEP)
132         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/sudo.c
133 sudo_edit.o: $(srcdir)/sudo_edit.c $(SUDODEP)
134         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/sudo_edit.c
135 sudo_noexec.lo: $(srcdir)/sudo_noexec.c $(incdir)/missing.h $(top_builddir)/config.h
136         $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/sudo_noexec.c
137 tgetpass.o: $(srcdir)/tgetpass.c $(SUDODEP)
138         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/tgetpass.c
139 ttysize.o: $(srcdir)/ttysize.c $(incdir)/missing.h $(top_builddir)/config.h
140         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/ttysize.c
141 utmp.o: $(srcdir)/utmp.c $(SUDODEP)
142         $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/utmp.c
143
144 pre-install:
145
146 install: install-dirs install-binaries @INSTALL_NOEXEC@
147
148 install-dirs:
149         $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
150             $(DESTDIR)$(noexecdir)
151
152 install-binaries: install-dirs $(PROGS)
153         $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 04111 sudo $(DESTDIR)$(bindir)/sudo
154         rm -f $(DESTDIR)$(bindir)/sudoedit
155         ln $(DESTDIR)$(bindir)/sudo $(DESTDIR)$(bindir)/sudoedit
156         if [ -f sesh ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 0111 sesh $(DESTDIR)$(libexecdir)/sesh; fi
157
158 install-doc:
159
160 install-includes:
161
162 # We install sudo_noexec by hand so we can avoid a "lib" prefix
163 # and a version number.  Since we use LD_PRELOAD, neither is needed.
164 install-noexec: install-dirs libsudo_noexec.la
165         if [ -f .libs/lib$(noexecfile) ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -M 0755 .libs/lib$(noexecfile) $(DESTDIR)$(noexecdir)/$(noexecfile); fi
166
167 install-plugin:
168
169 uninstall:
170         -rm -f  $(DESTDIR)$(bindir)/sudo $(DESTDIR)$(bindir)/sudoedit \
171                 $(DESTDIR)$(libexecdir)/sesh \
172                 $(DESTDIR)$(noexecdir)/$(noexecfile) \
173
174 check:
175
176 clean:
177         -$(LIBTOOL) --mode=clean rm -f $(PROGS) *.lo *.o *.la *.a stamp-* core *.core core.*
178
179 mostlyclean: clean
180
181 distclean: clean
182         -rm -rf Makefile .libs sudo_usage.h
183
184 clobber: distclean
185
186 realclean: distclean
187         rm -f TAGS tags
188
189 cleandir: realclean