2 # Copyright (c) 2011 Todd C. Miller <Todd.Miller@courtesan.com>
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.
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.
20 #### Start of system configuration section. ####
24 top_builddir = @top_builddir@
25 top_srcdir = @top_srcdir@
26 incdir = $(top_srcdir)/include
27 cross_compiling = @CROSS_COMPILING@
29 # Where to install things...
31 exec_prefix = @exec_prefix@
34 sysconfdir = @sysconfdir@
35 libexecdir = @libexecdir@
36 datarootdir = @datarootdir@
37 localstatedir = @localstatedir@
39 # Compiler & tools to use
43 # C preprocessor flags
44 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(top_srcdir) @CPPFLAGS@
46 # Usually -O and/or -g
50 PIE_CFLAGS = @PIE_CFLAGS@
51 PIE_LDFLAGS = @PIE_LDFLAGS@
53 # Stack smashing protection flags
54 SSP_CFLAGS = @SSP_CFLAGS@
55 SSP_LDFLAGS = @SSP_LDFLAGS@
57 # OS dependent defines
60 # Set to non-empty for development mode
63 #### End of system configuration section. ####
67 TEST_PROGS = @COMPAT_TEST_PROGS@
71 LTLIBOBJS = @LTLIBOBJS@
75 Makefile: $(srcdir)/Makefile.in
76 (cd $(top_builddir) && ./config.status --file compat/Makefile)
78 .SUFFIXES: .o .c .h .lo
81 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $<
84 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $<
86 libreplace.la: $(LTLIBOBJS)
87 $(LIBTOOL) --mode=link $(CC) -o $@ $(LTLIBOBJS) -no-install
95 mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/missing.h $(top_builddir)/config.h
96 $(CC) $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
98 mksigname: $(srcdir)/mksigname.c $(srcdir)/mksigname.h $(incdir)/missing.h $(top_builddir)/config.h
99 $(CC) $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksigname.c -o $@
101 fnm_test: fnm_test.o libreplace.la
102 $(LIBTOOL) --mode=link $(CC) -o $@ fnm_test.o libreplace.la
104 globtest: globtest.o libreplace.la
105 $(LIBTOOL) --mode=link $(CC) -o $@ globtest.o libreplace.la
107 $(srcdir)/mksiglist.h: $(srcdir)/siglist.in
108 @if [ -n "$(DEVEL)" ]; then \
109 awk 'BEGIN {print "/* public domain */\n"} /^ [A-Z]/ {printf("#ifdef SIG%s\n if (sudo_sys_siglist[SIG%s] == NULL)\n\tsudo_sys_siglist[SIG%s] = \"%s\";\n#endif\n", $$1, $$1, $$1, substr($$0, 13))}' < $(srcdir)/siglist.in > $@; \
112 $(srcdir)/mksigname.h: $(srcdir)/siglist.in
113 @if [ -n "$(DEVEL)" ]; then \
114 awk 'BEGIN {print "/* public domain */\n"} /^ [A-Z]/ {printf("#ifdef SIG%s\n if (sudo_sys_signame[SIG%s] == NULL)\n\tsudo_sys_signame[SIG%s] = \"%s\";\n#endif\n", $$1, $$1, $$1, $$1)}' < $(srcdir)/siglist.in > $@; \
134 @if test X"$(cross_compiling)" != X"yes"; then \
135 if test -f fnm_test; then \
136 ./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in; \
138 if test -f globtest; then \
139 mkdir -p `sed 's@/[^/]*$$@@' $(srcdir)/regress/glob/files | sort -u`; \
140 touch `cat $(srcdir)/regress/glob/files`; \
141 chmod 0755 `grep '/r[^/]*$$' $(srcdir)/regress/glob/files`; \
142 chmod 0444 `grep '/s[^/]*$$' $(srcdir)/regress/glob/files`; \
143 chmod 0711 `grep '/t[^/]*$$' $(srcdir)/regress/glob/files`; \
144 ./globtest $(srcdir)/regress/glob/globtest.in; \
152 -$(LIBTOOL) --mode=clean rm -f $(TEST_PROGS) mksiglist mksigname siglist.c signame.c *.lo *.o *.la *.a stamp-* core *.core core.*
157 -rm -rf Makefile .libs
166 # Autogenerated dependencies, do not modify
167 closefrom.lo: $(srcdir)/closefrom.c $(top_builddir)/config.h $(incdir)/missing.h
168 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/closefrom.c
169 dlopen.lo: $(srcdir)/dlopen.c $(top_builddir)/config.h \
170 $(top_srcdir)/compat/dlfcn.h $(incdir)/missing.h
171 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/dlopen.c
172 fnm_test.o: $(srcdir)/regress/fnmatch/fnm_test.c $(top_builddir)/config.h \
173 $(top_srcdir)/compat/fnmatch.h
174 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/fnmatch/fnm_test.c
175 fnmatch.lo: $(srcdir)/fnmatch.c $(top_builddir)/config.h $(incdir)/missing.h \
176 $(top_srcdir)/compat/charclass.h $(top_srcdir)/compat/fnmatch.h
177 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/fnmatch.c
178 getcwd.lo: $(srcdir)/getcwd.c $(top_builddir)/config.h $(incdir)/missing.h
179 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getcwd.c
180 getgrouplist.lo: $(srcdir)/getgrouplist.c $(top_builddir)/config.h \
182 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getgrouplist.c
183 getline.lo: $(srcdir)/getline.c $(top_builddir)/config.h $(incdir)/missing.h
184 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getline.c
185 getprogname.lo: $(srcdir)/getprogname.c $(top_builddir)/config.h \
187 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getprogname.c
188 glob.lo: $(srcdir)/glob.c $(top_builddir)/config.h $(incdir)/missing.h \
189 $(top_srcdir)/compat/glob.h $(top_srcdir)/compat/charclass.h
190 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/glob.c
191 globtest.o: $(srcdir)/regress/glob/globtest.c $(top_builddir)/config.h \
192 $(top_srcdir)/compat/glob.h $(incdir)/missing.h
193 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/glob/globtest.c
194 isblank.lo: $(srcdir)/isblank.c $(top_builddir)/config.h $(incdir)/missing.h
195 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/isblank.c
196 memrchr.lo: $(srcdir)/memrchr.c $(top_builddir)/config.h $(incdir)/missing.h
197 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/memrchr.c
198 mksiglist.lo: $(srcdir)/mksiglist.c $(top_builddir)/config.h \
199 $(incdir)/missing.h $(top_srcdir)/compat/mksiglist.h
200 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksiglist.c
201 mksigname.lo: $(srcdir)/mksigname.c $(top_builddir)/config.h \
202 $(incdir)/missing.h $(top_srcdir)/compat/mksigname.h
203 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksigname.c
204 mktemp.lo: $(srcdir)/mktemp.c $(top_builddir)/config.h $(incdir)/missing.h
205 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mktemp.c
206 nanosleep.lo: $(srcdir)/nanosleep.c $(top_builddir)/config.h \
207 $(top_srcdir)/compat/timespec.h $(incdir)/missing.h
208 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/nanosleep.c
209 pw_dup.lo: $(srcdir)/pw_dup.c $(top_builddir)/config.h
210 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/pw_dup.c
211 sig2str.lo: $(srcdir)/sig2str.c $(top_builddir)/config.h $(incdir)/missing.h
212 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sig2str.c
213 siglist.lo: siglist.c $(top_builddir)/config.h $(incdir)/missing.h
214 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) siglist.c
215 signame.lo: signame.c $(top_builddir)/config.h $(incdir)/missing.h
216 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) signame.c
217 snprintf.lo: $(srcdir)/snprintf.c $(top_builddir)/config.h $(incdir)/missing.h
218 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/snprintf.c
219 strlcat.lo: $(srcdir)/strlcat.c $(top_builddir)/config.h $(incdir)/missing.h
220 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/strlcat.c
221 strlcpy.lo: $(srcdir)/strlcpy.c $(top_builddir)/config.h $(incdir)/missing.h
222 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/strlcpy.c
223 strsignal.lo: $(srcdir)/strsignal.c $(top_builddir)/config.h \
224 $(incdir)/missing.h $(incdir)/gettext.h
225 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/strsignal.c
226 utimes.lo: $(srcdir)/utimes.c $(top_builddir)/config.h \
227 $(top_srcdir)/compat/utime.h $(incdir)/missing.h
228 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/utimes.c