]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Update Makefile to regenerate graph only when some dependency changes
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 9 Dec 2010 21:30:18 +0000 (22:30 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 9 Dec 2010 21:30:18 +0000 (22:30 +0100)
gw-tests/Makefile
gw-tests/nop-highprio-time.sh
gw-tests/nop-time.sh

index e1f22ec810f42447431a4210d074c6086065d84b..c042d2faeaaef81287d3edae108fe7c57aab87f1 100644 (file)
@@ -1,27 +1,34 @@
 T=$(filter-out lib.sh,$(wildcard *.sh))
 
 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
 
        @echo "Run 'make plot' to generate graphs"
 
 TEST_FLAGS = -P -t all
 
-$(T):%:
-       ./$@ $(TEST_FLAGS)
+$(T:%=run-%):run-%:
+       ./$* $(TEST_FLAGS)
 
 .PHONY: plot plotall
 
 .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:
 
 .PHONY: html
 html:
index e1f8537e4d09582358b924e885868dfa9e522bd6..0d13e9a2437602c651978bf69caaa5fd11f1390c 100755 (executable)
@@ -3,7 +3,7 @@
 . lib.sh
 
 main() {
 . lib.sh
 
 main() {
-       :
+       ln -s ../nop-highprio/*.txt .
 }
 
 plot_cmds() {
 }
 
 plot_cmds() {
@@ -13,10 +13,10 @@ set grid
 set xlabel "Time [s]"
 set ylabel "Latency [{/Symbol m}s]"
 plot [:] [:500] \
 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
 }
     
 EOF
 }
     
index 627fb131dabe7dc54e24c1a97da02d61f5289baf..007542dd9350458a6e7b4541016f711c78cce1f5 100755 (executable)
@@ -3,7 +3,7 @@
 . lib.sh
 
 main() {
 . lib.sh
 
 main() {
-       :
+       ln -s ../nop-highprio/*.txt .
 }
 
 plot_cmds() {
 }
 
 plot_cmds() {
@@ -13,10 +13,10 @@ set grid
 set xlabel "Time [s]"
 set ylabel "Latency [{/Symbol m}s]"
 plot [:] [:500] \
 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
 }
     
 EOF
 }