-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
75 lines (55 loc) · 1.92 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
RSCRIPT = Rscript
all: install
test:
Rscript -e 'library(methods); devtools::test()'
test_all:
REMAKE_TEST_INSTALL_PACKAGES=true make test
roxygen:
@mkdir -p man
${RSCRIPT} -e "library(methods); devtools::document()"
install:
R CMD INSTALL .
build:
R CMD build .
build_quick:
R CMD build --no-manual .
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 $@.bak
## We can't build vignettes on CRAN and systems without docker (and
## even when they do, it's not a great idea because we build and
## remove a bunch of containers etc.
vignettes_src/%.Rmd: vignettes_src/%.R
${RSCRIPT} -e 'library(sowsear); sowsear("$<", output="$@")'
vignettes/stevedore.Rmd: vignettes_src/stevedore.Rmd
cd vignettes_src && ${RSCRIPT} -e 'knitr::knit("stevedore.Rmd")'
mv vignettes_src/stevedore.md $@
sed -i.bak 's/[[:space:]]*$$//' $@
rm -f $@.bak
vignettes/examples.Rmd: vignettes_src/examples.Rmd
cd vignettes_src && ${RSCRIPT} -e 'knitr::knit("examples.Rmd")'
mv vignettes_src/examples.md $@
sed -i.bak 's/[[:space:]]*$$//' $@
rm -f $@.bak
vignettes/cookbook.Rmd: vignettes_src/cookbook.Rmd
cd vignettes_src && ${RSCRIPT} -e 'knitr::knit("cookbook.Rmd")'
mv vignettes_src/cookbook.md $@
sed -i.bak 's/[[:space:]]*$$//' $@
rm -f $@.bak
vignettes_install: vignettes/stevedore.Rmd vignettes/examples.Rmd vignettes/cookbook.Rmd
${RSCRIPT} -e 'library(methods); devtools::build_vignettes()'
vignettes:
make vignettes_install
pkgdown:
${RSCRIPT} -e "library(methods); pkgdown::build_site(lazy = TRUE)"
website: pkgdown
./scripts/update_web.sh
specs:
Rscript ./scripts/download_spec.R
.PHONY: all test document install vignettes