-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinc.mk
39 lines (30 loc) · 832 Bytes
/
inc.mk
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
PDFCHECK = $(rrd)/pdfcheck.pl
RR = $(rrd)/Rprep.pl
CW = $(rrd)/cw.pl
Rtrim = $(rrd)/Rtrim.pl
define run-R
perl -f $(RR) $@ $^ > $(@:.Rout=.RR)
( (R --vanilla --args $($(@:.Rout=.Rargs)) < $(@:.Rout=.RR) > $(@:.Rout=.dmp)) 2> $(@:.Rout=.Rlog) && cat $(@:.Rout=.Rlog) ) || ! cat $(@:.Rout=.Rlog)
perl -wf $(PDFCHECK) [email protected]
perl -wf $(Rtrim) $(@:.Rout=.dmp) > $@
$(RM) $(@:.Rout=.dmp)
endef
.PRECIOUS: %.summary.Rout
%.summary.Rout: %.Rout $(rrd)/summary.R
$(run-R)
.PRECIOUS: %.objects.Rout
%.objects.Rout: %.Rout $(rrd)/objects.R
$(run-R)
# This one always works before the one below it
.PRECIOUS: %.Rout
%.Rout: %.R
$(run-R)
.PRECIOUS: %.Rout.pdf
%.Rout.pdf: %.Rout ;
%.Rout.png: %.Rout.pdf
/bin/rm -f $@
convert $<[0] $@
%.Routput: %.Rout
perl -f $(rrd)/Rcalc.pl $< > $@
.PRECIOUS: %.RData
%.RData: %.Rout ;