(libfetish_a_SOURCES): Add fnmatch_.h in place of fnmatch.h.
[gnulib.git] / lib / Makefile.am
1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
2
3 AUTOMAKE_OPTIONS = ../src/ansi2knr
4
5 noinst_LIBRARIES = libfetish.a
6
7 INCLUDES = -I.. -I$(srcdir)
8 DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
9
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 = \
16   acl.h acl.c \
17   getdate.h getdate.y \
18   posixtm.c posixtm.h \
19   posixver.c posixver.h \
20   strftime.c \
21   getopt.c getopt.h getopt1.c \
22   hash.c hash.h \
23   hash-pjw.c hash-pjw.h \
24   __fpending.h \
25   addext.c \
26   argmatch.c argmatch.h \
27   backupfile.c backupfile.h \
28   basename.c \
29   bumpalloc.h \
30   canon-host.c \
31   closeout.c closeout.h \
32   diacrit.c diacrit.h \
33   dirname.c dirname.h \
34   dirfd.h \
35   dup-safer.c \
36   exclude.c exclude.h \
37   filemode.c filemode.h \
38   file-type.c file-type.h \
39   fnmatch_.h \
40   fopen-safer.c \
41   fsusage.h \
42   full-write.c full-write.h \
43   getline.h \
44   getpagesize.h \
45   getstr.c getstr.h \
46   gettime.c \
47   gettext.h \
48   getugroups.c \
49   group-member.h \
50   hard-locale.c hard-locale.h \
51   human.c human.h \
52   idcache.c \
53   isdir.c \
54   lchown.h \
55   linebuffer.c linebuffer.h \
56   localcharset.c \
57   long-options.c long-options.h \
58   makepath.c makepath.h \
59   mbswidth.c mbswidth.h \
60   md5.c md5.h \
61   memcasecmp.c memcasecmp.h \
62   memcoll.c memcoll.h \
63   modechange.c modechange.h \
64   mountlist.h \
65   path-concat.c path-concat.h \
66   pathmax.h \
67   physmem.c physmem.h \
68   quote.c quote.h \
69   quotearg.c quotearg.h \
70   readtokens.c readtokens.h \
71   readutmp.h \
72   regex.h \
73   safe-read.c safe-read.h \
74   same.c same.h \
75   save-cwd.c save-cwd.h \
76   savedir.c savedir.h \
77   settime.c \
78   sha.c sha.h \
79   sig2str.h \
80   stdio-safer.h \
81   stripslash.c \
82   strverscmp.h \
83   timespec.h \
84   unicodeio.c unicodeio.h \
85   unistd-safer.h \
86   userspec.c \
87   version-etc.c version-etc.h \
88   xalloc.h \
89   xgetcwd.c \
90   xgethostname.c \
91   xmalloc.c \
92   xmemcoll.c xmemcoll.h \
93   xreadlink.c xreadlink.h \
94   xstrdup.c \
95   xstrtod.c xstrtod.h \
96   xstrtol.c xstrtol.h \
97   xstrtoul.c \
98   xstrtoimax.c \
99   xstrtoumax.c \
100   yesno.c
101
102 libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
103 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
104
105
106 BUILT_SOURCES = getdate.c lstat.c stat.c unlocked-io.h
107 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
108 DISTCLEANFILES = lstat.c stat.c unlocked-io.h
109
110 EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin gen-uio \
111   fnmatch_loop.c
112
113 lstat.c: xstat.in
114         sed \
115           -e '/@IGNORE@/d' \
116           -e 's/@xstat@/lstat/g' \
117           -e '/_LSTAT_ONLY@/d' \
118           -e '/@BEGIN_STAT_ONLY@/,/@END_STAT_ONLY@/d' \
119           $(srcdir)/xstat.in > t-$@
120         mv t-$@ $@
121
122 stat.c: xstat.in
123         sed \
124           -e '/@IGNORE@/d' \
125           -e 's/@xstat@/stat/g' \
126           -e '/_STAT_ONLY@/d' \
127           -e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
128           $(srcdir)/xstat.in > t-$@
129         mv t-$@ $@
130
131 # The following is needed in order to install a simple file in $(libdir)
132 # which is shared with other installed packages. We use a list of referencing
133 # packages so that "make uninstall" will remove the file if and only if it
134 # is not used by another installed package.
135 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
136 # avoid installing it.
137
138 all-local: charset.alias ref-add.sed ref-del.sed lstat.c stat.c unlocked-io.h
139
140 charset_alias = $(DESTDIR)$(libdir)/charset.alias
141 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
142 install-exec-local: all-local
143         $(mkinstalldirs) $(DESTDIR)$(libdir)
144         if test -f $(charset_alias); then \
145           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
146           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
147           rm -f $(charset_tmp) ; \
148         else \
149           if test @GLIBC21@ = no; then \
150             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
151             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
152             rm -f $(charset_tmp) ; \
153           fi ; \
154         fi
155
156 uninstall-local: all-local
157         if test -f $(charset_alias); then \
158           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
159           if grep '^# Packages using this file: $$' $(charset_tmp) \
160               > /dev/null; then \
161             rm -f $(charset_alias); \
162           else \
163             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
164           fi; \
165           rm -f $(charset_tmp); \
166         fi
167
168 charset.alias: config.charset
169         $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
170         mv t-$@ $@
171
172 SUFFIXES = .sed .sin
173 .sin.sed:
174         sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
175         mv t-$@ $@
176
177 CLEANFILES = charset.alias ref-add.sed ref-del.sed
178
179 ###############################################
180
181 # FIXME: remove this dependency once automake handles it.
182 # As of cvs automake of about 2002-01-13,
183 # this dependency is necessary to avoid a build failure
184 # when running `make check' before running `make all'.
185 # Otherwise, unlocked-io.h is not built before it's needed.
186 getdate$U.o: unlocked-io.h
187
188 # FIXME: CAUTION this list is a duplicate of one in ../Makefile.cfg.
189 io_functions = \
190   clearerr feof ferror fflush fgets fputc fputs \
191   fread fwrite getc getchar putc putchar
192
193 unlocked-io.h: $(srcdir)/gen-uio Makefile.am
194         srcdir=$(srcdir) $(SHELL) $(srcdir)/gen-uio $(io_functions) > $@t
195         mv $@t $@