blob: 8d2c0948d4ef05ce4eb38227bebcebed6ebd5f6a (
plain) (
blame)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
PKGSRC := $(shell basename $(CURDIR))
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
TGZ := $(PKGNAME)_$(PKGVERS).tar.gz
WINBIN := $(PKGNAME)_$(PKGVERS).zip
R_HOME ?= $(shell R RHOME)
DATE := $(shell date +%Y-%m-%d)
all: install
pkgfiles = DESCRIPTION \
README.html \
R/* \
inst/examples/*.R \
_pkgdown.yml \
tests/testthat.R \
tests/testthat/*
roxygen:
@echo "Roxygenizing package..."
"$(R_HOME)/bin/Rscript" -e 'library(devtools); document()'
@echo "DONE."
pd: roxygen
@echo "Building static documentation..."
"$(R_HOME)/bin/Rscript" -e 'pkgdown::build_site()'
@echo "DONE."
$(TGZ): $(pkgfiles)
@echo "Roxygenizing package..."
"$(R_HOME)/bin/Rscript" -e 'library(devtools); document()'
@echo "Building package..."
"$(R_HOME)/bin/R" CMD build .
@echo "DONE."
README.html: README.md
"$(R_HOME)/bin/Rscript" -e "rmarkdown::render('README.md', output_format = 'html_document')"
build: $(TGZ)
$(WINBIN): build
@echo "Building windows binary package..."
"$(R_HOME)/bin/R" CMD INSTALL $(TGZ) --build
@echo "DONE."
winbin: $(WINBIN)
test: build
@echo "Running testthat tests..."
"$(R_HOME)/bin/Rscript" -e 'library(devtools); devtools::test()' 2>&1 | tee test.log
sed -i -e "s/\r.*\r//" test.log
@echo "DONE."
quickcheck: build
@echo "Running check..."
_R_CHECK_CRAN_INCOMING_REMOTE_=false "$(R_HOME)/bin/R" CMD check $(TGZ) --no-tests
@echo "DONE."
check: build
@echo "Running CRAN check..."
_R_CHECK_CRAN_INCOMING_REMOTE_=false "$(R_HOME)/bin/R" CMD check --as-cran $(TGZ) --no-tests
@echo "DONE."
install: build
@echo "Installing package..."
"$(R_HOME)/bin/R" CMD INSTALL --no-multiarch $(TGZ)
@echo "DONE."
drat: build
"$(R_HOME)/bin/Rscript" -e "drat::insertPackage('$(TGZ)', commit = TRUE)"
dratwin: winbin
"$(R_HOME)/bin/Rscript" -e "drat::insertPackage('$(WINBIN)', 'e:/git/drat/', commit = TRUE)"
winbuilder: build
date
@echo "Uploading to R-release on win-builder"
curl -T $(TGZ) ftp://anonymous@win-builder.r-project.org/R-release/
@echo "Uploading to R-devel on win-builder"
curl -T $(TGZ) ftp://anonymous@win-builder.r-project.org/R-devel/
|