-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (38 loc) · 1.18 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# based on https://github.com/yihui/knitr/blob/master/Makefile
# prepare the package for release
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)
all: check
docs:
R -q -e 'library(Rd2roxygen); rab(".", build = FALSE)'
build:
cd ..;\
R CMD build --no-manual $(PKGSRC)
build-cran:
cd ..;\
R CMD build $(PKGSRC)
check: build-cran
cd ..;\
R CMD check $(PKGNAME)_$(PKGVERS).tar.gz --as-cran
install2: build
cd ..;\
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
install:
# identical to RStudio Install and Restart
cd ..;\
Rscript -e "devtools::document(pkg = '$(PKGNAME)', roclets = c('rd', 'collate', 'namespace'))";\
Rcmd.exe INSTALL --no-multiarch --with-keep.source $(PKGNAME)
pkgdown: README.md install
# build documentation website
Rscript -e "pkgdown::build_site(preview = TRUE)"
test:
Rscript -e "devtools::test()"
README.md: README.Rmd
# this command is not right because it generates HTML file
Rscript --vanilla -e 'library(rmarkdown);render("$<")'
gh-pages:
git subtree push --prefix docs origin docs
clean:
cd ..;\
$(RM) -r $(PKGNAME).Rcheck/