aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 552aa5398e57301669ab12e7ff215b7d870f20af (plain)
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
.PHONY: vignettes
NAME = $(shell grep 'Package:' DESCRIPTION | cut -d ' ' -f2)
VER = $(shell grep 'Version:' DESCRIPTION | cut -d ' ' -f2)

install:
	R CMD INSTALL .

build:
	Rscript -e "Rcpp::compileAttributes()"
	make document
	cd ..; R CMD build $(NAME)

check:
	Rscript -e "devtools::check()"

test:
	Rscript -e "options(testthat.progress.max_fails=30); devtools::test()"

document:
	Rscript -e "devtools::document()"

README:
	Rscript -e "rmarkdown::render('README.Rmd')"
	pandoc README.md -o README.html
	firefox README.html
	sleep 3
	rm README.html

vignettes: vignettes/random-effects.Rmd vignettes/JAGS-comparison.Rmd vignettes/spatial-models.Rmd vignettes/grouse-example.Rmd
	touch test.png; mv *.png vignettes; rm vignettes/test.png
	Rscript -e "devtools::build_vignettes()"

site:
	Rscript -e "pkgdown::build_site()"
	firefox docs/index.html

clean:
	rm -r src/*.o
	rm -r src/*.so

clean-install:
	R CMD INSTALL --preclean .

coverage:
	Rscript -e \
		'Sys.setenv(NOT_CRAN="true"); covr::report(file="/tmp/ubms-report.html")'
	firefox /tmp/ubms-report.html

vignettes/random-effects.Rmd: vignettes/random-effects.Rmd.orig
	Rscript -e "knitr::knit('vignettes/random-effects.Rmd.orig', output='vignettes/random-effects.Rmd')"

vignettes/JAGS-comparison.Rmd: vignettes/JAGS-comparison.Rmd.orig
	Rscript -e "knitr::knit('vignettes/JAGS-comparison.Rmd.orig', output='vignettes/JAGS-comparison.Rmd')"

vignettes/spatial-models.Rmd: vignettes/spatial-models.Rmd.orig
	Rscript -e "knitr::knit('vignettes/spatial-models.Rmd.orig', output='vignettes/spatial-models.Rmd')"

vignettes/grouse-example.Rmd: vignettes/grouse-example.Rmd.orig
	Rscript -e "knitr::knit('vignettes/grouse-example.Rmd.orig', output='vignettes/grouse-example.Rmd')"