2002-12-06 13:38:15 +00:00
|
|
|
## Makefile for gnulib/lib -*-Makefile-*-
|
|
|
|
|
|
2006-02-27 10:49:40 +00:00
|
|
|
# Copyright (C) 1995-2006 Free Software Foundation, Inc.
|
2002-12-06 13:38:15 +00:00
|
|
|
|
|
|
|
|
## This program is free software; you can redistribute it and/or modify
|
|
|
|
|
## it under the terms of the GNU General Public License as published by
|
|
|
|
|
## the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
## any later version.
|
|
|
|
|
|
|
|
|
|
## This program is distributed in the hope that it will be useful,
|
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
## GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
## You should have received a copy of the GNU General Public License
|
|
|
|
|
## along with this program; if not, write to the Free Software
|
2005-05-14 07:58:06 +00:00
|
|
|
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
|
## 02110-1301, USA.
|
1997-11-19 15:04:15 +00:00
|
|
|
|
2005-12-14 20:37:06 +00:00
|
|
|
AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
|
|
|
|
|
|
2005-04-18 23:30:41 +00:00
|
|
|
noinst_LIBRARIES = libcoreutils.a
|
2004-12-05 20:02:23 +00:00
|
|
|
|
2004-12-05 19:37:49 +00:00
|
|
|
noinst_PROGRAMS = t-fpending
|
2004-12-05 20:02:23 +00:00
|
|
|
LDADD = $(noinst_LIBRARIES)
|
1995-12-08 20:18:40 +00:00
|
|
|
|
2003-07-16 06:33:39 +00:00
|
|
|
AM_CPPFLAGS = -I.. -I$(srcdir)
|
2003-04-05 16:52:48 +00:00
|
|
|
DEFS += -DLIBDIR=\"$(libdir)\"
|
1995-12-08 20:18:40 +00:00
|
|
|
|
2005-04-18 23:30:41 +00:00
|
|
|
libcoreutils_a_SOURCES = \
|
2004-04-02 22:20:06 +00:00
|
|
|
allocsa.c allocsa.h \
|
2006-02-27 10:49:40 +00:00
|
|
|
base64.c base64.h \
|
2005-11-24 06:48:55 +00:00
|
|
|
buffer-lcm.c buffer-lcm.h \
|
2003-02-10 23:01:53 +00:00
|
|
|
euidaccess.h \
|
2003-09-13 22:03:45 +00:00
|
|
|
exit.h \
|
2003-01-06 13:14:55 +00:00
|
|
|
full-read.c full-read.h \
|
2001-08-31 07:34:13 +00:00
|
|
|
full-write.c full-write.h \
|
2005-09-22 06:58:56 +00:00
|
|
|
getaddrinfo.h \
|
2002-04-24 07:52:39 +00:00
|
|
|
gettext.h \
|
2003-08-18 07:51:29 +00:00
|
|
|
localcharset.c localcharset.h \
|
2005-09-24 23:14:04 +00:00
|
|
|
mbchar.h \
|
2001-07-05 07:58:06 +00:00
|
|
|
mbswidth.c mbswidth.h \
|
2005-09-22 06:58:56 +00:00
|
|
|
mbuiter.h \
|
2004-03-22 20:00:44 +00:00
|
|
|
readtokens0.c readtokens0.h \
|
2005-09-22 06:58:56 +00:00
|
|
|
strcase.h \
|
|
|
|
|
strnlen1.c strnlen1.h \
|
|
|
|
|
strstr.h \
|
2001-07-05 07:58:06 +00:00
|
|
|
unicodeio.c unicodeio.h \
|
2005-07-04 16:09:03 +00:00
|
|
|
verify.h \
|
2004-08-09 18:44:46 +00:00
|
|
|
xalloc-die.c \
|
2003-10-16 06:27:37 +00:00
|
|
|
xgethostname.c xgethostname.h \
|
2002-01-22 08:03:54 +00:00
|
|
|
xmemcoll.c xmemcoll.h \
|
2003-07-23 06:00:50 +00:00
|
|
|
xstrndup.c xstrndup.h \
|
2003-10-08 17:55:02 +00:00
|
|
|
xstrtoimax.c \
|
2005-01-29 00:20:50 +00:00
|
|
|
xstrtoumax.c
|
1996-02-01 03:43:49 +00:00
|
|
|
|
2005-04-18 23:30:41 +00:00
|
|
|
libcoreutils_a_SOURCES += \
|
2003-07-10 11:07:22 +00:00
|
|
|
printf-args.h \
|
|
|
|
|
printf-parse.h \
|
|
|
|
|
vasprintf.h \
|
|
|
|
|
vasnprintf.h
|
|
|
|
|
|
2005-04-18 23:30:41 +00:00
|
|
|
libcoreutils_a_LIBADD = $(LIBOBJS) $(ALLOCA)
|
1995-12-08 20:18:40 +00:00
|
|
|
|
2005-04-18 23:30:41 +00:00
|
|
|
lib_OBJECTS = $(libcoreutils_a_OBJECTS)
|
2003-08-09 09:58:30 +00:00
|
|
|
|
1995-12-08 20:18:40 +00:00
|
|
|
|
2002-12-06 13:38:15 +00:00
|
|
|
BUILT_SOURCES = getdate.c
|
2003-08-18 07:51:29 +00:00
|
|
|
CLEANFILES =
|
1999-11-01 09:53:41 +00:00
|
|
|
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
|
2003-06-02 08:15:38 +00:00
|
|
|
MOSTLYCLEANFILES =
|
2003-08-18 07:51:29 +00:00
|
|
|
SUFFIXES =
|
1998-12-12 05:46:02 +00:00
|
|
|
|
2005-01-29 00:20:50 +00:00
|
|
|
EXTRA_DIST = getdate.c config.charset ref-add.sin ref-del.sin \
|
2005-02-11 20:26:57 +00:00
|
|
|
getndelim2.c getndelim2.h
|
2002-06-22 08:47:57 +00:00
|
|
|
|
2003-08-18 07:51:29 +00:00
|
|
|
# We need the following in order to install a simple file in $(libdir)
|
2000-03-24 05:46:01 +00:00
|
|
|
# which is shared with other installed packages. We use a list of referencing
|
|
|
|
|
# packages so that "make uninstall" will remove the file if and only if it
|
|
|
|
|
# is not used by another installed package.
|
2000-06-03 08:34:34 +00:00
|
|
|
# On systems with glibc-2.1 or newer, the file is redundant, therefore we
|
|
|
|
|
# avoid installing it.
|
2000-03-01 13:26:04 +00:00
|
|
|
|
2002-12-06 13:38:15 +00:00
|
|
|
all-local: charset.alias ref-add.sed ref-del.sed
|
2000-03-01 13:26:04 +00:00
|
|
|
|
2000-03-24 05:54:46 +00:00
|
|
|
charset_alias = $(DESTDIR)$(libdir)/charset.alias
|
2000-04-04 12:47:19 +00:00
|
|
|
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
|
2000-03-01 13:26:04 +00:00
|
|
|
install-exec-local: all-local
|
2003-08-18 07:51:29 +00:00
|
|
|
test $(GLIBC21) != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
|
2000-06-03 08:34:34 +00:00
|
|
|
if test -f $(charset_alias); then \
|
|
|
|
|
sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
|
|
|
|
|
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
|
|
|
|
|
rm -f $(charset_tmp) ; \
|
|
|
|
|
else \
|
2003-08-18 07:51:29 +00:00
|
|
|
if test $(GLIBC21) = no; then \
|
2000-06-03 08:34:34 +00:00
|
|
|
sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
|
|
|
|
|
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
|
|
|
|
|
rm -f $(charset_tmp) ; \
|
|
|
|
|
fi ; \
|
|
|
|
|
fi
|
2000-03-24 05:46:01 +00:00
|
|
|
|
|
|
|
|
uninstall-local: all-local
|
2000-03-24 05:54:46 +00:00
|
|
|
if test -f $(charset_alias); then \
|
2000-04-04 12:47:19 +00:00
|
|
|
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
|
|
|
|
|
if grep '^# Packages using this file: $$' $(charset_tmp) \
|
2000-03-24 05:54:46 +00:00
|
|
|
> /dev/null; then \
|
|
|
|
|
rm -f $(charset_alias); \
|
2000-03-24 05:46:01 +00:00
|
|
|
else \
|
2000-04-04 12:47:19 +00:00
|
|
|
$(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
|
2000-03-24 05:54:46 +00:00
|
|
|
fi; \
|
2000-04-04 12:47:19 +00:00
|
|
|
rm -f $(charset_tmp); \
|
2000-03-24 05:46:01 +00:00
|
|
|
fi
|
2000-03-01 13:26:04 +00:00
|
|
|
|
|
|
|
|
charset.alias: config.charset
|
2003-08-18 07:51:29 +00:00
|
|
|
$(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
|
|
|
|
|
mv t-$@ $@
|
|
|
|
|
|
|
|
|
|
SUFFIXES += .sed .sin
|
|
|
|
|
.sin.sed:
|
|
|
|
|
sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
|
2000-04-08 06:34:02 +00:00
|
|
|
mv t-$@ $@
|
2000-03-01 13:26:04 +00:00
|
|
|
|
2003-08-18 07:51:29 +00:00
|
|
|
CLEANFILES += charset.alias ref-add.sed ref-del.sed
|
|
|
|
|
|
2003-07-12 18:29:35 +00:00
|
|
|
BUILT_SOURCES += $(STDBOOL_H)
|
2003-07-28 08:34:33 +00:00
|
|
|
EXTRA_DIST += stdbool_.h
|
2005-11-26 06:58:34 +00:00
|
|
|
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
|
2003-06-02 08:15:38 +00:00
|
|
|
# Create stdbool.h on systems that lack a working one.
|
2003-07-28 08:34:33 +00:00
|
|
|
stdbool.h: stdbool_.h
|
2005-12-14 00:08:54 +00:00
|
|
|
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t
|
2005-11-26 06:55:22 +00:00
|
|
|
mv $@-t $@
|
2003-06-02 08:15:38 +00:00
|
|
|
|
2006-01-12 07:16:07 +00:00
|
|
|
BUILT_SOURCES += $(STDINT_H)
|
|
|
|
|
EXTRA_DIST += stdint_.h
|
|
|
|
|
|
|
|
|
|
# We need the following in order to create <stdint.h> when the system
|
|
|
|
|
# doesn't have one that works with the given compiler.
|
|
|
|
|
stdint.h: stdint_.h
|
|
|
|
|
sed -e 's/@''HAVE_LONG_64BIT''@/$(HAVE_LONG_64BIT)/g;s/@''HAVE_LONG_LONG_64BIT@/$(HAVE_LONG_LONG_64BIT)/g' < $(srcdir)/stdint_.h > $@-t
|
|
|
|
|
mv $@-t $@
|
|
|
|
|
MOSTLYCLEANFILES += stdint.h stdint.h-t
|
|
|
|
|
|
2003-07-12 18:29:35 +00:00
|
|
|
BUILT_SOURCES += $(ALLOCA_H)
|
2003-06-06 19:58:26 +00:00
|
|
|
EXTRA_DIST += alloca_.h
|
2003-08-09 09:58:30 +00:00
|
|
|
|
|
|
|
|
# We need the following in order to create an <alloca.h> when the system
|
2003-06-06 19:58:26 +00:00
|
|
|
# doesn't have one that works with the given compiler.
|
2003-08-09 10:44:06 +00:00
|
|
|
all-local $(lib_OBJECTS): $(ALLOCA_H)
|
2003-06-06 19:58:26 +00:00
|
|
|
alloca.h: alloca_.h
|
2003-08-09 10:44:06 +00:00
|
|
|
cp $(srcdir)/alloca_.h $@-t
|
|
|
|
|
mv $@-t $@
|
2003-08-09 09:58:30 +00:00
|
|
|
MOSTLYCLEANFILES += alloca.h alloca.h-t
|
|
|
|
|
|
|
|
|
|
BUILT_SOURCES += $(FNMATCH_H)
|
|
|
|
|
EXTRA_DIST += fnmatch_.h fnmatch_loop.c
|
|
|
|
|
|
|
|
|
|
# We need the following in order to create an <fnmatch.h> when the system
|
|
|
|
|
# doesn't have one that supports the required API.
|
2003-08-09 10:44:06 +00:00
|
|
|
all-local $(lib_OBJECTS): $(FNMATCH_H)
|
2003-08-09 09:58:30 +00:00
|
|
|
fnmatch.h: fnmatch_.h
|
2003-08-09 10:44:06 +00:00
|
|
|
cp $(srcdir)/fnmatch_.h $@-t
|
|
|
|
|
mv $@-t $@
|
2003-08-09 09:58:30 +00:00
|
|
|
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
|
2004-08-20 02:10:15 +00:00
|
|
|
|
|
|
|
|
BUILT_SOURCES += $(GETOPT_H)
|
|
|
|
|
EXTRA_DIST += getopt_.h getopt_int.h
|
|
|
|
|
|
2004-12-05 19:37:49 +00:00
|
|
|
check: unit-test
|
|
|
|
|
|
2004-12-05 21:11:48 +00:00
|
|
|
.PHONY: unit-test
|
|
|
|
|
unit-test: t-fpending
|
2004-12-05 19:37:49 +00:00
|
|
|
./t-fpending > /dev/null
|
|
|
|
|
|
2004-08-20 02:10:15 +00:00
|
|
|
# We need the following in order to create an <getopt.h> when the system
|
|
|
|
|
# doesn't have one that works with the given compiler.
|
|
|
|
|
all-local $(lib_OBJECTS): $(GETOPT_H)
|
|
|
|
|
getopt.h: getopt_.h
|
|
|
|
|
cp $(srcdir)/getopt_.h $@-t
|
|
|
|
|
mv $@-t $@
|
|
|
|
|
MOSTLYCLEANFILES += getopt.h getopt.h-t
|