(libfetish_a_SOURCES): Add mmap-stack.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 AUTOMAKE_OPTIONS = ../src/ansi2knr
22
23 noinst_LIBRARIES = libfetish.a
24
25 INCLUDES = -I.. -I$(srcdir)
26 DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
27
28 ## Put relatively complex files at the beginning of the list so
29 ## that parallel compiles finish a tiny bit sooner.  I don't see
30 ## a way to make regex.c appear earlier in the list, since it's
31 ## added by automake, but on systems with an up to date GNU libc,
32 ## regex.c isn't even compiled.
33 libfetish_a_SOURCES = \
34   acl.h acl.c \
35   getdate.h getdate.y \
36   posixtm.c posixtm.h \
37   posixver.c posixver.h \
38   strftime.c strftime.h \
39   getopt.c getopt.h getopt1.c \
40   hash.c hash.h \
41   hash-pjw.c hash-pjw.h \
42   __fpending.h \
43   addext.c \
44   argmatch.c argmatch.h \
45   backupfile.c backupfile.h \
46   basename.c \
47   bumpalloc.h \
48   canon-host.c \
49   c-stack.c c-stack.h \
50   canonicalize.h \
51   closeout.c closeout.h \
52   cycle-check.c cycle-check.h \
53   dev-ino.h \
54   diacrit.c diacrit.h \
55   dirname.c dirname.h \
56   dirfd.h \
57   dup-safer.c \
58   euidaccess.h \
59   exclude.c exclude.h \
60   exitfail.c exitfail.h \
61   filemode.c filemode.h \
62   file-type.c file-type.h \
63   fnmatch_.h \
64   fopen-safer.c \
65   fsusage.h \
66   ftw_.h \
67   full-read.c full-read.h \
68   full-write.c full-write.h \
69   getline.h \
70   getpagesize.h \
71   getstr.c getstr.h \
72   gettime.c \
73   gettext.h \
74   getugroups.c \
75   group-member.h \
76   hard-locale.c hard-locale.h \
77   human.c human.h \
78   idcache.c \
79   isdir.c \
80   imaxtostr.c \
81   lchown.h \
82   linebuffer.c linebuffer.h \
83   localcharset.c \
84   long-options.c long-options.h \
85   makepath.c makepath.h \
86   mbswidth.c mbswidth.h \
87   md5.c md5.h \
88   memcasecmp.c memcasecmp.h \
89   memcoll.c memcoll.h \
90   mmap-stack.h \
91   modechange.c modechange.h \
92   mountlist.h \
93   offtostr.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   readtokens.c readtokens.h \
100   readutmp.h \
101   regex.h \
102   safe-read.c safe-read.h \
103   safe-write.c safe-write.h \
104   same.c same.h \
105   save-cwd.c save-cwd.h \
106   savedir.c savedir.h \
107   search_.h \
108   settime.c \
109   sha.c sha.h \
110   sig2str.h \
111   stdio-safer.h \
112   stripslash.c \
113   strverscmp.h \
114   timespec.h \
115   umaxtostr.c \
116   unicodeio.c unicodeio.h \
117   unistd-safer.h \
118   unlocked-io.h \
119   userspec.c \
120   version-etc.c version-etc.h \
121   xalloc.h \
122   xgetcwd.c xgetcwd.h \
123   xgethostname.c \
124   xmalloc.c \
125   xmemcoll.c xmemcoll.h \
126   xnanosleep.c xnanosleep.h \
127   xreadlink.c xreadlink.h \
128   xstrdup.c \
129   xstrtod.c xstrtod.h \
130   xstrtol.c xstrtol.h \
131   xstrtoul.c \
132   xstrtoimax.c \
133   xstrtoumax.c \
134   yesno.c
135
136 libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
137 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
138
139
140 BUILT_SOURCES = getdate.c
141 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
142
143 EXTRA_DIST = config.charset ref-add.sin ref-del.sin \
144   fnmatch_loop.c inttostr.c inttostr.h
145
146 # The following is needed in order to install a simple file in $(libdir)
147 # which is shared with other installed packages. We use a list of referencing
148 # packages so that "make uninstall" will remove the file if and only if it
149 # is not used by another installed package.
150 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
151 # avoid installing it.
152
153 all-local: charset.alias ref-add.sed ref-del.sed
154
155 charset_alias = $(DESTDIR)$(libdir)/charset.alias
156 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
157 install-exec-local: all-local
158         $(mkinstalldirs) $(DESTDIR)$(libdir)
159         if test -f $(charset_alias); then \
160           sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
161           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
162           rm -f $(charset_tmp) ; \
163         else \
164           if test @GLIBC21@ = no; then \
165             sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
166             $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
167             rm -f $(charset_tmp) ; \
168           fi ; \
169         fi
170
171 uninstall-local: all-local
172         if test -f $(charset_alias); then \
173           sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
174           if grep '^# Packages using this file: $$' $(charset_tmp) \
175               > /dev/null; then \
176             rm -f $(charset_alias); \
177           else \
178             $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
179           fi; \
180           rm -f $(charset_tmp); \
181         fi
182
183 charset.alias: config.charset
184         $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
185         mv t-$@ $@
186
187 SUFFIXES = .sed .sin
188 .sin.sed:
189         sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
190         mv t-$@ $@
191
192 CLEANFILES = charset.alias ref-add.sed ref-del.sed ftw.h search.h