-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
46 lines (36 loc) · 1009 Bytes
/
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
objects := $(wildcard R/*.R) DESCRIPTION
version := $(shell egrep "^Version:" DESCRIPTION | awk '{print $$NF}')
pkg := $(shell egrep "^Package:" DESCRIPTION | awk '{print $$NF}')
tar := $(pkg)_$(version).tar.gz
checkLog := $(pkg).Rcheck/00check.log
.PHONY: check
check: $(checkLog)
.PHONY: build
build: $(tar)
.PHONY: install
install: $(tar)
R CMD INSTALL $(tar)
.PHONY: pkgdown
pkgdown:
Rscript -e "library(methods); pkgdown::build_site();"
$(tar): $(objects)
@$(RM) -rf src/RcppExports.cpp R/RcppExports.R
@Rscript -e "library(methods);" \
-e "Rcpp::compileAttributes()" \
-e "devtools::document();";
R CMD build .
$(checkLog): $(tar)
R CMD check $(tar)
.PHONY: check-as-cran
check-as-cran: $(tar)
R CMD check --as-cran $(tar)
.PHONY: readme
readme: README.md
README.md: README.Rmd
@Rscript -e "rmarkdown::render('$<')"
.PHONY: TAGS
TAGS:
Rscript -e "utils::rtags(path = 'R', ofile = 'TAGS')"
.PHONY: clean
clean:
@$(RM) -rf *~ */*~ *.Rhistroy *.tar.gz src/*.so src/*.o *.Rcheck/ .\#*