-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 809 Bytes
/
Makefile
File metadata and controls
33 lines (26 loc) · 809 Bytes
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
objects := $(wildcard R/*.R) DESCRIPTION
dir := $(shell pwd)
version := $(shell grep "Version" DESCRIPTION | sed "s/Version: //")
pkg := $(shell grep "Package" DESCRIPTION | sed "s/Package: //")
tar := $(pkg)_$(version).tar.gz
checkLog := $(pkg).Rcheck/00check.log
.PHONY: check
check: $(checkLog)
.PHONY: build
build: $(tar)
$(tar): $(objects)
Rscript -e "library(methods); devtools::document();";
R CMD build $(dir)
$(checkLog): $(tar)
R CMD check --as-cran $(tar)
.PHONY: install
install: $(tar)
R CMD INSTALL $(tar)
## update copyright year in HEADER, R script and date in DESCRIPTION
.PHONY: updateDate
updateDate:
dt=$$(date +"%Y-%m-%d");\
sed -i "" "s/Date: [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/Date: $$dt/" DESCRIPTION;
.PHONY: clean
clean:
rm -rf *~ */*~ *.Rhistroy *.tar.gz *.Rcheck/ .\#*