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 atoid.lo fatal.lo fileops.lo fmt_string.lo \
70: gidlist.lo lbuf.lo list.lo secure_path.lo setgroups.lo sudo_conf.lo \
71: sudo_debug.lo sudo_printf.lo term.lo ttysize.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)/fatal.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)/fatal.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: atoid.lo: $(srcdir)/atoid.c $(top_builddir)/config.h \
167: $(top_srcdir)/compat/stdbool.h $(incdir)/gettext.h \
168: $(incdir)/missing.h $(incdir)/sudo_debug.h
169: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/atoid.c
170: conf_test.lo: $(srcdir)/regress/sudo_conf/conf_test.c $(top_builddir)/config.h \
171: $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h \
172: $(incdir)/sudo_conf.h $(incdir)/list.h
173: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/sudo_conf/conf_test.c
174: fatal.lo: $(srcdir)/fatal.c $(top_builddir)/config.h \
175: $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h $(incdir)/alloc.h \
176: $(incdir)/fatal.h $(incdir)/sudo_plugin.h $(incdir)/gettext.h
177: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/fatal.c
178: fileops.lo: $(srcdir)/fileops.c $(top_builddir)/config.h \
179: $(top_srcdir)/compat/stdbool.h $(top_srcdir)/compat/timespec.h \
180: $(incdir)/missing.h $(incdir)/fileops.h $(incdir)/sudo_debug.h
181: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/fileops.c
182: fmt_string.lo: $(srcdir)/fmt_string.c $(top_builddir)/config.h \
183: $(incdir)/missing.h $(incdir)/sudo_debug.h
184: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/fmt_string.c
185: gidlist.lo: $(srcdir)/gidlist.c $(top_builddir)/config.h $(incdir)/gettext.h \
186: $(incdir)/missing.h $(incdir)/alloc.h $(incdir)/fatal.h \
187: $(incdir)/sudo_debug.h
188: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/gidlist.c
189: lbuf.lo: $(srcdir)/lbuf.c $(top_builddir)/config.h $(incdir)/missing.h \
190: $(incdir)/alloc.h $(incdir)/fatal.h $(incdir)/lbuf.h \
191: $(incdir)/sudo_debug.h
192: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/lbuf.c
193: list.lo: $(srcdir)/list.c $(top_builddir)/config.h $(incdir)/missing.h \
194: $(incdir)/list.h $(incdir)/fatal.h
195: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/list.c
196: parseln_test.lo: $(srcdir)/regress/sudo_parseln/parseln_test.c \
197: $(top_builddir)/config.h $(top_srcdir)/compat/stdbool.h \
198: $(incdir)/missing.h $(incdir)/fileops.h
199: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/sudo_parseln/parseln_test.c
200: secure_path.lo: $(srcdir)/secure_path.c $(top_builddir)/config.h \
201: $(incdir)/missing.h $(incdir)/sudo_debug.h \
202: $(incdir)/secure_path.h
203: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/secure_path.c
204: setgroups.lo: $(srcdir)/setgroups.c $(top_builddir)/config.h \
205: $(incdir)/missing.h $(incdir)/sudo_debug.h
206: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/setgroups.c
207: sudo_conf.lo: $(srcdir)/sudo_conf.c $(top_builddir)/config.h \
208: $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h \
209: $(incdir)/alloc.h $(incdir)/fatal.h $(incdir)/fileops.h \
210: $(top_builddir)/pathnames.h $(incdir)/sudo_plugin.h \
211: $(incdir)/sudo_conf.h $(incdir)/list.h $(incdir)/sudo_debug.h \
212: $(incdir)/secure_path.h $(incdir)/gettext.h
213: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_conf.c
214: sudo_debug.lo: $(srcdir)/sudo_debug.c $(top_builddir)/config.h \
215: $(top_srcdir)/compat/stdbool.h $(incdir)/missing.h \
216: $(incdir)/alloc.h $(incdir)/fatal.h $(incdir)/sudo_plugin.h \
217: $(incdir)/sudo_debug.h $(incdir)/gettext.h
218: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_debug.c
219: sudo_printf.lo: $(srcdir)/sudo_printf.c $(top_builddir)/config.h \
220: $(incdir)/missing.h $(incdir)/sudo_plugin.h \
221: $(incdir)/sudo_debug.h
222: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_printf.c
223: term.lo: $(srcdir)/term.c $(top_builddir)/config.h $(incdir)/missing.h \
224: $(incdir)/sudo_debug.h
225: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/term.c
226: ttysize.lo: $(srcdir)/ttysize.c $(top_builddir)/config.h $(incdir)/missing.h \
227: $(incdir)/sudo_debug.h
228: $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/ttysize.c
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>