1 ## Makefile for gnulib/lib -*-Makefile-*-
3 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free
4 # Software Foundation, Inc.
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)
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.
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
21 AUTOMAKE_OPTIONS = ../src/ansi2knr
23 noinst_LIBRARIES = libfetish.a
25 INCLUDES = -I.. -I$(srcdir)
26 DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
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 = \
37 posixver.c posixver.h \
39 getopt.c getopt.h getopt1.c \
41 hash-pjw.c hash-pjw.h \
44 argmatch.c argmatch.h \
45 backupfile.c backupfile.h \
50 closeout.c closeout.h \
56 exitfail.c exitfail.h \
57 filemode.c filemode.h \
58 file-type.c file-type.h \
62 full-write.c full-write.h \
70 hard-locale.c hard-locale.h \
76 linebuffer.c linebuffer.h \
78 long-options.c long-options.h \
79 makepath.c makepath.h \
80 mbswidth.c mbswidth.h \
82 memcasecmp.c memcasecmp.h \
84 modechange.c modechange.h \
87 path-concat.c path-concat.h \
91 quotearg.c quotearg.h \
92 readtokens.c readtokens.h \
95 safe-read.c safe-read.h \
96 safe-write.c safe-write.h \
98 save-cwd.c save-cwd.h \
108 unicodeio.c unicodeio.h \
112 version-etc.c version-etc.h \
117 xmemcoll.c xmemcoll.h \
118 xnanosleep.c xnanosleep.h \
119 xreadlink.c xreadlink.h \
121 xstrtod.c xstrtod.h \
122 xstrtol.c xstrtol.h \
128 libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
129 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
132 BUILT_SOURCES = getdate.c
133 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
135 EXTRA_DIST = config.charset ref-add.sin ref-del.sin \
136 fnmatch_loop.c inttostr.c inttostr.h
138 # The following is needed in order to install a simple file in $(libdir)
139 # which is shared with other installed packages. We use a list of referencing
140 # packages so that "make uninstall" will remove the file if and only if it
141 # is not used by another installed package.
142 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
143 # avoid installing it.
145 all-local: charset.alias ref-add.sed ref-del.sed
147 charset_alias = $(DESTDIR)$(libdir)/charset.alias
148 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
149 install-exec-local: all-local
150 $(mkinstalldirs) $(DESTDIR)$(libdir)
151 if test -f $(charset_alias); then \
152 sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
153 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
154 rm -f $(charset_tmp) ; \
156 if test @GLIBC21@ = no; then \
157 sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
158 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
159 rm -f $(charset_tmp) ; \
163 uninstall-local: all-local
164 if test -f $(charset_alias); then \
165 sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
166 if grep '^# Packages using this file: $$' $(charset_tmp) \
168 rm -f $(charset_alias); \
170 $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
172 rm -f $(charset_tmp); \
175 charset.alias: config.charset
176 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
181 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
184 CLEANFILES = charset.alias ref-add.sed ref-del.sed