1 ## Makefile for gnulib/lib -*-Makefile-*-
3 # Copyright (C) 1995-2004 Free Software Foundation, Inc.
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 noinst_LIBRARIES = libfetish.a
22 AM_CPPFLAGS = -I.. -I$(srcdir)
23 DEFS += -DLIBDIR=\"$(libdir)\"
25 ## Put relatively complex files at the beginning of the list so
26 ## that parallel compiles finish a tiny bit sooner. I don't see
27 ## a way to make regex.c appear earlier in the list, since it's
28 ## added by automake, but on systems with an up to date GNU libc,
29 ## regex.c isn't even compiled.
30 libfetish_a_SOURCES = \
34 posixver.c posixver.h \
35 strftime.c strftime.h \
36 getopt.c getopt.h getopt1.c getopt_int.h \
38 hash-pjw.c hash-pjw.h \
42 argmatch.c argmatch.h \
43 backupfile.c backupfile.h \
45 c-strtod.c c-strtod.h \
49 closeout.c closeout.h \
50 cycle-check.c cycle-check.h \
59 exitfail.c exitfail.h \
60 filemode.c filemode.h \
61 file-type.c file-type.h \
65 full-read.c full-read.h \
66 full-write.c full-write.h \
73 hard-locale.c hard-locale.h \
79 linebuffer.c linebuffer.h \
80 localcharset.c localcharset.h \
81 long-options.c long-options.h \
82 makepath.c makepath.h \
83 mbswidth.c mbswidth.h \
85 memcasecmp.c memcasecmp.h \
87 modechange.c modechange.h \
90 path-concat.c path-concat.h \
94 quotearg.c quotearg.h \
95 readtokens0.c readtokens0.h \
96 readtokens.c readtokens.h \
99 root-dev-ino.c root-dev-ino.h \
100 safe-read.c safe-read.h \
101 safe-write.c safe-write.h \
103 save-cwd.c save-cwd.h \
104 savedir.c savedir.h \
117 unicodeio.c unicodeio.h \
120 userspec.c userspec.h \
121 utimens.c utimens.h \
122 version-etc.c version-etc.h \
125 xgetcwd.c xgetcwd.h \
126 xgethostname.c xgethostname.h \
128 xmemcoll.c xmemcoll.h \
129 xnanosleep.c xnanosleep.h \
130 xreadlink.c xreadlink.h \
132 xstrndup.c xstrndup.h \
133 xstrtod.c xstrtod.h \
135 xstrtol.c xstrtol.h \
140 libfetish_a_SOURCES += \
146 libfetish_a_LIBADD = $(LIBOBJS) $(ALLOCA)
147 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
149 lib_OBJECTS = $(libfetish_a_OBJECTS)
152 BUILT_SOURCES = getdate.c
154 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
158 EXTRA_DIST = config.charset ref-add.sin ref-del.sin \
159 getndelim2.c getndelim2.h \
160 inttostr.c inttostr.h
162 # We need the following in order to install a simple file in $(libdir)
163 # which is shared with other installed packages. We use a list of referencing
164 # packages so that "make uninstall" will remove the file if and only if it
165 # is not used by another installed package.
166 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
167 # avoid installing it.
169 all-local: charset.alias ref-add.sed ref-del.sed
171 charset_alias = $(DESTDIR)$(libdir)/charset.alias
172 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
173 install-exec-local: all-local
174 test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
175 if test -f $(charset_alias); then \
176 sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
177 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
178 rm -f $(charset_tmp) ; \
180 if test $(GLIBC21) = no; then \
181 sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
182 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
183 rm -f $(charset_tmp) ; \
187 uninstall-local: all-local
188 if test -f $(charset_alias); then \
189 sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
190 if grep '^# Packages using this file: $$' $(charset_tmp) \
192 rm -f $(charset_alias); \
194 $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
196 rm -f $(charset_tmp); \
199 charset.alias: config.charset
200 $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
203 SUFFIXES += .sed .sin
205 sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
208 CLEANFILES += charset.alias ref-add.sed ref-del.sed
210 BUILT_SOURCES += $(STDBOOL_H)
211 EXTRA_DIST += stdbool_.h
212 MOSTLYCLEANFILES += stdbool.h stdbool.ht
213 # Create stdbool.h on systems that lack a working one.
214 stdbool.h: stdbool_.h
215 sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' $(srcdir)/stdbool_.h > $@t
218 BUILT_SOURCES += $(ALLOCA_H)
219 EXTRA_DIST += alloca_.h
221 # We need the following in order to create an <alloca.h> when the system
222 # doesn't have one that works with the given compiler.
223 all-local $(lib_OBJECTS): $(ALLOCA_H)
225 cp $(srcdir)/alloca_.h $@-t
227 MOSTLYCLEANFILES += alloca.h alloca.h-t
229 BUILT_SOURCES += $(FNMATCH_H)
230 EXTRA_DIST += fnmatch_.h fnmatch_loop.c
232 # We need the following in order to create an <fnmatch.h> when the system
233 # doesn't have one that supports the required API.
234 all-local $(lib_OBJECTS): $(FNMATCH_H)
235 fnmatch.h: fnmatch_.h
236 cp $(srcdir)/fnmatch_.h $@-t
238 MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t