-# Copyright (C) 1991-2013 Free Software Foundation, Inc.
+# Copyright (C) 1991-2015 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
$(common-objpfx)config.status: $(..)version.h $(..)configure \
$(foreach dir,$(sysdirs),\
$(wildcard $(dir)/Implies) \
- $(patsubst %.in,%,\
+ $(patsubst %.ac,%,\
$(firstword $(wildcard \
- $(addprefix $(dir)/,configure configure.in))))) \
- $(patsubst %.in,%,\
+ $(addprefix $(dir)/,configure configure.ac))))) \
+ $(patsubst %.ac,%,\
+ $(wildcard $(..)sysdeps/*/preconfigure $(..)sysdeps/*/preconfigure.ac)) \
+ $(patsubst %.ac,%,\
$(foreach add-on,$(add-ons),\
$(firstword $(wildcard \
$(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
- configure configure.in)))))
+ configure configure.ac))) \
+ $(wildcard $(addprefix $(firstword $(filter /%,$(add-on)) $(..)$(add-on))/,\
+ sysdeps/*/preconfigure sysdeps/*/preconfigure.ac))))
@cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
echo The GNU C library has not been configured. >&2; \
echo Run \`configure\' to configure it before building. >&2; \
endif
inst_libdir = $(install_root)$(libdir)
-# Where to install the shared library and dynamic linker.
+# Where to install the shared library.
ifndef slibdir
slibdir = $(exec_prefix)/lib
endif
inst_slibdir = $(install_root)$(slibdir)
+# Where to install the dynamic linker.
+ifndef rtlddir
+rtlddir = $(slibdir)
+endif
+inst_rtlddir = $(install_root)$(rtlddir)
+
# Prefix to put on files installed in $(libdir). For libraries `libNAME.a',
# the prefix is spliced between `lib' and the name, so the linker switch
# `-l$(libprefix)NAME' finds the library; for other files the prefix is
LDFLAGS-rtld += $(hashstyle-LDFLAGS)
endif
+# Command to run after every final link (executable or shared object).
+# This is invoked with $(call after-link,...), so it should operate on
+# the file $1. This can be set to do some sort of post-processing on
+# binaries, or to perform some sort of static sanity check.
+ifndef after-link
+after-link =
+endif
+
# Command for linking PIE programs with the C library.
ifndef +link-pie
+link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
$(common-objpfx)libc% $(+postinit),$^) \
$(link-extra-libs)
+link-pie-after-libc = $(+postctorS) $(+postinit)
-+link-pie = $(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) \
- $(+link-pie-after-libc)
-+link-pie-tests = $(+link-pie-before-libc) $(rtld-tests-LDFLAGS) \
- $(link-libc-tests) $(+link-pie-after-libc)
+define +link-pie
+$(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-pie-after-libc)
+$(call after-link,$@)
+endef
+define +link-pie-tests
+$(+link-pie-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
+ $(+link-pie-after-libc)
+$(call after-link,$@)
+endef
endif
# Command for statically linking programs with the C library.
ifndef +link-static
$(common-objpfx)libc% $(+postinit),$^) \
$(link-extra-libs-static)
+link-static-after-libc = $(+postctorT) $(+postinit)
-+link-static = $(+link-static-before-libc) $(link-libc-static) \
- $(+link-static-after-libc)
-+link-static-tests = $(+link-static-before-libc) $(link-libc-static-tests) \
- $(+link-static-after-libc)
+define +link-static
+$(+link-static-before-libc) $(link-libc-static) $(+link-static-after-libc)
+$(call after-link,$@)
+endef
+define +link-static-tests
+$(+link-static-before-libc) $(link-libc-static-tests) $(+link-static-after-libc)
+$(call after-link,$@)
+endef
endif
# Commands for linking programs with the C library.
ifndef +link
$(common-objpfx)libc% $(+postinit),$^) \
$(link-extra-libs)
+link-after-libc = $(+postctor) $(+postinit)
-+link = $(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) \
- $(+link-after-libc)
-+link-tests = $(+link-before-libc) $(rtld-tests-LDFLAGS) \
- $(link-libc-tests) $(+link-after-libc)
+define +link
+$(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-after-libc)
+$(call after-link,$@)
+endef
+define +link-tests
+$(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
+ $(+link-after-libc)
+$(call after-link,$@)
+endef
else
+link = $(+link-static)
+link-tests = $(+link-static-tests)
endif
endif
-# Command for statically linking bounded-pointer programs with the C library.
-ifndef +link-bounded
-+link-bounded = $(CC) -nostdlib -nostartfiles -static -fbounded-pointers -o $@ \
- $(sysdep-LDFLAGS) $(LDFLAGS) \
- $(addprefix $(csu-objpfx),b$(static-start-installed-name)) \
- $(+preinit) $(+prectorT) \
- $(filter-out $(addprefix $(csu-objpfx),start.ob \
- $(start-installed-name))\
- $(+preinit) $(link-extra-libs-bounded) \
- $(common-objpfx)libc% $(+postinit),$^) \
- $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctorT) $(+postinit)
-endif
ifeq (yes,$(build-shared))
ifndef rtld-LDFLAGS
-rtld-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
+rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
endif
ifndef rtld-tests-LDFLAGS
ifeq (yes,$(build-hardcoded-path-in-tests))
-rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(common-objpfx)elf/ld.so
+rtld-tests-LDFLAGS = -Wl,-dynamic-linker=$(elf-objpfx)ld.so
else
rtld-tests-LDFLAGS = $(rtld-LDFLAGS)
endif
endif
link-libc-before-gnulib = $(common-objpfx)libc.so$(libc.so-version) \
$(common-objpfx)$(patsubst %,$(libtype.oS),c) \
- $(as-needed) $(common-objpfx)elf/ld.so \
+ $(as-needed) $(elf-objpfx)ld.so \
$(no-as-needed)
link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
link-libc-tests = $(link-libc-tests-rpath-link) \
endif
endif
-elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
-
# Differences in the linkers on the various platforms.
LDFLAGS-rpath-ORIGIN = -Wl,-rpath,'$$ORIGIN'
LDFLAGS-soname-fname = -Wl,-soname,$(@F)
ifndef link-extra-libs
link-extra-libs = $(LDLIBS-$(@F))
link-extra-libs-static = $(link-extra-libs)
-link-extra-libs-bounded = $(link-extra-libs)
endif
# The static libraries.
link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group
link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group
-link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a
# How to link against libgcc. Some libgcc functions, such as those
# for "long long" arithmetic or software floating point, can always be
ifndef test-wrapper-env
test-wrapper-env = $(test-wrapper) env
endif
+# Likewise, but the program's environment will be empty except for any
+# explicit <variable>=<value> assignments preceding the program name.
+ifndef test-wrapper-env-only
+test-wrapper-env-only = $(test-wrapper) env -i
+endif
# Whether to run test programs built for the library's host system.
ifndef run-built-tests
endif
endif
+# Whether to stop immediately when a test fails. Nonempty means to
+# stop, empty means not to stop.
+ifndef stop-on-test-failure
+stop-on-test-failure =
+endif
+
# How to run a program we just linked with our library.
# The program binary is assumed to be $(word 2,$^).
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
+rtld-prefix = $(elf-objpfx)$(rtld-installed-name) \
+ --library-path \
+ $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
ifeq (yes,$(build-shared))
comma = ,
sysdep-library-path = \
# $(run-via-rtld-prefix) is a command that, when prepended to the name
# of a program built with the newly built library, produces a command
# that, executed on the host for which the library is built, runs that
-# program. For the statically-linked %-bp test programs, and for
-# tests listed in tests-static or xtests-static, it is empty.
+# program. For tests listed in tests-static or xtests-static, it is
+# empty.
run-via-rtld-prefix = \
$(if $(strip $(filter $(notdir $(built-program-file)), \
- $(tests-static) $(xtests-static)) \
- $(filter %-bp,$(built-program-file))),, \
- $(elf-objpfx)$(rtld-installed-name) \
- --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
+ $(tests-static) $(xtests-static))),, $(rtld-prefix))
else
run-via-rtld-prefix =
endif
+# $(run-program-env) is the default environment variable settings to
+# use when running a program built with the newly built library.
+run-program-env = GCONV_PATH=$(common-objpfx)iconvdata \
+ LOCPATH=$(common-objpfx)localedata LC_ALL=C
# $(run-program-prefix) is a command that, when prepended to the name
# of a program built with the newly built library, produces a command
# that, executed on the build system on which "make" is run, runs that
-# program.
-run-program-prefix = $(test-wrapper) $(run-via-rtld-prefix)
+# program. $(run-program-prefix-before-env) and
+# $(run-program-prefix-after-env) are similar, but separate parts
+# before and after a list of environment variables.
+run-program-prefix-before-env = $(test-wrapper-env)
+run-program-prefix-after-env = $(run-via-rtld-prefix)
+run-program-prefix = $(run-program-prefix-before-env) $(run-program-env) \
+ $(run-program-prefix-after-env)
# $(built-program-cmd) is a command that, executed on the build system
# on which "make" is run, runs the newly built program that is the
# second dependency of the makefile target in which
-# $(built-program-cmd) is used.
-built-program-cmd = $(test-wrapper) \
- $(run-via-rtld-prefix) $(built-program-file)
+# $(built-program-cmd) is used. $(built-program-cmd-before-env) and
+# $(built-program-cmd-after-env) are similar, before and after a list
+# of environment variables.
+built-program-cmd-before-env = $(test-wrapper-env)
+built-program-cmd-after-env = $(run-via-rtld-prefix) $(built-program-file)
+built-program-cmd = $(built-program-cmd-before-env) $(run-program-env) \
+ $(built-program-cmd-after-env)
# $(host-built-program-cmd) is a command that, executed on the host
# for which the library is built, runs the newly built program that is
# the second dependency of the makefile target in which
# $(test-via-rtld-prefix) is a command that, when prepended to the name
# of a test program built with the newly built library, produces a command
# that, executed on the host for which the library is built, runs that
-# program. For the statically-linked %-bp test programs, and for
-# tests listed in tests-static or xtests-static as well as when test
-# programs are hardcoded to the newly built libraries, it is empty.
+# program. For tests listed in tests-static or xtests-static as well
+# as when test programs are hardcoded to the newly built libraries, it
+# is empty.
# $(test-program-prefix) is a command that, when prepended to the name
# of a test program built with the newly built library, produces a command
# that, executed on the build system on which "make" is run, runs that
-# test program.
+# test program. $(test-program-prefix-before-env) and
+# $(test-program-prefix-after-env) are similar, before and after a
+# list of environment variables.
# $(test-program-cmd) is a command that, executed on the build system
# on which "make" is run, runs the newly built test program that is the
# second dependency of the makefile target in which
-# $(test-program-cmd) is used.
+# $(test-program-cmd) is used. $(test-program-cmd-before-env) and
+# $(test-program-cmd-after-env) are similar, before and after a list
+# of environment variables.
# $(host-test-program-cmd) is a command that, executed on the host
# for which the library is built, runs the newly built test program that
ifeq (yes,$(build-hardcoded-path-in-tests))
test-via-rtld-prefix =
-test-program-prefix = $(test-wrapper)
-test-program-cmd = $(test-wrapper) $(built-program-file)
+test-program-prefix-before-env = $(test-wrapper-env)
+test-program-prefix-after-env =
+test-program-prefix = $(test-program-prefix-before-env) $(run-program-env) \
+ $(test-program-prefix-after-env)
+test-program-cmd-before-env = $(test-wrapper-env)
+test-program-cmd-after-env = $(built-program-file)
+test-program-cmd = $(test-program-cmd-before-env) $(run-program-env) \
+ $(test-program-cmd-after-env)
host-test-program-cmd = $(built-program-file)
else
test-via-rtld-prefix = $(run-via-rtld-prefix)
+test-program-prefix-before-env = $(run-program-prefix-before-env)
+test-program-prefix-after-env = $(run-program-prefix-after-env)
test-program-prefix = $(run-program-prefix)
+test-program-cmd-before-env = $(built-program-cmd-before-env)
+test-program-cmd-after-env = $(built-program-cmd-after-env)
test-program-cmd = $(built-program-cmd)
host-test-program-cmd = $(host-built-program-cmd)
endif
else
+gccwarn := -Wall -Wwrite-strings -Winline
endif
++gccwarn += -Wundef
+ifeq ($(enable-werror),yes)
++gccwarn += -Werror -Wno-error=undef
+endif
+gccwarn-c = -Wstrict-prototypes
# We do not depend on the address of constants in different files to be
# Don't duplicate options if we inherited variables from the parent.
+cflags := $(sort $(+cflags))
+# Each sysdeps directory can contain header files that both will be
+# used to compile and will be installed. Each can also contain an
+# include/ subdirectory, whose header files will be used to compile
+# but will not be installed, and will take precedence over the
+# installed files. This mirrors the top-level include/ subdirectory.
++sysdep-includes := $(foreach dir,$(+sysdep_dirs),\
+ $(addprefix -I,$(wildcard $(dir)/include) $(dir)))
+
# These are flags given to the C compiler to tell it to look for
# include files (including ones given in angle brackets) in the parent
# library source directory, in the include directory, and in the
# current directory.
-+sysdep-includes = $(addprefix -I,$(+sysdep_dirs))
+includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
$(+sysdep-includes) $(includes) \
$(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
# of many little headers in the include directory.
libio-include = -I$(..)libio
+# List of non-library modules that we build.
+built-modules = iconvprogs iconvdata ldconfig lddlibc4 libmemusage \
+ libSegFault libpcprofile librpcsvc locale-programs \
+ memusagestat nonlib nscd extramodules libnldbl
+
+# We don't include libc-modules.h when these targets are being built. These
+# targets don't (and will likely never need to) use the IS_IN facility. In
+# fact, shlib-versions should not use it because that will create a circular
+# dependency as libc-modules.h is generated from shlib-versions.
+skip-module-cppflags = shlib-versions.v.i Versions.v.i
+
+in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \
+ $(libof-$(<F)) \
+ $(libof-$(@F)) \
+ libc))
+
+module-cppflags-real = -include $(common-objpfx)libc-modules.h \
+ -DMODULE_NAME=$(in-module)
+
+# We don't need libc-modules.h and the MODULE_NAME definition for
+# shlib-version.v.i.
+module-cppflags = $(if $(filter $(@F),$(skip-module-cppflags)), \
+ ,$(module-cppflags-real))
+
# These are the variables that the implicit compilation rules use.
# Note that we can't use -std=* in CPPFLAGS, because it overrides
# the implicit -lang-asm and breaks cpp behavior for .S files--notably
# it causes cpp to stop predefining __ASSEMBLER__.
-CPPFLAGS = $(CPPUNDEFS) $(CPPFLAGS-config) $($(subdir)-CPPFLAGS) \
- $(+includes) $(defines) \
+CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
+ $($(subdir)-CPPFLAGS) \
+ $(+includes) $(defines) $(module-cppflags) \
-include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
$(CPPFLAGS-$(suffix $@)) \
$(foreach lib,$(libof-$(basename $(@F))) \
# The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
# to pass different flags for each flavor.
libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
-all-object-suffixes := .o .os .op .og .ob .oS
+all-object-suffixes := .o .os .op .og .oS
object-suffixes :=
CPPFLAGS-.o = $(pic-default)
CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
# differently from the rest.
object-suffixes-noshared := $(filter-out .os,$(object-suffixes))
-bppfx = BP-
-ifeq (yes,$(build-bounded))
-# Under --enable-bounded, we build the library with `-fbounded-pointers -g'
-# to runtime bounds checking. The bounded-pointer objects are named foo.ob.
-# We disable sibling-call optimizations so that stack traces will be complete
-# and thus aid debugging, since after all, BPs are a debugging tool.
-object-suffixes += .ob
-CPPFLAGS-.ob = -fbounded-pointers $(pic-default)
-CFLAGS-.ob = -g -O2 -fno-optimize-sibling-calls -fno-strict-aliasing
-libtype.ob = lib%_b.a
-endif
-
object-suffixes-for-libc := $(object-suffixes)
ifeq (yes,$(build-shared))
ifndef ASFLAGS
ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
endif
-ASFLAGS += $(ASFLAGS-config) $(asflags-cpu)
+ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
ifndef BUILD_CC
BUILD_CC = $(CC)
subdir-srcdirs = $(foreach dir,$(subdirs),\
$(firstword $($(dir)-srcdir) $(..)$(dir)))
-ifeq (yes, $(build-shared))
-
# This is a pair of implicit rules to preprocess a file with # comments,
# %ifdef et al, based on config.h settings or other %include'd files.
# We use chained rules instead of a pipeline here so that we can properly
sed '/^[ ]*#/d;/^[ ]*$$/d' $< > $@T
mv -f $@T $@
+ifeq (yes, $(build-shared))
+
# To generate a header to support more than one ABI for different
# architecture variants, the CPU/Makefile defines abi-variants to be a
# list of names for those variants (e.g. 32 64), and, for each variant,
$(subdir-srcdirs:=/shlib-versions)) \
$(..)shlib-versions
-soversions-default-setname = $(patsubst %, %,\
- $(filter-out %_default,\
- $(oldest-abi:%=GLIBC_%)))
$(common-objpfx)soversions.i: $(..)scripts/soversions.awk \
$(common-objpfx)shlib-versions.v
- $(AWK) -v default_setname='$(soversions-default-setname)' \
- -v cpu='$(config-machine)' \
- -v vendor='$(config-vendor)' \
- -v os='$(config-os)' \
- -f $^ > $@T
+ $(AWK) -f $^ > $@T
mv -f $@T $@
$(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig
(while read which lib number setname; do \
eval seen_$$which=1; \
- test x"$$which" != xABI || echo abi-name = "$$lib"; \
test x"$$which" = xDEFAULT || continue; \
case $$number in \
[0-9]*) echo "$$lib.so-version=.$$number"; \
echo "all-sonames+=$$lib=$$lib.so\$$($$lib.so-version)";;\
- *) echo "$$lib.so-version=\$$(if \$$(abi-$(default-abi)-$$lib-soname),\$$(abi-$(default-abi)-$$lib-soname),$$number)"; \
+ *) echo "$$lib.so-version=$$number"; \
echo "all-sonames+=$$lib=\$$($$lib.so-version)";;\
esac; \
done; \
postclean-generated += soversions.mk soversions.i \
shlib-versions.v shlib-versions.v.i
-# Generate the header containing the names of all shared libraries.
-# We use a stamp file to avoid unnecessary recompilations.
-before-compile += $(common-objpfx)gnu/lib-names.h
+before-compile += $(common-objpfx)libc-modules.h
ifeq ($(soversions.mk-done),t)
-$(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp; @:
-$(common-objpfx)gnu/lib-names.stmp: $(..)scripts/lib-names.awk \
- $(common-objpfx)soversions.i
- $(make-target-directory)
- { \
- echo '/* This file is automatically generated.';\
- echo ' It defines macros to allow user program to find the shared'; \
- echo ' library files which come as part of GNU libc. */'; \
- echo '#ifndef __GNU_LIB_NAMES_H'; \
- echo '#define __GNU_LIB_NAMES_H 1'; \
- echo ''; \
- $(if $(abi-includes), \
- $(foreach h,$(abi-includes), echo '#include <$(h)>';) \
- echo '';) \
- $(if $(abi-variants), \
- $(foreach v,$(abi-variants),\
- $(if $(abi-$(v)-condition),\
- echo '#if $(abi-$(v)-condition)'; \
- ($(foreach s,$(all-sonames), \
- $(if $(abi-$(v)-$(firstword $(subst =, ,$(s)))-soname),\
- echo $(firstword $(subst =, ,$(s)))=$(abi-$(v)-$(firstword $(subst =, ,$(s)))-soname);, \
- echo $(s);))) \
- | LC_ALL=C $(AWK) -v multi=1 -f $(firstword $^) | LC_ALL=C sort;) \
- $(if $(abi-$(v)-condition),echo '#endif';)), \
- ($(foreach s,$(all-sonames), echo $(s);)) \
- | LC_ALL=C $(AWK) -f $(firstword $^) | LC_ALL=C sort;) \
- echo ''; \
- echo '#endif /* gnu/lib-names.h */'; \
- } > ${@:stmp=T}
+# Generate a header with macro definitions for use with the IS_IN macro.
+# These are the possible values for the MODULE_NAME macro defined when building
+# sources, to identify which module the translation unit is going to be built
+# into.
+$(common-objpfx)libc-modules.h: $(common-objpfx)libc-modules.stmp; @:
+$(common-objpfx)libc-modules.stmp: $(..)scripts/gen-libc-modules.awk \
+ $(common-objpfx)soversions.i
+ $(AWK) -v buildlist="$(subst -,_,$(built-modules))" -f $^ > ${@:stmp=T}
$(move-if-change) ${@:stmp=T} ${@:stmp=h}
touch $@
+
endif
-common-generated += gnu/lib-names.h gnu/lib-names.stmp
+common-generated += libc-modules.h libc-modules.stmp
# The name under which the run-time dynamic linker is installed.
# We are currently going for the convention that `/lib/ld.so.1'
stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \
- crypt nss localedata timezone rt conform debug \
+ crypt localedata timezone rt conform debug \
$(add-on-subdirs) dlfcn elf
ifndef avoid-generated
-all-Depend-files := $(wildcard $(foreach dir,$(all-subdirs),\
- $(firstword $($(dir)-srcdir) \
- $(..)$(dir))/Depend))
+# sysd-sorted itself will contain rules making the sysd-sorted target
+# depend on Depend files. But if you just added a Depend file to an
+# existing directory not in all-subdirs, then sysd-sorted needs to
+# be regenerated, so it depends on existing $(sorted-subdirs:=/Depend) files.
+all-Depend-files := $(wildcard $(sort \
+ $(foreach dir,$(all-subdirs),\
+ $(firstword $($(dir)-srcdir) \
+ $(..)$(dir))/Depend) \
+ $(sorted-subdirs:=/Depend)))
$(common-objpfx)sysd-sorted: $(..)scripts/gen-sorted.awk \
$(common-objpfx)config.make $(..)Makeconfig \
$(wildcard $(sysdirs:=/Subdirs)) \
libio-mtsafe = -D_IO_MTSAFE_IO
endif
+# The name to give to a test in test results summaries.
+test-name = $(strip $(patsubst %.out, %, $(patsubst $(common-objpfx)%, %, $@)))
+
+# Likewise, in XFAIL variable names.
+test-xfail-name = $(strip $(patsubst %.out, %, $(patsubst $(objpfx)%, %, $@)))
+
+# Command to output a test status line (such as PASS: test-name). If
+# test-xfail-$(test-xfail-name) has a nonempty value, the status will be
+# XPASS or XFAIL rather than PASS or FAIL.
+evaluate-test = $(..)scripts/evaluate-test.sh $(test-name) $$? \
+ $(if $(test-xfail-$(test-xfail-name)),true,false) \
+ $(if $(stop-on-test-failure),true,false) \
+ > $(common-objpfx)$(test-name).test-result
+
endif # Makeconfig not yet included
# Local Variables: