(libfetish_a_SOURCES): Add canonicalize.c unconditionally.
[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   getopt.c getopt.h getopt1.c getopt_int.h \
37   hash.c hash.h \
38   hash-pjw.c hash-pjw.h \
39   __fpending.h \
40   addext.c \
41   allocsa.c allocsa.h \
42   argmatch.c argmatch.h \
43   backupfile.c backupfile.h \
44   basename.c \
45   c-strtod.c c-strtod.h \
46   canon-host.c \
47   canonicalize.c canonicalize.h \
48   cloexec.c cloexec.h \
49   closeout.c closeout.h \
50   cycle-check.c cycle-check.h \
51   dev-ino.h \
52   diacrit.c diacrit.h \
53   dirname.c dirname.h \
54   dirfd.h \
55   dup-safer.c \
56   euidaccess.h \
57   exclude.c exclude.h \
58   exit.h \
59   exitfail.c exitfail.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   getline.h \
68   getpagesize.h \
69   gettime.c \
70   gettext.h \
71   getugroups.c \
72   group-member.h \
73   hard-locale.c hard-locale.h \
74   human.c human.h \
75   idcache.c \
76   isdir.c \
77   imaxtostr.c \
78   lchown.h \
79   linebuffer.c linebuffer.h \
80   localcharset.c localcharset.h \
81   long-options.c long-options.h \
82   makepath.c makepath.h \
83   mbswidth.c mbswidth.h \
84   md5.c md5.h \
85   memcasecmp.c memcasecmp.h \
86   memcoll.c memcoll.h \
87   modechange.c modechange.h \
88   mountlist.h \
89   offtostr.c \
90   path-concat.c path-concat.h \
91   pathmax.h \
92   physmem.c physmem.h \
93   quote.c quote.h \
94   quotearg.c quotearg.h \
95   readtokens0.c readtokens0.h \
96   readtokens.c readtokens.h \
97   readutmp.h \
98   regex.h \
99   root-dev-ino.c root-dev-ino.h \
100   safe-read.c safe-read.h \
101   safe-write.c safe-write.h \
102   same.c same.h \
103   save-cwd.c save-cwd.h \
104   savedir.c savedir.h \
105   settime.c \
106   sha1.c sha1.h \
107   sig2str.h \
108   stat-macros.h \
109   stdio-safer.h \
110   stripslash.c \
111   strdup.h \
112   strndup.h \
113   strverscmp.h \
114   time_r.c time_r.h \
115   timespec.h \
116   umaxtostr.c \
117   unicodeio.c unicodeio.h \
118   unistd-safer.h \
119   unlocked-io.h \
120   userspec.c userspec.h \
121   utimecmp.c utimecmp.h \
122   utimens.c utimens.h \
123   version-etc.c version-etc.h \
124   xalloc.h \
125   xfts.c xfts.h \
126   xgetcwd.c xgetcwd.h \
127   xgethostname.c xgethostname.h \
128   xmalloc.c \
129   xmemcoll.c xmemcoll.h \
130   xnanosleep.c xnanosleep.h \
131   xreadlink.c xreadlink.h \
132   xstrdup.c  \
133   xstrndup.c xstrndup.h \
134   xstrtod.c xstrtod.h \
135   xstrtoimax.c \
136   xstrtol.c xstrtol.h \
137   xstrtoul.c \
138   xstrtoumax.c \
139   yesno.c yesno.h
140
141 libfetish_a_SOURCES += \
142   printf-args.h \
143   printf-parse.h \
144   vasprintf.h \
145   vasnprintf.h
146
147 libfetish_a_LIBADD = $(LIBOBJS) $(ALLOCA)
148 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
149
150 lib_OBJECTS = $(libfetish_a_OBJECTS)
151
152
153 BUILT_SOURCES = getdate.c
154 CLEANFILES =
155 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
156 MOSTLYCLEANFILES =
157 SUFFIXES =
158
159 EXTRA_DIST = config.charset ref-add.sin ref-del.sin \
160   getndelim2.c getndelim2.h \
161   inttostr.c inttostr.h
162
163 # We need the following in order to install a simple file in $(libdir)
164 # which is shared with other installed packages. We use a list of referencing
165 # packages so that "make uninstall" will remove the file if and only if it
166 # is not used by another installed package.
167 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
168 # avoid installing it.
169
170 all-local: charset.alias ref-add.sed ref-del.sed
171
172 charset_alias = $(DESTDIR)$(libdir)/charset.alias
173 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
174 install-exec-local: all-local
175         test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
176         if test -f $(charset_alias); then \
177           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
178           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
179           rm -f $(charset_tmp) ; \
180         else \
181           if test $(GLIBC21) = no; then \
182             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
183             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
184             rm -f $(charset_tmp) ; \
185           fi ; \
186         fi
187
188 uninstall-local: all-local
189         if test -f $(charset_alias); then \
190           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
191           if grep '^# Packages using this file: $$' $(charset_tmp) \
192               > /dev/null; then \
193             rm -f $(charset_alias); \
194           else \
195             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
196           fi; \
197           rm -f $(charset_tmp); \
198         fi
199
200 charset.alias: config.charset
201         $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
202         mv t-$@ $@
203
204 SUFFIXES += .sed .sin
205 .sin.sed:
206         sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
207         mv t-$@ $@
208
209 CLEANFILES += charset.alias ref-add.sed ref-del.sed
210
211 BUILT_SOURCES += $(STDBOOL_H)
212 EXTRA_DIST += stdbool_.h
213 MOSTLYCLEANFILES += stdbool.h stdbool.ht
214 # Create stdbool.h on systems that lack a working one.
215 stdbool.h: stdbool_.h
216         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' $(srcdir)/stdbool_.h > $@t
217         mv $@t $@
218
219 BUILT_SOURCES += $(ALLOCA_H)
220 EXTRA_DIST += alloca_.h
221
222 # We need the following in order to create an <alloca.h> when the system
223 # doesn't have one that works with the given compiler.
224 all-local $(lib_OBJECTS): $(ALLOCA_H)
225 alloca.h: alloca_.h
226         cp $(srcdir)/alloca_.h $@-t
227         mv $@-t $@
228 MOSTLYCLEANFILES += alloca.h alloca.h-t
229
230 BUILT_SOURCES += $(FNMATCH_H)
231 EXTRA_DIST += fnmatch_.h fnmatch_loop.c
232
233 # We need the following in order to create an <fnmatch.h> when the system
234 # doesn't have one that supports the required API.
235 all-local $(lib_OBJECTS): $(FNMATCH_H)
236 fnmatch.h: fnmatch_.h
237         cp $(srcdir)/fnmatch_.h $@-t
238         mv $@-t $@
239 MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t