summaryrefslogtreecommitdiff
path: root/libc/Rules
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-03-18 16:44:23 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2013-03-18 16:44:23 +0000
commit8751114637bcc3caaf16a4216da0afb84456558a (patch)
treef3eca66b88003bc49c309a95827d461ae5b66aed /libc/Rules
parentb261131fe2b94b53fe4950d9265ae10bef228455 (diff)
downloadeglibc2-8751114637bcc3caaf16a4216da0afb84456558a.tar.gz
Merge changes between r22552 and r22663 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@22664 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/Rules')
-rw-r--r--libc/Rules27
1 files changed, 26 insertions, 1 deletions
diff --git a/libc/Rules b/libc/Rules
index 301a74818..bc5dacd2f 100644
--- a/libc/Rules
+++ b/libc/Rules
@@ -83,7 +83,7 @@ common-generated += dummy.o dummy.c
# This makes all the auxiliary and test programs.
-.PHONY: others tests
+.PHONY: others tests bench
ifeq ($(multi-arch),no)
tests := $(filter-out $(tests-ifunc), $(tests))
xtests := $(filter-out $(xtests-ifunc), $(xtests))
@@ -188,6 +188,31 @@ $(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.
$(make-test-out) > $@
endif # tests
+
+# Build and run benchmark programs.
+binaries-bench := $(addprefix $(objpfx)bench-,$(bench))
+
+run-bench = $(test-wrapper-env) \
+ GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
+ $($*-ENV) $(run-via-rtld-prefix) $${run}
+
+bench: $(binaries-bench)
+ if [ -f $(objpfx)bench.out ]; then \
+ mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
+ fi
+ for run in $^; do \
+ eval $(run-bench) >> $(objpfx)bench.out; \
+ done
+
+$(binaries-bench): %: %.o \
+ $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+ $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+ $(+link)
+
+$(objpfx)bench-%.c: %-inputs bench-skeleton.c
+ $(..)scripts/bench.pl $(patsubst %-inputs,%,$<) \
+ $($*-ITER) $($*-ARGLIST) $($*-RET) > $@
+
.PHONY: distclean realclean subdir_distclean subdir_realclean \
subdir_clean subdir_mostlyclean subdir_testclean