1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#---*- Makefile -*-------------------------------------------------------------
#$Author: antanas $
#$Date: 2015-11-04 19:30:25 +0200 (Tr, 04 lapkr. 2015) $
#$Revision: 4195 $
#$URL: svn://www.crystallography.net/cod-tools/tags/v2.3/makefiles/Makelocal-benchmark $
#------------------------------------------------------------------------------
#*
# Benchmarks a script.
#**
# The following variables should be predefined in the Makeconf file:
# ${BENCH_SCRIPT}
# Full path to the benchmarked script.
# ${BENCH_DEPEND}
# Additional dependencies that should be assembled
# before carrying out the benchmarking.
# ${BENCH_FILES}
# List of files that should be used for the benchmarking.
BENCH_SCRIPT ?=
BENCH_DEPEND ?=
BENCH_FILES ?= ${wildcard *.inp}
SHELL = /bin/bash
.PHONY: all run times
all:
${BENCH_SCRIPT}: | ${BENCH_DEPEND}
run: ${BENCH_SCRIPT} ${BENCH_FILES}
@for file in ${BENCH_FILES}; do \
( \
echo === $$file ===; \
set -x; \
${BENCH_SCRIPT} < $$file \
); \
done
times: ${BENCH_SCRIPT} ${BENCH_FILES}
@for file in ${BENCH_FILES}; do \
( \
echo === $$file ===; \
set -x; \
time ${BENCH_SCRIPT} < $$file \
); \
done
|