Imported Upstream version 1.8.7
[debian/sudo] / common / Makefile.in
1 #
2 # Copyright (c) 2011-2013 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 cross_compiling = @CROSS_COMPILING@
28
29 # Where to install things...
30 prefix = @prefix@
31 exec_prefix = @exec_prefix@
32 bindir = @bindir@
33 sbindir = @sbindir@
34 sysconfdir = @sysconfdir@
35 libexecdir = @libexecdir@
36 datarootdir = @datarootdir@
37 localstatedir = @localstatedir@
38
39 # Compiler & tools to use
40 CC = @CC@
41 LIBTOOL = @LIBTOOL@
42
43 # C preprocessor flags
44 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(top_srcdir) @CPPFLAGS@
45
46 # Usually -O and/or -g
47 CFLAGS = @CFLAGS@
48
49 # PIE flags
50 PIE_CFLAGS = @PIE_CFLAGS@
51 PIE_LDFLAGS = @PIE_LDFLAGS@
52
53 # Stack smashing protection flags
54 SSP_CFLAGS = @SSP_CFLAGS@
55 SSP_LDFLAGS = @SSP_LDFLAGS@
56
57 # Regression tests
58 TEST_PROGS = conf_test parseln_test
59 TEST_LIBS = @LIBS@ @LIBINTL@ ../compat/libreplace.la
60 TEST_LDFLAGS = @LDFLAGS@
61
62 # OS dependent defines
63 DEFS = @OSDEFS@ -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\"
64
65 #### End of system configuration section. ####
66
67 SHELL = @SHELL@
68
69 LTOBJS = alloc.lo atobool.lo error.lo fileops.lo fmt_string.lo lbuf.lo list.lo \
70          secure_path.lo setgroups.lo sudo_conf.lo sudo_debug.lo sudo_printf.lo \
71          term.lo ttysize.lo zero_bytes.lo @COMMON_OBJS@
72
73 PARSELN_TEST_OBJS = parseln_test.lo
74
75 CONF_TEST_OBJS = conf_test.lo
76
77 all: libcommon.la
78
79 Makefile: $(srcdir)/Makefile.in
80         (cd $(top_builddir) && ./config.status --file common/Makefile)
81
82 .SUFFIXES: .c .h .lo
83
84 .c.lo:
85         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $<
86
87 libcommon.la: $(LTOBJS)
88         $(LIBTOOL) --mode=link $(CC) -o $@ $(LTOBJS) -no-install
89
90 conf_test: $(CONF_TEST_OBJS) libcommon.la
91         $(LIBTOOL) --mode=link $(CC) -o $@ $(CONF_TEST_OBJS) libcommon.la $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(TEST_LDFLAGS) $(TEST_LIBS)
92
93 parseln_test: $(PARSELN_TEST_OBJS) libcommon.la
94         $(LIBTOOL) --mode=link $(CC) -o $@ $(PARSELN_TEST_OBJS) libcommon.la $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(TEST_LDFLAGS) $(TEST_LIBS)
95
96 pre-install:
97
98 install:
99
100 install-dirs:
101
102 install-binaries:
103
104 install-includes:
105
106 install-doc:
107
108 install-plugin:
109
110 uninstall:
111
112 check: $(TEST_PROGS)
113         @if test X"$(cross_compiling)" != X"yes"; then \
114             passed=0; failed=0; total=0; \
115             for dir in sudo_conf sudo_parseln; do \
116                 mkdir -p regress/$$dir; \
117                 for t in $(srcdir)/regress/$$dir/*.in; do \
118                     base=`basename $$t .in`; \
119                     out="regress/$$dir/$$base.out"; \
120                     if test "$$dir" = "sudo_conf"; then \
121                         ./conf_test $$t >$$out; \
122                     else \
123                         ./parseln_test <$$t >$$out; \
124                     fi; \
125                     if cmp $$out $(srcdir)/$$out.ok >/dev/null; then \
126                         passed=`expr $$passed + 1`; \
127                         echo "$$dir/$$base: OK"; \
128                     else \
129                         failed=`expr $$failed + 1`; \
130                         echo "$$dir/$$base: FAIL"; \
131                         diff $$out $(srcdir)/$$out.ok; \
132                     fi; \
133                     total=`expr $$total + 1`; \
134                 done; \
135             done; \
136             echo "$$dir: $$passed/$$total tests passed; $$failed/$$total tests failed"; \
137             exit $$failed; \
138         fi
139
140 clean:
141         -$(LIBTOOL) --mode=clean rm -f $(TEST_PROGS) *.lo *.o *.la *.a stamp-* core *.core core.* regress/*/*.out
142
143 mostlyclean: clean
144
145 distclean: clean
146         -rm -rf Makefile .libs
147
148 clobber: distclean
149
150 realclean: distclean
151         rm -f TAGS tags
152
153 cleandir: realclean
154
155 # Autogenerated dependencies, do not modify
156 aix.lo: $(srcdir)/aix.c $(top_builddir)/config.h $(incdir)/missing.h \
157         $(incdir)/alloc.h $(incdir)/error.h $(incdir)/sudo_debug.h \
158         $(incdir)/gettext.h
159         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/aix.c
160 alloc.lo: $(srcdir)/alloc.c $(top_builddir)/config.h $(incdir)/missing.h \
161           $(incdir)/alloc.h $(incdir)/error.h $(incdir)/gettext.h
162         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/alloc.c
163 atobool.lo: $(srcdir)/atobool.c $(top_builddir)/config.h $(incdir)/missing.h \
164             $(incdir)/sudo_debug.h
165         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/atobool.c
166 conf_test.lo: $(srcdir)/regress/sudo_conf/conf_test.c $(top_builddir)/config.h \
167               $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h \
168               $(incdir)/sudo_conf.h $(incdir)/list.h
169         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/sudo_conf/conf_test.c
170 error.lo: $(srcdir)/error.c $(top_builddir)/config.h \
171           $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h $(incdir)/alloc.h \
172           $(incdir)/error.h $(incdir)/sudo_plugin.h $(incdir)/gettext.h
173         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/error.c
174 fileops.lo: $(srcdir)/fileops.c $(top_builddir)/config.h \
175             $(top_srcdir)/compat/stdbool.h $(top_srcdir)/compat/timespec.h \
176             $(incdir)/missing.h $(incdir)/fileops.h $(incdir)/sudo_debug.h
177         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/fileops.c
178 fmt_string.lo: $(srcdir)/fmt_string.c $(top_builddir)/config.h \
179                $(incdir)/missing.h $(incdir)/sudo_debug.h
180         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/fmt_string.c
181 lbuf.lo: $(srcdir)/lbuf.c $(top_builddir)/config.h $(incdir)/missing.h \
182          $(incdir)/alloc.h $(incdir)/error.h $(incdir)/lbuf.h \
183          $(incdir)/sudo_debug.h
184         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/lbuf.c
185 list.lo: $(srcdir)/list.c $(top_builddir)/config.h $(incdir)/missing.h \
186          $(incdir)/list.h $(incdir)/error.h
187         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/list.c
188 parseln_test.lo: $(srcdir)/regress/sudo_parseln/parseln_test.c \
189                  $(top_builddir)/config.h $(top_srcdir)/compat/stdbool.h \
190                  $(incdir)/missing.h $(incdir)/fileops.h
191         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/sudo_parseln/parseln_test.c
192 secure_path.lo: $(srcdir)/secure_path.c $(top_builddir)/config.h \
193                 $(incdir)/missing.h $(incdir)/sudo_debug.h \
194                 $(incdir)/secure_path.h
195         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/secure_path.c
196 setgroups.lo: $(srcdir)/setgroups.c $(top_builddir)/config.h \
197               $(incdir)/missing.h $(incdir)/sudo_debug.h
198         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/setgroups.c
199 sudo_conf.lo: $(srcdir)/sudo_conf.c $(top_builddir)/config.h \
200               $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h \
201               $(incdir)/alloc.h $(incdir)/error.h $(incdir)/fileops.h \
202               $(top_builddir)/pathnames.h $(incdir)/sudo_plugin.h \
203               $(incdir)/sudo_conf.h $(incdir)/list.h $(incdir)/sudo_debug.h \
204               $(incdir)/secure_path.h $(incdir)/gettext.h
205         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_conf.c
206 sudo_debug.lo: $(srcdir)/sudo_debug.c $(top_builddir)/config.h \
207                $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h \
208                $(incdir)/alloc.h $(incdir)/error.h $(incdir)/sudo_plugin.h \
209                $(incdir)/sudo_debug.h $(incdir)/gettext.h
210         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_debug.c
211 sudo_printf.lo: $(srcdir)/sudo_printf.c $(top_builddir)/config.h \
212                 $(incdir)/missing.h $(incdir)/sudo_plugin.h \
213                 $(incdir)/sudo_debug.h
214         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_printf.c
215 term.lo: $(srcdir)/term.c $(top_builddir)/config.h $(incdir)/missing.h \
216          $(incdir)/sudo_debug.h
217         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/term.c
218 ttysize.lo: $(srcdir)/ttysize.c $(top_builddir)/config.h $(incdir)/missing.h \
219             $(incdir)/sudo_debug.h
220         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/ttysize.c
221 zero_bytes.lo: $(srcdir)/zero_bytes.c $(top_builddir)/config.h \
222                $(incdir)/missing.h
223         $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/zero_bytes.c