1 ## Makefile for gnulib/lib -*-Makefile-*-
3 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 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 noinst_LIBRARIES = libfetish.a
23 INCLUDES = -I.. -I$(srcdir)
24 DEFS += -DLIBDIR=\"$(libdir)\"
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 = \
35 posixver.c posixver.h \
36 strftime.c strftime.h \
37 getopt.c getopt.h getopt1.c \
39 hash-pjw.c hash-pjw.h \
42 argmatch.c argmatch.h \
43 backupfile.c backupfile.h \
48 closeout.c closeout.h \
49 cycle-check.c cycle-check.h \
57 exitfail.c exitfail.h \
58 filemode.c filemode.h \
59 file-type.c file-type.h \
64 full-read.c full-read.h \
65 full-write.c full-write.h \
66 getdelim2.c getdelim2.h \
73 hard-locale.c hard-locale.h \
79 linebuffer.c linebuffer.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 readtokens.c readtokens.h \
98 safe-read.c safe-read.h \
99 safe-write.c safe-write.h \
101 save-cwd.c save-cwd.h \
102 savedir.c savedir.h \
112 unicodeio.c unicodeio.h \
116 version-etc.c version-etc.h \
118 xgetcwd.c xgetcwd.h \
121 xmemcoll.c xmemcoll.h \
122 xnanosleep.c xnanosleep.h \
123 xreadlink.c xreadlink.h \
125 xstrtod.c xstrtod.h \
126 xstrtol.c xstrtol.h \
132 libfetish_a_SOURCES += \
138 libfetish_a_LIBADD = $(LIBOBJS) $(ALLOCA)
139 libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
142 BUILT_SOURCES = getdate.c
143 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
146 EXTRA_DIST = config.charset ref-add.sin ref-del.sin \
147 fnmatch_loop.c inttostr.c inttostr.h
149 # The following is needed in order to install a simple file in $(libdir)
150 # which is shared with other installed packages. We use a list of referencing
151 # packages so that "make uninstall" will remove the file if and only if it
152 # is not used by another installed package.
153 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
154 # avoid installing it.
156 all-local: charset.alias ref-add.sed ref-del.sed
158 charset_alias = $(DESTDIR)$(libdir)/charset.alias
159 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
160 install-exec-local: all-local
161 $(mkinstalldirs) $(DESTDIR)$(libdir)
162 if test -f $(charset_alias); then \
163 sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
164 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
165 rm -f $(charset_tmp) ; \
167 if test @GLIBC21@ = no; then \
168 sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
169 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
170 rm -f $(charset_tmp) ; \
174 uninstall-local: all-local
175 if test -f $(charset_alias); then \
176 sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
177 if grep '^# Packages using this file: $$' $(charset_tmp) \
179 rm -f $(charset_alias); \
181 $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
183 rm -f $(charset_tmp); \
186 charset.alias: config.charset
187 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
190 EXTRA_DIST += stdbool.hin
191 MOSTLYCLEANFILES += stdbool.h stdbool.ht
192 # Create stdbool.h on systems that lack a working one.
193 all-local $(lib_OBJECTS): $(STDBOOL_H)
194 stdbool.h: stdbool.hin
195 sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' $(srcdir)/stdbool.hin > $@t
198 EXTRA_DIST += alloca_.h
199 MOSTLYCLEANFILES += alloca.h alloca.ht
200 # Create an <alloca.h> when the system
201 # doesn't have one that works with the given compiler.
202 all-local $(lib_OBJECTS): $(ALLOCA_H)
204 cp $(srcdir)/alloca_.h $@t
209 sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
212 CLEANFILES = charset.alias ref-add.sed ref-del.sed
213 DISTCLEANFILES = ftw.h search.h fnmatch.h