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