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