(libfetish_a_SOURCES): Reflect name changes: chdir.[ch] -> chdir-long.[ch]
[platform/upstream/coreutils.git] / lib / Makefile.am
1 ## Makefile for gnulib/lib                              -*-Makefile-*-
2
3 # Copyright (C) 1995-2004 Free Software Foundation, Inc.
4
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
8 ## any later version.
9
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 ## 02111-1307, USA.
19
20 noinst_LIBRARIES = libfetish.a
21
22 AM_CPPFLAGS = -I.. -I$(srcdir)
23 DEFS += -DLIBDIR=\"$(libdir)\"
24
25 ## Put relatively complex files at the beginning of the list so
26 ## that parallel compiles finish a tiny bit sooner.  I don't see
27 ## a way to make regex.c appear earlier in the list, since it's
28 ## added by automake, but on systems with an up to date GNU libc,
29 ## regex.c isn't even compiled.
30 libfetish_a_SOURCES = \
31   acl.h acl.c \
32   getdate.h getdate.y \
33   posixtm.c posixtm.h \
34   posixver.c posixver.h \
35   strftime.c strftime.h \
36   hash.c hash.h \
37   hash-pjw.c hash-pjw.h \
38   __fpending.h \
39   allocsa.c allocsa.h \
40   argmatch.c argmatch.h \
41   backupfile.c backupfile.h \
42   basename.c \
43   c-strtod.c c-strtod.h c-strtold.c \
44   canon-host.c \
45   canonicalize.c canonicalize.h \
46   chdir-long.c chdir-long.h \
47   cloexec.c cloexec.h \
48   closeout.c closeout.h \
49   cycle-check.c cycle-check.h \
50   dev-ino.h \
51   diacrit.c diacrit.h \
52   dirname.c dirname.h \
53   dirfd.h \
54   dup-safer.c \
55   euidaccess.h \
56   exclude.c exclude.h \
57   exit.h \
58   exitfail.c exitfail.h \
59   fcntl-safer.h \
60   filemode.c filemode.h \
61   file-type.c file-type.h \
62   fopen-safer.c \
63   fsusage.h \
64   fts.c fts_.h \
65   full-read.c full-read.h \
66   full-write.c full-write.h \
67   getcwd.h \
68   getline.h \
69   getpagesize.h \
70   getpass.h \
71   gettime.c \
72   gettext.h \
73   getugroups.c \
74   group-member.h \
75   hard-locale.c hard-locale.h \
76   human.c human.h \
77   idcache.c \
78   imaxtostr.c \
79   lchown.h \
80   linebuffer.c linebuffer.h \
81   localcharset.c localcharset.h \
82   long-options.c long-options.h \
83   makepath.c makepath.h \
84   mbswidth.c mbswidth.h \
85   md5.c md5.h \
86   memcasecmp.c memcasecmp.h \
87   memcoll.c memcoll.h \
88   mempcpy.h \
89   modechange.c modechange.h \
90   mountlist.h \
91   offtostr.c \
92   openat.h \
93   open-safer.c \
94   path-concat.c path-concat.h \
95   pathmax.h \
96   physmem.c physmem.h \
97   quote.c quote.h \
98   quotearg.c quotearg.h \
99   readtokens0.c readtokens0.h \
100   readtokens.c readtokens.h \
101   readutmp.h \
102   regex.h \
103   root-dev-ino.c root-dev-ino.h \
104   safe-read.c safe-read.h \
105   safe-write.c safe-write.h \
106   same.c same.h \
107   save-cwd.c save-cwd.h \
108   savedir.c savedir.h \
109   setenv.h \
110   settime.c \
111   sha1.c sha1.h \
112   sig2str.h \
113   stat-macros.h \
114   stdio-safer.h \
115   stripslash.c \
116   strdup.h \
117   strndup.h \
118   strverscmp.h \
119   time_r.c time_r.h \
120   timespec.h \
121   umaxtostr.c \
122   unicodeio.c unicodeio.h \
123   unistd-safer.h \
124   unlocked-io.h \
125   userspec.c userspec.h \
126   utimecmp.c utimecmp.h \
127   utimens.c utimens.h \
128   version-etc.c version-etc.h \
129   xalloc.h \
130   xalloc-die.c \
131   xfts.c xfts.h \
132   xgetcwd.c xgetcwd.h \
133   xgethostname.c xgethostname.h \
134   xmalloc.c \
135   xmemcoll.c xmemcoll.h \
136   xnanosleep.c xnanosleep.h \
137   xreadlink.c xreadlink.h \
138   xstrndup.c xstrndup.h \
139   xstrtod.c xstrtod.h \
140   xstrtoimax.c \
141   xstrtol.c xstrtol.h \
142   xstrtoul.c \
143   xstrtoumax.c \
144   yesno.c yesno.h
145
146 libfetish_a_SOURCES += \
147   printf-args.h \
148   printf-parse.h \
149   vasprintf.h \
150   vasnprintf.h
151
152 libfetish_a_LIBADD = $(LIBOBJS) $(ALLOCA)
153 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
154
155 lib_OBJECTS = $(libfetish_a_OBJECTS)
156
157
158 BUILT_SOURCES = getdate.c
159 CLEANFILES =
160 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
161 MOSTLYCLEANFILES =
162 SUFFIXES =
163
164 EXTRA_DIST = config.charset ref-add.sin ref-del.sin \
165   getndelim2.c getndelim2.h \
166   inttostr.c inttostr.h
167
168 # We need the following in order to install a simple file in $(libdir)
169 # which is shared with other installed packages. We use a list of referencing
170 # packages so that "make uninstall" will remove the file if and only if it
171 # is not used by another installed package.
172 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
173 # avoid installing it.
174
175 all-local: charset.alias ref-add.sed ref-del.sed
176
177 charset_alias = $(DESTDIR)$(libdir)/charset.alias
178 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
179 install-exec-local: all-local
180         test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
181         if test -f $(charset_alias); then \
182           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
183           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
184           rm -f $(charset_tmp) ; \
185         else \
186           if test $(GLIBC21) = no; then \
187             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
188             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
189             rm -f $(charset_tmp) ; \
190           fi ; \
191         fi
192
193 uninstall-local: all-local
194         if test -f $(charset_alias); then \
195           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
196           if grep '^# Packages using this file: $$' $(charset_tmp) \
197               > /dev/null; then \
198             rm -f $(charset_alias); \
199           else \
200             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
201           fi; \
202           rm -f $(charset_tmp); \
203         fi
204
205 charset.alias: config.charset
206         $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
207         mv t-$@ $@
208
209 SUFFIXES += .sed .sin
210 .sin.sed:
211         sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
212         mv t-$@ $@
213
214 CLEANFILES += charset.alias ref-add.sed ref-del.sed
215
216 BUILT_SOURCES += $(STDBOOL_H)
217 EXTRA_DIST += stdbool_.h
218 MOSTLYCLEANFILES += stdbool.h stdbool.ht
219 # Create stdbool.h on systems that lack a working one.
220 stdbool.h: stdbool_.h
221         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' $(srcdir)/stdbool_.h > $@t
222         mv $@t $@
223
224 BUILT_SOURCES += $(ALLOCA_H)
225 EXTRA_DIST += alloca_.h
226
227 # We need the following in order to create an <alloca.h> when the system
228 # doesn't have one that works with the given compiler.
229 all-local $(lib_OBJECTS): $(ALLOCA_H)
230 alloca.h: alloca_.h
231         cp $(srcdir)/alloca_.h $@-t
232         mv $@-t $@
233 MOSTLYCLEANFILES += alloca.h alloca.h-t
234
235 BUILT_SOURCES += $(FNMATCH_H)
236 EXTRA_DIST += fnmatch_.h fnmatch_loop.c
237
238 # We need the following in order to create an <fnmatch.h> when the system
239 # doesn't have one that supports the required API.
240 all-local $(lib_OBJECTS): $(FNMATCH_H)
241 fnmatch.h: fnmatch_.h
242         cp $(srcdir)/fnmatch_.h $@-t
243         mv $@-t $@
244 MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
245
246 BUILT_SOURCES += $(GETOPT_H)
247 EXTRA_DIST += getopt_.h getopt_int.h
248
249 # We need the following in order to create an <getopt.h> when the system
250 # doesn't have one that works with the given compiler.
251 all-local $(lib_OBJECTS): $(GETOPT_H)
252 getopt.h: getopt_.h
253         cp $(srcdir)/getopt_.h $@-t
254         mv $@-t $@
255 MOSTLYCLEANFILES += getopt.h getopt.h-t