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 # Compiler & tools to use
32 # C preprocessor flags
33 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(top_srcdir) @CPPFLAGS@
35 # Usually -O and/or -g
41 # OS dependent defines
44 #### End of system configuration section. ####
48 TEST_PROGS = fnm_test globtest
52 LTLIBOBJS = @LTLIBOBJS@
56 Makefile: $(srcdir)/Makefile.in
57 (cd $(top_builddir) && ./config.status --file compat/Makefile)
59 .SUFFIXES: .o .c .h .lo
62 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
65 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $<
67 libreplace.la: $(LTLIBOBJS)
68 $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(LTLIBOBJS) -no-install
73 mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/missing.h $(top_builddir)/config.h
74 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
76 fnm_test: fnm_test.o libreplace.la
77 $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ fnm_test.o libreplace.la
79 globtest: globtest.o libreplace.la
80 $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ globtest.o libreplace.la
82 @DEV@$(srcdir)/mksiglist.h: $(srcdir)/siglist.in
83 @DEV@ 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 > $@
102 @./fnm_test $(srcdir)/regress/fnmatch/fnm_test.in
103 @mkdir -p `sed 's@/[^/]*$$@@' $(srcdir)/regress/glob/files | sort -u`
104 @touch `cat $(srcdir)/regress/glob/files`
105 @chmod 0755 `grep '/r[^/]*$$' $(srcdir)/regress/glob/files`
106 @chmod 0444 `grep '/s[^/]*$$' $(srcdir)/regress/glob/files`
107 @chmod 0711 `grep '/t[^/]*$$' $(srcdir)/regress/glob/files`
108 @./globtest $(srcdir)/regress/glob/globtest.in
112 -$(LIBTOOL) --mode=clean rm -f $(TEST_PROGS) mksiglist siglist.c *.lo *.o *.la *.a stamp-* core *.core core.*
117 -rm -rf Makefile .libs
126 # Autogenerated dependencies, do not modify
127 closefrom.lo: $(srcdir)/closefrom.c $(top_builddir)/config.h $(incdir)/missing.h
128 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/closefrom.c
129 dlopen.lo: $(srcdir)/dlopen.c $(top_builddir)/config.h \
130 $(top_srcdir)/compat/dlfcn.h $(incdir)/missing.h
131 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/dlopen.c
132 fnm_test.o: $(srcdir)/regress/fnmatch/fnm_test.c $(top_builddir)/config.h \
133 $(top_srcdir)/compat/fnmatch.h
134 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/regress/fnmatch/fnm_test.c
135 fnmatch.lo: $(srcdir)/fnmatch.c $(top_builddir)/config.h $(incdir)/missing.h \
136 $(top_srcdir)/compat/charclass.h $(top_srcdir)/compat/fnmatch.h
137 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/fnmatch.c
138 getcwd.lo: $(srcdir)/getcwd.c $(top_builddir)/config.h $(incdir)/missing.h
139 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getcwd.c
140 getgrouplist.lo: $(srcdir)/getgrouplist.c $(top_builddir)/config.h \
142 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getgrouplist.c
143 getline.lo: $(srcdir)/getline.c $(top_builddir)/config.h $(incdir)/missing.h
144 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getline.c
145 getprogname.lo: $(srcdir)/getprogname.c $(top_builddir)/config.h \
147 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/getprogname.c
148 glob.lo: $(srcdir)/glob.c $(top_builddir)/config.h $(incdir)/missing.h \
149 $(top_srcdir)/compat/glob.h $(top_srcdir)/compat/charclass.h
150 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/glob.c
151 globtest.o: $(srcdir)/regress/glob/globtest.c $(top_builddir)/config.h \
152 $(top_srcdir)/compat/glob.h $(incdir)/missing.h
153 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/regress/glob/globtest.c
154 isblank.lo: $(srcdir)/isblank.c $(top_builddir)/config.h $(incdir)/missing.h
155 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/isblank.c
156 memrchr.lo: $(srcdir)/memrchr.c $(top_builddir)/config.h $(incdir)/missing.h
157 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/memrchr.c
158 mksiglist.lo: $(srcdir)/mksiglist.c $(top_builddir)/config.h \
159 $(incdir)/missing.h $(top_srcdir)/compat/mksiglist.h
160 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c
161 mktemp.lo: $(srcdir)/mktemp.c $(top_builddir)/config.h $(incdir)/missing.h
162 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mktemp.c
163 nanosleep.lo: $(srcdir)/nanosleep.c $(top_builddir)/config.h \
164 $(top_srcdir)/compat/timespec.h $(incdir)/missing.h
165 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/nanosleep.c
166 setenv.lo: $(srcdir)/setenv.c $(top_builddir)/config.h $(incdir)/missing.h
167 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/setenv.c
168 siglist.lo: siglist.c $(top_builddir)/config.h $(incdir)/missing.h
169 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) siglist.c
170 snprintf.lo: $(srcdir)/snprintf.c $(top_builddir)/config.h $(incdir)/missing.h
171 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/snprintf.c
172 strlcat.lo: $(srcdir)/strlcat.c $(top_builddir)/config.h $(incdir)/missing.h
173 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/strlcat.c
174 strlcpy.lo: $(srcdir)/strlcpy.c $(top_builddir)/config.h $(incdir)/missing.h
175 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/strlcpy.c
176 strsignal.lo: $(srcdir)/strsignal.c $(top_builddir)/config.h \
177 $(incdir)/missing.h $(incdir)/gettext.h
178 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/strsignal.c
179 unsetenv.lo: $(srcdir)/unsetenv.c $(top_builddir)/config.h $(incdir)/missing.h
180 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/unsetenv.c
181 utimes.lo: $(srcdir)/utimes.c $(top_builddir)/config.h \
182 $(top_srcdir)/compat/utime.h $(incdir)/missing.h
183 $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/utimes.c