forked from mschubert/clustermq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (38 loc) · 1011 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
47
48
49
50
.PHONY: all
all: rcpp doc vignettes
R = R --no-save --no-restore -e
BIN = $(abspath $(lastword $(MAKEFILE_LIST))/../tests/bin)
PKGVER = $(shell grep Version: < DESCRIPTION | sed "s/Version: //")
.PHONY: test
test:
PATH=$(BIN):$$PATH $(R) "devtools::test()"
.PHONY: check
check:
PATH=$(BIN):$$PATH $(R) "devtools::check()"
.PHONY: rcpp
rcpp:
$(R) "Rcpp::compileAttributes()"
rmd_files=$(wildcard vignettes/*.rmd)
knit_results=$(patsubst vignettes/%.rmd,inst/doc/%.md,$(rmd_files))
.PHONY: vignettes
vignettes: inst/doc ${knit_results}
$(R) "library(knitr); library(devtools); build_vignettes()"
inst/doc:
mkdir -p $@
inst/doc/%.md: vignettes/%.rmd
$(R) "knitr::knit('$<', '$@')"
.PHONY: doc
doc:
$(R) "devtools::document()"
.PHONY: package
package: rcpp doc vignettes
./src/util/patch_libzmq.sh
PATH=$(BIN):$$PATH R CMD build .
R CMD check --as-cran clustermq_$(PKGVER).tar.gz
.PHONY: deploy
deploy:
$(R) "pkgdown::deploy_to_branch()"
.PHONY: clean
clean:
${RM} -r inst/doc
${RM} -r man