-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmakefile
40 lines (29 loc) · 1.06 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
VERSION:=$(shell grep Version: DESCRIPTION|sed 's/Version: //')
NAME:=$(shell grep Package: DESCRIPTION|sed 's/Package: //')
PACKAGEFILE:=../$(NAME)_$(VERSION).tar.gz
all: $(PACKAGEFILE) README.md docs
.PHONY: all install localInstall cranCheck
install:
R -e 'devtools::install_github("sherrillmix/$(NAME)")'
localInstall:
R -e 'devtools::install()'
cranCheck:
R -e 'rhub::check_for_cran()'
docs: man README.md DESCRIPTION
R -e 'chooseCRANmirror(ind=1);pkgdown::build_site()'
touch docs
man: R/*.R
R -e 'devtools::document()'
touch man
vignettes/usage.Rmd: usage.template README.Rmd
cp usage.template vignettes/usage.Rmd
sed -n '/\#\# Introduction/,$$p' README.Rmd >> vignettes/usage.Rmd
doc: vignettes/usage.Rmd
R -e 'devtools::build_vignettes()'
touch doc
README.md: README.Rmd R/*.R
make localInstall
R -e 'knitr::opts_chunk$$set(fig.path="README_files/");knitr::knit("README.Rmd")'
$(PACKAGEFILE): man R/*.R DESCRIPTION src/*.c tests/testthat/*.R doc
sed -i "s/^Date:.*$$/Date: `date +%Y-%m-%d`/" DESCRIPTION
R -e 'devtools::check();devtools::build()'