Reflect renaming: stdbool.hin -> stdbool_.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   bumpalloc.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   exitfail.c exitfail.h \
58   filemode.c filemode.h \
59   file-type.c file-type.h \
60   fnmatch_.h \
61   fopen-safer.c \
62   fsusage.h \
63   ftw_.h \
64   full-read.c full-read.h \
65   full-write.c full-write.h \
66   getdelim2.c getdelim2.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 \
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   readtokens.c readtokens.h \
96   readutmp.h \
97   regex.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   sha.c sha.h \
106   sig2str.h \
107   stdio-safer.h \
108   stripslash.c \
109   strverscmp.h \
110   timespec.h \
111   umaxtostr.c \
112   unicodeio.c unicodeio.h \
113   unistd-safer.h \
114   unlocked-io.h \
115   userspec.c \
116   version-etc.c version-etc.h \
117   xalloc.h \
118   xgetcwd.c xgetcwd.h \
119   xgethostname.c \
120   xmalloc.c \
121   xmemcoll.c xmemcoll.h \
122   xnanosleep.c xnanosleep.h \
123   xreadlink.c xreadlink.h \
124   xstrdup.c \
125   xstrndup.c xstrndup.h \
126   xstrtod.c xstrtod.h \
127   xstrtol.c xstrtol.h \
128   xstrtoul.c \
129   xstrtoimax.c \
130   xstrtoumax.c \
131   yesno.c
132
133 libfetish_a_SOURCES += \
134   printf-args.h \
135   printf-parse.h \
136   vasprintf.h \
137   vasnprintf.h
138
139 libfetish_a_LIBADD = $(LIBOBJS) $(ALLOCA)
140 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
141
142
143 BUILT_SOURCES = getdate.c
144 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
145 MOSTLYCLEANFILES =
146
147 EXTRA_DIST = config.charset ref-add.sin ref-del.sin \
148   fnmatch_loop.c inttostr.c inttostr.h
149
150 # The following is needed in order to install a simple file in $(libdir)
151 # which is shared with other installed packages. We use a list of referencing
152 # packages so that "make uninstall" will remove the file if and only if it
153 # is not used by another installed package.
154 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
155 # avoid installing it.
156
157 all-local: charset.alias ref-add.sed ref-del.sed
158
159 charset_alias = $(DESTDIR)$(libdir)/charset.alias
160 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
161 install-exec-local: all-local
162         $(mkinstalldirs) $(DESTDIR)$(libdir)
163         if test -f $(charset_alias); then \
164           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
165           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
166           rm -f $(charset_tmp) ; \
167         else \
168           if test @GLIBC21@ = no; then \
169             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
170             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
171             rm -f $(charset_tmp) ; \
172           fi ; \
173         fi
174
175 uninstall-local: all-local
176         if test -f $(charset_alias); then \
177           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
178           if grep '^# Packages using this file: $$' $(charset_tmp) \
179               > /dev/null; then \
180             rm -f $(charset_alias); \
181           else \
182             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
183           fi; \
184           rm -f $(charset_tmp); \
185         fi
186
187 charset.alias: config.charset
188         $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
189         mv t-$@ $@
190
191 BUILT_SOURCES += $(STDBOOL_H)
192 EXTRA_DIST += stdbool_.h
193 MOSTLYCLEANFILES += stdbool.h stdbool.ht
194 # Create stdbool.h on systems that lack a working one.
195 stdbool.h: stdbool_.h
196         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' $(srcdir)/stdbool_.h > $@t
197         mv $@t $@
198
199 BUILT_SOURCES += $(ALLOCA_H)
200 EXTRA_DIST += alloca_.h
201 MOSTLYCLEANFILES += alloca.h alloca.ht
202 # Create an <alloca.h> when the system
203 # doesn't have one that works with the given compiler.
204 alloca.h: alloca_.h
205         cp $(srcdir)/alloca_.h $@t
206         mv $@t $@
207
208 SUFFIXES = .sed .sin
209 .sin.sed:
210         sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
211         mv t-$@ $@
212
213 CLEANFILES = charset.alias ref-add.sed ref-del.sed
214 DISTCLEANFILES = ftw.h search.h fnmatch.h