-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (39 loc) · 1.29 KB
/
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
PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
RSCRIPT = Rscript --no-init-file
all: compile
compile:
${RSCRIPT} -e 'library(methods); devtools::compile_dll()'
test:
${RSCRIPT} -e 'library(methods); devtools::test()'
roxygen:
@mkdir -p man
${RSCRIPT} -e "library(methods); devtools::document()"
install:
R CMD INSTALL .
build:
R CMD build .
check:
_R_CHECK_CRAN_INCOMING_=FALSE make check_all
check_all:
${RSCRIPT} -e "rcmdcheck::rcmdcheck(args = c('--as-cran', '--no-manual'))"
README.md: README.Rmd
Rscript -e "options(warnPartialMatchArgs=FALSE); knitr::knit('$<')"
sed -i.bak 's/[[:space:]]*$$//' README.md
rm -f [email protected] myfile.json
.PHONY: all test document install vignettes
vignettes/%.Rmd: vignettes/src/%.R
${RSCRIPT} -e 'library(sowsear); sowsear("$<", output="$@")'
## This will eventually swap out for devtools::build_vignettes(), but
## in current version it's not working when offline. For now I'll
## just do the copy manually.
vignettes:
${RSCRIPT} -e 'tools::buildVignettes(dir = ".")'
mkdir -p inst/doc
cp vignettes/*.html vignettes/*.Rmd inst/doc
staticdocs:
@mkdir -p inst/staticdocs
${RSCRIPT} -e "library(methods); staticdocs::build_site()"
rm -f vignettes/*.html
@rmdir inst/staticdocs
website: staticdocs
./update_web.sh