From ac55fd90e809e5af502cf73aac54428f2e5566a3 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 9 Dec 2010 22:30:18 +0100 Subject: [PATCH] Update Makefile to regenerate graph only when some dependency changes --- gw-tests/Makefile | 33 ++++++++++++++++++++------------- gw-tests/nop-highprio-time.sh | 10 +++++----- gw-tests/nop-time.sh | 10 +++++----- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/gw-tests/Makefile b/gw-tests/Makefile index e1f22ec..c042d2f 100644 --- a/gw-tests/Makefile +++ b/gw-tests/Makefile @@ -1,27 +1,34 @@ T=$(filter-out lib.sh,$(wildcard *.sh)) -.PHONY: $(T) +.PHONY: $(T:%=run-%) -all: $(T) html +all: $(T:%=run-%) html @echo "Run 'make plot' to generate graphs" TEST_FLAGS = -P -t all -$(T):%: - ./$@ $(TEST_FLAGS) +$(T:%=run-%):run-%: + ./$* $(TEST_FLAGS) .PHONY: plot plotall -PLOT_SCRIPTS=$(shell find results -name plot.sh) -THUMBS=$(PLOT_SCRIPTS:%/plot.sh=%/thumb) -plot: $(THUMBS) -%/thumb: %/plot.sh - $*/plot.sh -X - -plotall: $(PLOT_SCRIPTS:%=run-%) -$(PLOT_SCRIPTS:%=run-%): - ${@:run-%=%} -X +PLOT_SCRIPTS=$(shell find results -name plot.sh) +define plot_template +plot: $1/thumb +$1/thumb: $1/plot.sh $(notdir $1).sh $(wildcard $1/*.txt) + $1/plot.sh -X +endef + +define plotall_template +plotall: plot-$1 +.PHONY: plot-$1 +plot-$1: + $1/plot.sh -X +endef + +$(foreach result_dir,$(PLOT_SCRIPTS:%/plot.sh=%),$(eval $(call plot_template,$(result_dir)))) +$(foreach result_dir,$(PLOT_SCRIPTS:%/plot.sh=%),$(eval $(call plotall_template,$(result_dir)))) .PHONY: html html: diff --git a/gw-tests/nop-highprio-time.sh b/gw-tests/nop-highprio-time.sh index e1f8537..0d13e9a 100755 --- a/gw-tests/nop-highprio-time.sh +++ b/gw-tests/nop-highprio-time.sh @@ -3,7 +3,7 @@ . lib.sh main() { - : + ln -s ../nop-highprio/*.txt . } plot_cmds() { @@ -13,10 +13,10 @@ set grid set xlabel "Time [s]" set ylabel "Latency [{/Symbol m}s]" plot [:] [:500] \ - "../nop-highprio/len2-msgs.txt" using 2:(1000000*$14) with points title "2 byte messages", \ - "../nop-highprio/len4-msgs.txt" using 2:(1000000*$14) with points title "4 byte messages", \ - "../nop-highprio/len6-msgs.txt" using 2:(1000000*$14) with points title "6 byte messages", \ - "../nop-highprio/len8-msgs.txt" using 2:(1000000*$14) with points title "8 byte messages" + "len2-msgs.txt" using 2:(1000000*$14) with points title "2 byte messages", \ + "len4-msgs.txt" using 2:(1000000*$14) with points title "4 byte messages", \ + "len6-msgs.txt" using 2:(1000000*$14) with points title "6 byte messages", \ + "len8-msgs.txt" using 2:(1000000*$14) with points title "8 byte messages" EOF } diff --git a/gw-tests/nop-time.sh b/gw-tests/nop-time.sh index 627fb13..007542d 100755 --- a/gw-tests/nop-time.sh +++ b/gw-tests/nop-time.sh @@ -3,7 +3,7 @@ . lib.sh main() { - : + ln -s ../nop-highprio/*.txt . } plot_cmds() { @@ -13,10 +13,10 @@ set grid set xlabel "Time [s]" set ylabel "Latency [{/Symbol m}s]" plot [:] [:500] \ - "../nop/len2-msgs.txt" using 2:(1000000*$14) with points title "2 byte messages", \ - "../nop/len4-msgs.txt" using 2:(1000000*$14) with points title "4 byte messages", \ - "../nop/len6-msgs.txt" using 2:(1000000*$14) with points title "6 byte messages", \ - "../nop/len8-msgs.txt" using 2:(1000000*$14) with points title "8 byte messages" + "len2-msgs.txt" using 2:(1000000*$14) with points title "2 byte messages", \ + "len4-msgs.txt" using 2:(1000000*$14) with points title "4 byte messages", \ + "len6-msgs.txt" using 2:(1000000*$14) with points title "6 byte messages", \ + "len8-msgs.txt" using 2:(1000000*$14) with points title "8 byte messages" EOF } -- 2.39.2