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
28 # Where to install things...
30 exec_prefix = @exec_prefix@
33 sysconfdir = @sysconfdir@
34 libexecdir = @libexecdir@
35 datarootdir = @datarootdir@
36 localstatedir = @localstatedir@
38 # Compiler & tools to use
42 # C preprocessor flags
43 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(top_srcdir) @CPPFLAGS@
45 # Usually -O and/or -g
48 # OS dependent defines
51 # Set to non-empty for development mode
54 #### End of system configuration section. ####
58 TEST_PROGS = @COMPAT_TEST_PROGS@
62 LTLIBOBJS = @LTLIBOBJS@
66 Makefile: $(srcdir)/Makefile.in
67 (cd $(top_builddir) && ./config.status --file compat/Makefile)
69 .SUFFIXES: .o .c .h .lo
72 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
75 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
77 libreplace.la: $(LTLIBOBJS)
78 $(LIBTOOL) --mode=link $(CC) -o $@ $(LTLIBOBJS) -no-install
83 mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/missing.h $(top_builddir)/config.h
84 $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
86 fnm_test: fnm_test.o libreplace.la
87 $(LIBTOOL) --mode=link $(CC) -o $@ fnm_test.o libreplace.la
89 globtest: globtest.o libreplace.la
90 $(LIBTOOL) --mode=link $(CC) -o $@ globtest.o libreplace.la
92 $(srcdir)/mksiglist.h: $(srcdir)/siglist.in
93 if [ -n "$(DEVEL)" ]; then \
94 awk 'BEGIN {print "/* public domain */\n"} /^ [A-Z]/ {printf("#ifdef SIG%s\n if (my_sys_siglist[SIG%s] == NULL)\n\tmy_sys_siglist[SIG%s] = \"%s\";\n#endif\n", $$1, $$1, $$1, substr($$0, 13))}' < $(srcdir)/siglist.in > $@; \
114 @if [ -f fnm_test ]; then \
115 ./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in; \
117 @if [ -f globtest ]; then \
118 mkdir -p `sed 's@/[^/]*$$@@' $(srcdir)/regress/glob/files | sort -u`; \
119 touch `cat $(srcdir)/regress/glob/files`; \
120 chmod 0755 `grep '/r[^/]*$$' $(srcdir)/regress/glob/files`; \
121 chmod 0444 `grep '/s[^/]*$$' $(srcdir)/regress/glob/files`; \
122 chmod 0711 `grep '/t[^/]*$$' $(srcdir)/regress/glob/files`; \
123 ./globtest $(srcdir)/regress/glob/globtest.in; \
130 -$(LIBTOOL) --mode=clean rm -f $(TEST_PROGS) mksiglist siglist.c *.lo *.o *.la *.a stamp-* core *.core core.*
135 -rm -rf Makefile .libs
144 # Autogenerated dependencies, do not modify
145 closefrom.lo: $(srcdir)/closefrom.c $(top_builddir)/config.h $(incdir)/missing.h
146 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/closefrom.c
147 dlopen.lo: $(srcdir)/dlopen.c $(top_builddir)/config.h \
148 $(top_srcdir)/compat/dlfcn.h $(incdir)/missing.h
149 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/dlopen.c
150 fnm_test.o: $(srcdir)/regress/fnmatch/fnm_test.c $(top_builddir)/config.h \
151 $(top_srcdir)/compat/fnmatch.h
152 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/regress/fnmatch/fnm_test.c
153 fnmatch.lo: $(srcdir)/fnmatch.c $(top_builddir)/config.h $(incdir)/missing.h \
154 $(top_srcdir)/compat/charclass.h $(top_srcdir)/compat/fnmatch.h
155 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/fnmatch.c
156 getcwd.lo: $(srcdir)/getcwd.c $(top_builddir)/config.h $(incdir)/missing.h
157 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getcwd.c
158 getgrouplist.lo: $(srcdir)/getgrouplist.c $(top_builddir)/config.h \
160 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getgrouplist.c
161 getline.lo: $(srcdir)/getline.c $(top_builddir)/config.h $(incdir)/missing.h
162 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getline.c
163 getprogname.lo: $(srcdir)/getprogname.c $(top_builddir)/config.h \
165 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getprogname.c
166 glob.lo: $(srcdir)/glob.c $(top_builddir)/config.h $(incdir)/missing.h \
167 $(top_srcdir)/compat/glob.h $(top_srcdir)/compat/charclass.h
168 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/glob.c
169 globtest.o: $(srcdir)/regress/glob/globtest.c $(top_builddir)/config.h \
170 $(top_srcdir)/compat/glob.h $(incdir)/missing.h
171 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/regress/glob/globtest.c
172 isblank.lo: $(srcdir)/isblank.c $(top_builddir)/config.h $(incdir)/missing.h
173 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/isblank.c
174 memrchr.lo: $(srcdir)/memrchr.c $(top_builddir)/config.h $(incdir)/missing.h
175 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/memrchr.c
176 mksiglist.lo: $(srcdir)/mksiglist.c $(top_builddir)/config.h \
177 $(incdir)/missing.h $(top_srcdir)/compat/mksiglist.h
178 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c
179 mktemp.lo: $(srcdir)/mktemp.c $(top_builddir)/config.h $(incdir)/missing.h
180 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mktemp.c
181 nanosleep.lo: $(srcdir)/nanosleep.c $(top_builddir)/config.h \
182 $(top_srcdir)/compat/timespec.h $(incdir)/missing.h
183 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/nanosleep.c
184 pw_dup.lo: $(srcdir)/pw_dup.c $(top_builddir)/config.h
185 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/pw_dup.c
186 siglist.lo: siglist.c $(top_builddir)/config.h $(incdir)/missing.h
187 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) siglist.c
188 snprintf.lo: $(srcdir)/snprintf.c $(top_builddir)/config.h $(incdir)/missing.h
189 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/snprintf.c
190 strlcat.lo: $(srcdir)/strlcat.c $(top_builddir)/config.h $(incdir)/missing.h
191 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/strlcat.c
192 strlcpy.lo: $(srcdir)/strlcpy.c $(top_builddir)/config.h $(incdir)/missing.h
193 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/strlcpy.c
194 strsignal.lo: $(srcdir)/strsignal.c $(top_builddir)/config.h \
195 $(incdir)/missing.h $(incdir)/gettext.h
196 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/strsignal.c
197 utimes.lo: $(srcdir)/utimes.c $(top_builddir)/config.h \
198 $(top_srcdir)/compat/utime.h $(incdir)/missing.h
199 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/utimes.c