Skip to content

Commit

Permalink
Move bench target to benchtests
Browse files Browse the repository at this point in the history
The bench target will only be used within the benchtests directory.
  • Loading branch information
siddhesh committed Apr 12, 2013
1 parent 0a033d3 commit 8fc1bee
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-04-12 Siddhesh Poyarekar <[email protected]>

* Rules (bench): Move target definition...
* benchtests/Makefile: ... here.

2013-04-11 Carlos O'Donell <[email protected]>

* math/libm-test.inc (cos_test): Fix PI/2 test.
Expand Down
30 changes: 0 additions & 30 deletions Rules
Original file line number Diff line number Diff line change
Expand Up @@ -189,36 +189,6 @@ $(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.

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) $(rtld-prefix) $${run}

bench: $(binaries-bench)
for run in $^; do \
echo "Running $${run}"; \
$(run-bench) >> $(objpfx)bench.out-tmp; \
done; \
if [ -f $(objpfx)bench.out ]; then \
mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
fi; \
mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out

$(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
{ if [ -n "$($*-INCLUDE)" ]; then \
cat $($*-INCLUDE); \
fi; \
$(..)scripts/bench.pl $(patsubst %-inputs,%,$<) \
$($*-ITER) $($*-ARGLIST) $($*-RET); } > $@-tmp
mv -f $@-tmp $@


.PHONY: distclean realclean subdir_distclean subdir_realclean \
subdir_clean subdir_mostlyclean subdir_testclean
Expand Down
34 changes: 34 additions & 0 deletions benchtests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,39 @@ slowatan-RET = double
slowatan-INCLUDE = slowatan.c
LDFLAGS-bench-slowatan = -lm



# Rules to build and execute the benchmarks. Do not put any benchmark
# parameters beyond this point.

include ../Makeconfig
include ../Rules

binaries-bench := $(addprefix $(objpfx)bench-,$(bench))

run-bench = $(test-wrapper-env) \
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
$($*-ENV) $(rtld-prefix) $${run}

bench: $(binaries-bench)
for run in $^; do \
echo "Running $${run}"; \
$(run-bench) >> $(objpfx)bench.out-tmp; \
done; \
if [ -f $(objpfx)bench.out ]; then \
mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
fi; \
mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out

$(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
{ if [ -n "$($*-INCLUDE)" ]; then \
cat $($*-INCLUDE); \
fi; \
$(..)scripts/bench.pl $(patsubst %-inputs,%,$<) \
$($*-ITER) $($*-ARGLIST) $($*-RET); } > $@-tmp
mv -f $@-tmp $@

0 comments on commit 8fc1bee

Please sign in to comment.