-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
42 lines (27 loc) · 1001 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
PKGNAME := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
PKGVER := $(shell grep '^Version:' DESCRIPTION | sed -E 's/^Version:[[:space:]]+//')
PKGDIR = $(shell basename $(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
RSCRIPT = Rscript --vanilla
%.md: %.Rmd
${RSCRIPT} -e 'rmarkdown::render("$<")'
README.md: vignettes/${PKGNAME}.Rmd NEWS.md references.md
references.md: references.bib
readme: README.md
document:
${RSCRIPT} -e "devtools::document()"
build: document readme
cd ..; R CMD build ${PKGDIR}
install: build
R CMD INSTALL ../${PKGNAME}_${PKGVER}.tar.gz
check: build
cd ..; R CMD check --as-cran --no-manual ${PKGNAME}_${PKGVER}.tar.gz
website:
${RSCRIPT} -e "pkgdown::build_site()"
clean:
${RSCRIPT} -e "pkgdown::clean_site()"
spellcheck:
${RSCRIPT} -e "devtools::spell_check()"
publish: install check clean website spellcheck
gh_pages: publish
./update_web.sh
.PHONY: readme document build install check website clean publish spellcheck