-
Notifications
You must be signed in to change notification settings - Fork 0
/
support.makefile
58 lines (39 loc) · 1.44 KB
/
support.makefile
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
49
50
51
52
53
54
55
56
57
58
${MKDIRS}:
mkdir -p $@
alldirs: ${MKDIRS}
alllibs: ${GITLIBS}
# will copy example.makefile for a locally edited copy
egcopy: | example.makefile
cp $| local.makefile
# DATA FETCHING DEFINITION; USE AS ${WGET} ${THEURL}
WGET = wget -c -O $@
# ASSORTED CONVENIENCE DEFINITIONS FOR R-RELATED RULES
# get path to Rscript; complain if undefined
RSCRIPT := $(shell which Rscript)
# the following define common rule arrangements
# assumes first dependency is something.R, called with other dependencies ($^) &
# the target ($@) as arguments
R = ${RSCRIPT} $^ $@
# for pattern matching rules, to pass the match (rather than extracting it from $@)
Rstar = ${RSCRIPT} $^ $* $@
# for with pipe dependencies
Rpipe = ${RSCRIPT} $^ $| $@
# star + pipe
Rsp = ${RSCRIPT} $^ $* $| $@
FROMDIR ?= override/path/on/commandline
FORCE:
xfer: | ${FROMDIR}
rsync -rv $|/ ${SINK}
# intended to be used as $(call alliso,PATH,MIME)
alliso = $(patsubst %,$(1)/%.$(2),${ISOS})
# default assumption: covidm is the version shipped with this repository
# but could be defined to live elsewhere in local.makefile
COVIDM ?= ${PROJRT}/covidm
COVIDMGIT := git@github.com:nicholasdavies/covidm.git
# TODO correct these - seems to clone in this folder instead?
${COVIDM}:
cd $(dir $@); git -C $(notdir $@) pull || git clone --single-branch --branch ngmupdate ${COVIDMGIT} $(notdir $@)
rsync: | ${DATART}
rsync -av ${HPCDIR} ${DATART}
rsyncavn: | ${DATART}
rsync -avn ${HPCDIR} ${DATART}