Blame Makefile

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