From 31e3d12df7eabb3463b7317a8b32d3eae93ab9bc Mon Sep 17 00:00:00 2001
From: Christian Krause <christian.krause@idiv.de>
Date: Wed, 5 Jun 2019 13:20:10 +0200
Subject: [PATCH] uses the r scripts main sources for plotting

The CSV file can also be used for the table inclusion. It's more
flexible basing the target on the R script and using the CSV as an
additional requirement of the target. This way, if you want to remove
plotting because you don't need it, you just need to remove the R script
and don't need to do anything else. You can then still use the CSV file
as the source for a table.
---
 img/plot/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/img/plot/Makefile b/img/plot/Makefile
index 12005f2..ac60ce6 100644
--- a/img/plot/Makefile
+++ b/img/plot/Makefile
@@ -1,16 +1,16 @@
-SOURCES_CSV = $(wildcard *.csv)
+SOURCES_R = $(wildcard *.R)
 
-OBJECTS_CSV_SVG = $(SOURCES_CSV:.csv=.svg)
+OBJECTS_R_SVG = $(SOURCES_R:.R=.svg)
 
 OBJECTS = \
-	$(OBJECTS_CSV_SVG) \
+	$(OBJECTS_R_SVG) \
 
 all: $(OBJECTS)
 
 $(OBJECTS):
 
-%.svg: %.csv
-	Rscript --vanilla $*.R
+%.svg: %.R %.csv
+	Rscript --vanilla $<
 
 clean:
 	rm -f $(OBJECTS)
-- 
GitLab