1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
3 AUTOMAKE_OPTIONS = ../src/ansi2knr
5 noinst_LIBRARIES = libfetish.a
7 INCLUDES = -I.. -I$(srcdir) -I../intl
8 DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
10 ## Put relatively complex files at the beginning of the list so
11 ## that parallel compiles finish a tiny bit sooner. I don't see
12 ## a way to make regex.c appear earlier in the list, since it's
13 ## added by automake, but on systems with an up to date GNU libc,
14 ## regex.c isn't even compiled.
15 libfetish_a_SOURCES = \
19 getopt.c getopt.h getopt1.c \
23 argmatch.c argmatch.h \
24 backupfile.c backupfile.h \
28 closeout.c closeout.h \
33 filemode.c filemode.h \
44 hard-locale.c hard-locale.h \
49 linebuffer.c linebuffer.h \
51 long-options.c long-options.h \
52 makepath.c makepath.h \
53 mbswidth.c mbswidth.h \
55 memcasecmp.c memcasecmp.h \
57 modechange.c modechange.h \
60 path-concat.c path-concat.h \
64 quotearg.c quotearg.h \
65 readtokens.c readtokens.h \
68 safe-read.c safe-read.h \
70 save-cwd.c save-cwd.h \
76 unicodeio.c unicodeio.h \
79 version-etc.c version-etc.h \
91 libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
92 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
95 BUILT_SOURCES = getdate.c lstat.c stat.c unlocked-io.h
96 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
97 DISTCLEANFILES = lstat.c stat.c unlocked-io.h
99 EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin unlocked-io.hin
103 -e 's/@xstat@/lstat/g' \
104 -e '/_LSTAT_ONLY@/d' \
105 -e '/@BEGIN_STAT_ONLY@/,/@END_STAT_ONLY@/d' \
106 $(srcdir)/xstat.in > $@-t
112 -e 's/@xstat@/stat/g' \
113 -e '/_STAT_ONLY@/d' \
114 -e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
115 $(srcdir)/xstat.in > $@-t
119 # The following is needed in order to install a simple file in $(libdir)
120 # which is shared with other installed packages. We use a list of referencing
121 # packages so that "make uninstall" will remove the file if and only if it
122 # is not used by another installed package.
123 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
124 # avoid installing it.
126 all-local: charset.alias ref-add.sed ref-del.sed lstat.c stat.c unlocked-io.h
128 charset_alias = $(DESTDIR)$(libdir)/charset.alias
129 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
130 install-exec-local: all-local
131 $(mkinstalldirs) $(DESTDIR)$(libdir)
132 if test -f $(charset_alias); then \
133 sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
134 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
135 rm -f $(charset_tmp) ; \
137 if test @GLIBC21@ = no; then \
138 sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
139 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
140 rm -f $(charset_tmp) ; \
144 uninstall-local: all-local
145 if test -f $(charset_alias); then \
146 sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
147 if grep '^# Packages using this file: $$' $(charset_tmp) \
149 rm -f $(charset_alias); \
151 $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
153 rm -f $(charset_tmp); \
156 charset.alias: config.charset
157 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
162 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
165 CLEANFILES = charset.alias ref-add.sed ref-del.sed
167 ###############################################
169 # FIXME: CAUTION this list is a duplicate of one in ../Makefile.cfg.
171 clearerr feof ferror fflush fgets fputc fputs \
172 fread fwrite getc getchar putc putchar
174 a_z=abcdefghijklmnopqrstuvwxyz
175 A_Z=ABCDEFGHIJKLMNOPQRSTUVWXYZ
177 unlocked-io.h: $(srcdir)/unlocked-io.hin Makefile.am
179 for f in $(io_functions); do \
180 u=`echo $$f|tr $(a_z) $(A_Z)`; \
181 echo "# if HAVE_$${u}_UNLOCKED" ; \
182 echo "# undef $$f" ; \
183 echo "# define $$f(S) $${f}_unlocked (S)" ; \
186 sed '/^@replace_this@\$$/r '$$tmp $(srcdir)/unlocked-io.hin \
187 | sed '/^@replace_this@$$/d' \