-
Notifications
You must be signed in to change notification settings - Fork 45
/
Makefile
35 lines (26 loc) · 902 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
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)
all: check clean
man-docs:
R -e 'if(!require("devtools")) install.packages("devtools")'\
R -e 'devtools::document()'
html-docs:
R -e 'if(!require("rmarkdown")) install.packages("rmarkdown")'\
R -e 'rmarkdown::render("vignettes/guide.Rmd", "html_document", output_dir="/tmp")'
pdf-docs:
R -e 'if(!require("rmarkdown")) install.packages("rmarkdown")'\
R -e 'rmarkdown::render("vignettes/guide.Rmd", "pdf_document", output_dir="/tmp")'
build: man-docs
cd ..;\
R CMD build $(PKGSRC)
check: build
cd ..;\
R CMD check $(PKGNAME)_$(PKGVERS).tar.gz --as-cran
install: build
cd ..;\
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
clean:
$(RM) -rf inst/doc
cd ..;\
$(RM) -r $(PKGNAME).Rcheck/