|
Packit |
6c4009 |
# Copyright (C) 1991-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
# This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
# modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
# License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
# version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
# Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
# License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
# <http://www.gnu.org/licenses/>.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#
|
|
Packit |
6c4009 |
# Master Makefile for the GNU C library
|
|
Packit |
6c4009 |
#
|
|
Packit |
6c4009 |
ifneq (,)
|
|
Packit |
6c4009 |
This makefile requires GNU Make.
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
include Makeconfig
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# This is the default target; it makes everything except the tests.
|
|
Packit |
6c4009 |
.PHONY: all
|
|
Packit |
6c4009 |
all: lib others
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifneq ($(AUTOCONF),no)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
define autoconf-it
|
|
Packit |
6c4009 |
@-rm -f $@.new
|
|
Packit |
6c4009 |
$(AUTOCONF) $(ACFLAGS) $< > $@.new
|
|
Packit |
6c4009 |
chmod a-w$(patsubst %,$(comma)a+x,$(filter .,$(@D))) $@.new
|
|
Packit |
6c4009 |
mv -f $@.new $@
|
|
Packit |
6c4009 |
endef
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
configure: configure.ac aclocal.m4; $(autoconf-it)
|
|
Packit |
6c4009 |
%/configure: %/configure.ac aclocal.m4; $(autoconf-it)
|
|
Packit |
6c4009 |
%/preconfigure: %/preconfigure.ac aclocal.m4; $(autoconf-it)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
endif # $(AUTOCONF) = no
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# We don't want to run anything here in parallel.
|
|
Packit |
6c4009 |
.NOTPARALLEL:
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# These are the targets that are made by making them in each subdirectory.
|
|
Packit |
6c4009 |
+subdir_targets := subdir_lib objects objs others subdir_mostlyclean \
|
|
Packit |
6c4009 |
subdir_clean subdir_distclean subdir_realclean \
|
|
Packit |
6c4009 |
tests xtests \
|
|
Packit |
6c4009 |
subdir_update-abi subdir_check-abi \
|
|
Packit |
6c4009 |
subdir_update-all-abi \
|
|
Packit |
6c4009 |
subdir_echo-headers \
|
|
Packit |
6c4009 |
subdir_install \
|
|
Packit |
6c4009 |
subdir_objs subdir_stubs subdir_testclean \
|
|
Packit |
6c4009 |
$(addprefix install-, no-libc.a bin lib data headers others)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
headers := limits.h values.h features.h gnu-versions.h \
|
|
Packit |
6c4009 |
bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \
|
|
Packit |
6c4009 |
bits/libc-header-start.h
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
echo-headers: subdir_echo-headers
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# The headers are in the include directory.
|
|
Packit |
6c4009 |
subdir-dirs = include
|
|
Packit |
6c4009 |
vpath %.h $(subdir-dirs)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# What to install.
|
|
Packit |
6c4009 |
install-others = $(inst_includedir)/gnu/stubs.h
|
|
Packit |
6c4009 |
install-bin-script =
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifeq (yes,$(build-shared))
|
|
Packit |
6c4009 |
headers += gnu/lib-names.h
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
include Makerules
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifeq ($(build-programs),yes)
|
|
Packit |
6c4009 |
others: $(addprefix $(objpfx),$(install-bin-script))
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Install from subdirectories too.
|
|
Packit |
6c4009 |
install: subdir_install
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Explicit dependency so that `make install-headers' works
|
|
Packit |
6c4009 |
install-headers: install-headers-nosubdir
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Make sure that the dynamic linker is installed before libc.
|
|
Packit |
6c4009 |
$(inst_slibdir)/libc-$(version).so: elf/ldso_install
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
.PHONY: elf/ldso_install
|
|
Packit |
6c4009 |
elf/ldso_install:
|
|
Packit |
6c4009 |
$(MAKE) -C $(@D) $(@F)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Create links for shared libraries using the `ldconfig' program if possible.
|
|
Packit |
6c4009 |
# Ignore the error if we cannot update /etc/ld.so.cache.
|
|
Packit |
6c4009 |
ifeq (no,$(cross-compiling))
|
|
Packit |
6c4009 |
ifeq (yes,$(build-shared))
|
|
Packit |
6c4009 |
install: install-symbolic-link
|
|
Packit |
6c4009 |
.PHONY: install-symbolic-link
|
|
Packit |
6c4009 |
install-symbolic-link: subdir_install
|
|
Packit |
6c4009 |
$(symbolic-link-prog) $(symbolic-link-list)
|
|
Packit |
6c4009 |
rm -f $(symbolic-link-list)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
install:
|
|
Packit |
6c4009 |
-test ! -x $(elf-objpfx)ldconfig || LC_ALL=C \
|
|
Packit |
6c4009 |
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
|
|
Packit |
6c4009 |
$(slibdir) $(libdir)
|
|
Packit |
6c4009 |
ifneq (no,$(PERL))
|
|
Packit |
6c4009 |
ifeq (/usr,$(prefix))
|
|
Packit |
6c4009 |
ifeq (,$(install_root))
|
|
Packit |
6c4009 |
LD_SO=$(ld.so-version) CC="$(CC)" $(PERL) scripts/test-installation.pl $(common-objpfx)
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Build subdirectory lib objects.
|
|
Packit |
6c4009 |
lib-noranlib: subdir_lib
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifeq (yes,$(build-shared))
|
|
Packit |
6c4009 |
# Build the shared object from the PIC object library.
|
|
Packit |
6c4009 |
lib: $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so
|
|
Packit |
6c4009 |
endif # $(build-shared)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Used to build testrun.sh.
|
|
Packit |
6c4009 |
define testrun-script
|
|
Packit |
6c4009 |
#!/bin/bash
|
|
Packit |
6c4009 |
builddir=`dirname "$$0"`
|
|
Packit |
6c4009 |
GCONV_PATH="$${builddir}/iconvdata"
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
usage () {
|
|
Packit |
6c4009 |
echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
|
|
Packit |
6c4009 |
echo " $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
toolname=default
|
|
Packit |
6c4009 |
while test $$# -gt 0 ; do
|
|
Packit |
6c4009 |
case "$$1" in
|
|
Packit |
6c4009 |
--tool=*)
|
|
Packit |
6c4009 |
toolname="$${1:7}"
|
|
Packit |
6c4009 |
shift
|
|
Packit |
6c4009 |
;;
|
|
Packit |
6c4009 |
--*)
|
|
Packit |
6c4009 |
usage
|
|
Packit |
6c4009 |
;;
|
|
Packit |
6c4009 |
*)
|
|
Packit |
6c4009 |
break
|
|
Packit |
6c4009 |
;;
|
|
Packit |
6c4009 |
esac
|
|
Packit |
6c4009 |
done
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
if test $$# -eq 0 ; then
|
|
Packit |
6c4009 |
usage
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
case "$$toolname" in
|
|
Packit |
6c4009 |
default)
|
|
Packit |
6c4009 |
exec $(subst $(common-objdir),"$${builddir}", $(test-program-prefix)) \
|
|
Packit |
6c4009 |
$${1+"$$@"}
|
|
Packit |
6c4009 |
;;
|
|
Packit |
6c4009 |
strace)
|
|
Packit |
6c4009 |
exec strace $(patsubst %, -E%, $(run-program-env)) \
|
|
Packit |
6c4009 |
$(test-via-rtld-prefix) $${1+"$$@"}
|
|
Packit |
6c4009 |
;;
|
|
Packit |
6c4009 |
valgrind)
|
|
Packit |
6c4009 |
exec env $(run-program-env) valgrind $(test-via-rtld-prefix) $${1+"$$@"}
|
|
Packit |
6c4009 |
;;
|
|
Packit |
6c4009 |
*)
|
|
Packit |
6c4009 |
usage
|
|
Packit |
6c4009 |
;;
|
|
Packit |
6c4009 |
esac
|
|
Packit |
6c4009 |
endef
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# This is a handy script for running any dynamically linked program against
|
|
Packit |
6c4009 |
# the current libc build for testing.
|
|
Packit |
6c4009 |
$(common-objpfx)testrun.sh: $(common-objpfx)config.make \
|
|
Packit |
6c4009 |
$(..)Makeconfig $(..)Makefile
|
|
Packit |
6c4009 |
$(file >$@T, $(testrun-script))
|
|
Packit |
6c4009 |
chmod a+x $@T
|
|
Packit |
6c4009 |
mv -f $@T $@
|
|
Packit |
6c4009 |
postclean-generated += testrun.sh
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
others: $(common-objpfx)testrun.sh
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Makerules creates a file `stubs' in each subdirectory, which
|
|
Packit |
6c4009 |
# contains `#define __stub_FUNCTION' for each function defined in that
|
|
Packit |
6c4009 |
# directory which is a stub.
|
|
Packit |
6c4009 |
# Here we paste all of these together into <gnu/stubs.h>.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifndef abi-variants
|
|
Packit |
6c4009 |
installed-stubs = $(inst_includedir)/gnu/stubs.h
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
installed-stubs = $(inst_includedir)/gnu/stubs-$(default-abi).h
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
$(inst_includedir)/gnu/stubs.h: $(+force)
|
|
Packit |
6c4009 |
$(make-target-directory)
|
|
Packit |
6c4009 |
{ \
|
|
Packit |
6c4009 |
echo '/* This file is automatically generated.';\
|
|
Packit |
6c4009 |
echo " This file selects the right generated file of \`__stub_FUNCTION' macros";\
|
|
Packit |
6c4009 |
echo ' based on the architecture being compiled for. */'; \
|
|
Packit |
6c4009 |
echo ''; \
|
|
Packit |
6c4009 |
$(foreach h,$(abi-includes), echo '#include <$(h)>';) \
|
|
Packit |
6c4009 |
echo ''; \
|
|
Packit |
6c4009 |
$(foreach v,$(abi-variants),\
|
|
Packit |
6c4009 |
$(if $(abi-$(v)-condition),\
|
|
Packit |
6c4009 |
echo '#if $(abi-$(v)-condition)'; \
|
|
Packit |
6c4009 |
echo '# include <gnu/stubs-$(v).h>'); \
|
|
Packit |
6c4009 |
$(if $(abi-$(v)-condition),echo '#endif';) \
|
|
Packit |
6c4009 |
rm -f $(@:.d=.h).new$(v); \
|
|
Packit |
6c4009 |
) \
|
|
Packit |
6c4009 |
} > $(@:.d=.h).new
|
|
Packit |
6c4009 |
mv -f $(@:.d=.h).new $(@:.d=.h)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
install-others-nosubdir: $(installed-stubs)
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Since stubs.h is never needed when building the library, we simplify the
|
|
Packit |
6c4009 |
# hairy installation process by producing it in place only as the last part
|
|
Packit |
6c4009 |
# of the top-level `make install'. It depends on subdir_install, which
|
|
Packit |
6c4009 |
# iterates over all the subdirs; subdir_install in each subdir depends on
|
|
Packit |
6c4009 |
# the subdir's stubs file. Having more direct dependencies would result in
|
|
Packit |
6c4009 |
# extra iterations over the list for subdirs and many recursive makes.
|
|
Packit |
6c4009 |
$(installed-stubs): include/stubs-prologue.h subdir_install
|
|
Packit |
6c4009 |
$(make-target-directory)
|
|
Packit |
6c4009 |
@rm -f $(objpfx)stubs.h
|
|
Packit |
6c4009 |
(sed '/^@/d' $<; LC_ALL=C sort $(subdir-stubs)) > $(objpfx)stubs.h
|
|
Packit |
6c4009 |
if test -r $@ && cmp -s $(objpfx)stubs.h $@; \
|
|
Packit |
6c4009 |
then echo 'stubs.h unchanged'; \
|
|
Packit |
6c4009 |
else $(INSTALL_DATA) $(objpfx)stubs.h $@; fi
|
|
Packit |
6c4009 |
rm -f $(objpfx)stubs.h
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# This makes the Info or DVI file of the documentation from the Texinfo source.
|
|
Packit |
6c4009 |
.PHONY: info dvi pdf html
|
|
Packit |
6c4009 |
info dvi pdf html:
|
|
Packit |
6c4009 |
$(MAKE) $(PARALLELMFLAGS) -C manual $@
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# This makes all the subdirectory targets.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# For each target, make it depend on DIR/target for each subdirectory DIR.
|
|
Packit |
6c4009 |
$(+subdir_targets): %: $(addsuffix /%,$(subdirs))
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Compute a list of all those targets.
|
|
Packit |
6c4009 |
all-subdirs-targets := $(foreach dir,$(subdirs),\
|
|
Packit |
6c4009 |
$(addprefix $(dir)/,$(+subdir_targets)))
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# The action for each of those is to cd into the directory and make the
|
|
Packit |
6c4009 |
# target there.
|
|
Packit |
6c4009 |
$(all-subdirs-targets):
|
|
Packit |
6c4009 |
$(MAKE) $(PARALLELMFLAGS) $(subdir-target-args) $(@F)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
define subdir-target-args
|
|
Packit |
6c4009 |
subdir=$(@D)$(if $($(@D)-srcdir),\
|
|
Packit |
6c4009 |
-C $($(@D)-srcdir) ..=`pwd`/,\
|
|
Packit |
6c4009 |
-C $(@D) ..=../)
|
|
Packit |
6c4009 |
endef
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
.PHONY: $(+subdir_targets) $(all-subdirs-targets)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Targets to clean things up to various degrees.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
.PHONY: clean realclean distclean distclean-1 parent-clean parent-mostlyclean \
|
|
Packit |
6c4009 |
tests-clean
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Subroutines of all cleaning targets.
|
|
Packit |
6c4009 |
parent-mostlyclean: common-mostlyclean # common-mostlyclean is in Makerules.
|
|
Packit |
6c4009 |
-rm -f $(foreach o,$(object-suffixes-for-libc),\
|
|
Packit |
6c4009 |
$(common-objpfx)$(patsubst %,$(libtype$o),c)) \
|
|
Packit |
6c4009 |
$(addprefix $(objpfx),$(install-lib))
|
|
Packit |
6c4009 |
parent-clean: parent-mostlyclean common-clean
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
postclean = $(addprefix $(common-objpfx),$(postclean-generated)) \
|
|
Packit |
6c4009 |
$(addprefix $(objpfx),sysd-dirs sysd-rules) \
|
|
Packit |
6c4009 |
$(addprefix $(objpfx),sysd-sorted soversions.mk soversions.i)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
clean: parent-clean
|
|
Packit |
6c4009 |
# This is done this way rather than having `subdir_clean' be a
|
|
Packit |
6c4009 |
# dependency of this target so that libc.a will be removed before the
|
|
Packit |
6c4009 |
# subdirectories are dealt with and so they won't try to remove object
|
|
Packit |
6c4009 |
# files from it when it's going to be removed anyway.
|
|
Packit |
6c4009 |
@$(MAKE) subdir_clean no_deps=t
|
|
Packit |
6c4009 |
-rm -f $(postclean)
|
|
Packit |
6c4009 |
mostlyclean: parent-mostlyclean
|
|
Packit |
6c4009 |
@$(MAKE) subdir_mostlyclean no_deps=t
|
|
Packit |
6c4009 |
-rm -f $(postclean)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
tests-clean:
|
|
Packit |
6c4009 |
@$(MAKE) subdir_testclean no_deps=t
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifneq (,$(CXX))
|
|
Packit |
6c4009 |
vpath c++-types.data $(+sysdep_dirs)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
tests-special += $(objpfx)c++-types-check.out
|
|
Packit |
6c4009 |
$(objpfx)c++-types-check.out: c++-types.data scripts/check-c++-types.sh
|
|
Packit |
6c4009 |
scripts/check-c++-types.sh $< $(CXX) $(filter-out -std=gnu11 $(+gccwarn-c),$(CFLAGS)) $(CPPFLAGS) > $@; \
|
|
Packit |
6c4009 |
$(evaluate-test)
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
tests-special += $(objpfx)check-local-headers.out
|
|
Packit |
6c4009 |
$(objpfx)check-local-headers.out: scripts/check-local-headers.sh
|
|
Packit |
6c4009 |
AWK='$(AWK)' scripts/check-local-headers.sh \
|
|
Packit |
6c4009 |
"$(includedir)" "$(objpfx)" < /dev/null > $@; \
|
|
Packit |
6c4009 |
$(evaluate-test)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifneq "$(headers)" ""
|
|
Packit |
6c4009 |
# Special test of all the installed headers in this directory.
|
|
Packit |
6c4009 |
tests-special += $(objpfx)check-installed-headers-c.out
|
|
Packit |
6c4009 |
libof-check-installed-headers-c := testsuite
|
|
Packit |
6c4009 |
$(objpfx)check-installed-headers-c.out: \
|
|
Packit |
6c4009 |
scripts/check-installed-headers.sh $(headers)
|
|
Packit |
6c4009 |
$(SHELL) $(..)scripts/check-installed-headers.sh c \
|
|
Packit |
6c4009 |
"$(CC) $(filter-out -std=%,$(CFLAGS)) -D_ISOMAC $(+includes)" \
|
|
Packit |
6c4009 |
$(headers) > $@; \
|
|
Packit |
6c4009 |
$(evaluate-test)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifneq "$(CXX)" ""
|
|
Packit |
6c4009 |
tests-special += $(objpfx)check-installed-headers-cxx.out
|
|
Packit |
6c4009 |
libof-check-installed-headers-cxx := testsuite
|
|
Packit |
6c4009 |
$(objpfx)check-installed-headers-cxx.out: \
|
|
Packit |
6c4009 |
scripts/check-installed-headers.sh $(headers)
|
|
Packit |
6c4009 |
$(SHELL) $(..)scripts/check-installed-headers.sh c++ \
|
|
Packit |
6c4009 |
"$(CXX) $(filter-out -std=%,$(CXXFLAGS)) -D_ISOMAC $(+includes)" \
|
|
Packit |
6c4009 |
$(headers) > $@; \
|
|
Packit |
6c4009 |
$(evaluate-test)
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
define summarize-tests
|
|
Packit |
6c4009 |
@egrep -v '^(PASS|XFAIL):' $(objpfx)$1 || true
|
|
Packit |
6c4009 |
@echo "Summary of test results$2:"
|
|
Packit |
6c4009 |
@sed 's/:.*//' < $(objpfx)$1 | sort | uniq -c
|
|
Packit |
6c4009 |
@! egrep -q -v '^(X?PASS|XFAIL|UNSUPPORTED):' $(objpfx)$1
|
|
Packit |
6c4009 |
endef
|
|
Packit |
6c4009 |
|
|
Packit Bot |
581f72 |
# The intention here is to do ONE install of our build into the
|
|
Packit Bot |
581f72 |
# testroot.pristine/ directory, then rsync (internal to
|
|
Packit Bot |
581f72 |
# support/test-container) that to testroot.root/ at the start of each
|
|
Packit Bot |
581f72 |
# test. That way we can promise each test a "clean" install, without
|
|
Packit Bot |
581f72 |
# having to do the install for each test.
|
|
Packit Bot |
581f72 |
#
|
|
Packit Bot |
581f72 |
# In addition, we have to copy some files (which we build) into this
|
|
Packit Bot |
581f72 |
# root in addition to what glibc installs. For example, many tests
|
|
Packit Bot |
581f72 |
# require additional programs including /bin/sh, /bin/true, and
|
|
Packit Bot |
581f72 |
# /bin/echo, all of which we build below to limit library dependencies
|
|
Packit Bot |
581f72 |
# to just those things in glibc and language support libraries which
|
|
Packit Bot |
581f72 |
# we also copy into the into the rootfs. To determine what language
|
|
Packit Bot |
581f72 |
# support libraries we need we build a "test" program in either C or
|
|
Packit Bot |
581f72 |
# (if available) C++ just so we can copy in any shared objects
|
|
Packit Bot |
581f72 |
# (which we do not build) that GCC-compiled programs depend on.
|
|
Packit Bot |
581f72 |
|
|
Packit Bot |
581f72 |
|
|
Packit Bot |
581f72 |
ifeq (,$(CXX))
|
|
Packit Bot |
581f72 |
LINKS_DSO_PROGRAM = links-dso-program-c
|
|
Packit Bot |
581f72 |
else
|
|
Packit Bot |
581f72 |
LINKS_DSO_PROGRAM = links-dso-program
|
|
Packit Bot |
581f72 |
endif
|
|
Packit Bot |
581f72 |
|
|
Packit Bot |
581f72 |
$(tests-container) $(addsuffix /tests,$(subdirs)) : \
|
|
Packit Bot |
581f72 |
$(objpfx)testroot.pristine/install.stamp
|
|
Packit Bot |
581f72 |
$(objpfx)testroot.pristine/install.stamp :
|
|
Packit Bot |
581f72 |
test -d $(objpfx)testroot.pristine || \
|
|
Packit Bot |
581f72 |
mkdir $(objpfx)testroot.pristine
|
|
Packit Bot |
581f72 |
# We need a working /bin/sh for some of the tests.
|
|
Packit Bot |
581f72 |
test -d $(objpfx)testroot.pristine/bin || \
|
|
Packit Bot |
581f72 |
mkdir $(objpfx)testroot.pristine/bin
|
|
Packit Bot |
581f72 |
cp $(objpfx)support/shell-container $(objpfx)testroot.pristine/bin/sh
|
|
Packit Bot |
581f72 |
cp $(objpfx)support/echo-container $(objpfx)testroot.pristine/bin/echo
|
|
Packit Bot |
581f72 |
cp $(objpfx)support/true-container $(objpfx)testroot.pristine/bin/true
|
|
Packit Bot |
2e0180 |
ifeq ($(run-built-tests),yes)
|
|
Packit Bot |
581f72 |
# Copy these DSOs first so we can overwrite them with our own.
|
|
Packit Bot |
581f72 |
for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \
|
|
Packit Bot |
105676 |
$(rtld-prefix) \
|
|
Packit Bot |
581f72 |
$(objpfx)testroot.pristine/bin/sh \
|
|
Packit Bot |
5eb900 |
| sed -n '/\//{s@.*=> /@/@;s/^[^/]*//;s/ .*//p;}'` ;\
|
|
Packit Bot |
581f72 |
do \
|
|
Packit Bot |
581f72 |
test -d `dirname $(objpfx)testroot.pristine$$dso` || \
|
|
Packit Bot |
581f72 |
mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\
|
|
Packit Bot |
581f72 |
$(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
|
|
Packit Bot |
581f72 |
done
|
|
Packit Bot |
581f72 |
for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \
|
|
Packit Bot |
105676 |
$(rtld-prefix) \
|
|
Packit Bot |
581f72 |
$(objpfx)support/$(LINKS_DSO_PROGRAM) \
|
|
Packit Bot |
5eb900 |
| sed -n '/\//{s@.*=> /@/@;s/^[^/]*//;s/ .*//p;}'` ;\
|
|
Packit Bot |
581f72 |
do \
|
|
Packit Bot |
581f72 |
test -d `dirname $(objpfx)testroot.pristine$$dso` || \
|
|
Packit Bot |
581f72 |
mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\
|
|
Packit Bot |
581f72 |
$(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
|
|
Packit Bot |
581f72 |
done
|
|
Packit Bot |
2e0180 |
endif
|
|
Packit Bot |
a8f662 |
$(MAKE) install DESTDIR=$(objpfx)testroot.pristine \
|
|
Packit Bot |
a3d77a |
subdirs='$(sorted-subdirs)'
|
|
Packit Bot |
581f72 |
touch $(objpfx)testroot.pristine/install.stamp
|
|
Packit Bot |
581f72 |
|
|
Packit |
6c4009 |
tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
|
|
Packit |
6c4009 |
tests: $(tests-special)
|
|
Packit |
6c4009 |
$(..)scripts/merge-test-results.sh -s $(objpfx) "" \
|
|
Packit |
6c4009 |
$(sort $(tests-special-notdir:.out=)) \
|
|
Packit |
6c4009 |
> $(objpfx)subdir-tests.sum
|
|
Packit |
6c4009 |
$(..)scripts/merge-test-results.sh -t $(objpfx) subdir-tests.sum \
|
|
Packit |
6c4009 |
$(sort $(subdirs) .) \
|
|
Packit |
6c4009 |
> $(objpfx)tests.sum
|
|
Packit |
6c4009 |
$(call summarize-tests,tests.sum)
|
|
Packit |
6c4009 |
xtests:
|
|
Packit |
6c4009 |
$(..)scripts/merge-test-results.sh -t $(objpfx) subdir-xtests.sum \
|
|
Packit |
6c4009 |
$(sort $(subdirs)) \
|
|
Packit |
6c4009 |
> $(objpfx)xtests.sum
|
|
Packit |
6c4009 |
$(call summarize-tests,xtests.sum, for extra tests)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# The realclean target is just like distclean for the parent, but we want
|
|
Packit |
6c4009 |
# the subdirs to know the difference in case they care.
|
|
Packit |
6c4009 |
realclean distclean: parent-clean
|
|
Packit |
6c4009 |
# This is done this way rather than having `subdir_distclean' be a
|
|
Packit |
6c4009 |
# dependency of this target so that libc.a will be removed before the
|
|
Packit |
6c4009 |
# subdirectories are dealt with and so they won't try to remove object
|
|
Packit |
6c4009 |
# files from it when it's going to be removed anyway.
|
|
Packit |
6c4009 |
@$(MAKE) distclean-1 no_deps=t distclean-1=$@ avoid-generated=yes \
|
|
Packit |
6c4009 |
sysdep-subdirs="$(sysdep-subdirs)"
|
|
Packit |
6c4009 |
-rm -f $(postclean)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Subroutine of distclean and realclean.
|
|
Packit |
6c4009 |
distclean-1: subdir_$(distclean-1)
|
|
Packit |
6c4009 |
-rm -f $(config-generated)
|
|
Packit |
6c4009 |
-rm -f $(addprefix $(objpfx),config.status config.cache config.log)
|
|
Packit |
6c4009 |
-rm -f $(addprefix $(objpfx),config.make config-name.h config.h)
|
|
Packit |
6c4009 |
ifdef objdir
|
|
Packit |
6c4009 |
-rm -f $(objpfx)Makefile
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
-rm -f $(sysdep-$(distclean-1))
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Make the TAGS file for Emacs users.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
.PHONY: TAGS
|
|
Packit |
6c4009 |
TAGS:
|
|
Packit |
6c4009 |
scripts/list-sources.sh | sed -n -e '/Makefile/p' \
|
|
Packit |
6c4009 |
$(foreach S,[chsSyl] cxx sh bash pl,\
|
|
Packit |
6c4009 |
$(subst .,\.,-e '/.$S\(.in\)*$$/p')) \
|
|
Packit |
6c4009 |
| $(ETAGS) -o $@ -
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Make the distribution tarfile.
|
|
Packit |
6c4009 |
.PHONY: dist dist-prepare
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
generated := $(generated) stubs.h
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
files-for-dist := README INSTALL configure ChangeLog NEWS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Regenerate stuff, then error if these things are not committed yet.
|
|
Packit |
6c4009 |
dist-prepare: $(files-for-dist)
|
|
Packit |
6c4009 |
conf=`find sysdeps -name configure`; \
|
|
Packit |
6c4009 |
$(MAKE) $$conf && \
|
|
Packit |
6c4009 |
git diff --stat HEAD -- $^ $$conf \
|
|
Packit |
6c4009 |
| $(AWK) '{ print; rc=1 } END { exit rc }'
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
%.tar: FORCE
|
|
Packit |
6c4009 |
git archive --prefix=$*/ $* > $@.new
|
|
Packit |
6c4009 |
mv -f $@.new $@
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# Do `make dist dist-version=X.Y.Z' to make tar files of an older version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ifneq (,$(strip $(dist-version)))
|
|
Packit |
6c4009 |
dist: $(foreach Z,.bz2 .gz .xz,$(dist-version).tar$Z)
|
|
Packit |
6c4009 |
md5sum $^
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
dist: dist-prepare
|
|
Packit |
6c4009 |
@if v=`git describe`; then \
|
|
Packit |
6c4009 |
echo Distribution version $$v; \
|
|
Packit |
6c4009 |
$(MAKE) dist dist-version=$$v; \
|
|
Packit |
6c4009 |
else \
|
|
Packit |
6c4009 |
false; \
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
INSTALL: manual/install-plain.texi manual/macros.texi \
|
|
Packit |
6c4009 |
$(common-objpfx)manual/pkgvers.texi manual/install.texi
|
|
Packit |
6c4009 |
makeinfo --no-validate --plaintext --no-number-sections \
|
|
Packit |
6c4009 |
-I$(common-objpfx)manual $< -o $@-tmp
|
|
Packit |
6c4009 |
$(AWK) 'NF == 0 { ++n; next } \
|
|
Packit |
6c4009 |
NF != 0 { while (n-- > 0) print ""; n = 0; print }' \
|
|
Packit |
6c4009 |
< $@-tmp > $@-tmp2
|
|
Packit |
6c4009 |
rm -f $@-tmp
|
|
Packit |
6c4009 |
-chmod a-w $@-tmp2
|
|
Packit |
6c4009 |
mv -f $@-tmp2 $@
|
|
Packit |
6c4009 |
$(common-objpfx)manual/%: FORCE
|
|
Packit |
6c4009 |
$(MAKE) $(PARALLELMFLAGS) -C manual $@
|
|
Packit |
6c4009 |
FORCE:
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
iconvdata/% localedata/% po/%: FORCE
|
|
Packit |
6c4009 |
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|