-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (61 loc) · 2.34 KB
/
Makefile
File metadata and controls
70 lines (61 loc) · 2.34 KB
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
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make >=4.0)
endif
.RECIPEPREFIX = >
PKGNM := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)
RSCRIPT = Rscript --no-init-file
export _R_CHECK_SYSTEM_CLOCK_ = false
export _R_CHECK_FUTURE_FILE_TIMESTAMPS_ = false
all: dev_deps sentinels/check clean
.PHONY: all
dev_deps:
> ${RSCRIPT} -e "stopifnot(requireNamespace('DBI', quietly = TRUE))";\
> ${RSCRIPT} -e "stopifnot(requireNamespace('devtools', quietly = TRUE))";\
> ${RSCRIPT} -e "stopifnot(requireNamespace('knitr', quietly = TRUE))";\
> ${RSCRIPT} -e "stopifnot(requireNamespace('pkgdown', quietly = TRUE))";\
> ${RSCRIPT} -e "stopifnot(requireNamespace('pool', quietly = TRUE))";\
> ${RSCRIPT} -e "stopifnot(requireNamespace('rmarkdown', quietly = TRUE))";\
> ${RSCRIPT} -e "stopifnot(requireNamespace('RPostgres', quietly = TRUE))";\
> ${RSCRIPT} -e "stopifnot(requireNamespace('tinytest', quietly = TRUE))";
.PHONY: dev_deps
sentinels/check: sentinels/pkgdown $(shell find inst/tinytest -type f)
> cd ..;\
> R CMD check $(PKGNM)_$(PKGVERS).tar.gz;\
> cd $(PKGSRC);\
> mkdir -p $(@D);\
> touch $@
sentinels/pkgdown: sentinels/build README.md LICENSE _pkgdown.yml \
$(shell find pkgdown -type f)
> ${RSCRIPT} -e "options(yaml.eval.expr = TRUE); pkgdown::build_site()";\
> rm -rf docs/reference/Rplot001.png docs/deps/bootstrap-*/font*;\
> sed -i 's/@import url("font.css");//g' \
> docs/deps/bootstrap-*/bootstrap.min.css;\
> rm -rf docs/reference/Rplot001.png docs/dev/deps/bootstrap-*/font*;\
> sed -i 's/@import url("font.css");//g' \
> docs/dev/deps/bootstrap-*/bootstrap.min.css;\
> sed -i 's|dev/dev|dev|g' docs/dev/search.json docs/dev/sitemap.xml;\
> mkdir -p $(@D);\
> touch $@
sentinels/build: sentinels/doc
> cd ..;\
> R CMD build $(PKGSRC);\
> R CMD INSTALL $(PKGNM)_$(PKGVERS).tar.gz;\
> cd $(PKGSRC);\
> mkdir -p $(@D);\
> touch $@
sentinels/doc: $(shell find R -type f) DESCRIPTION
> ${RSCRIPT} -e "devtools::document()";\
> mkdir -p $(@D);\
> touch $@
clean:
> cd ..;\
> $(RM) -r $(PKGNM).Rcheck $(PKGNM)_$(PKGVERS).tar.gz
.PHONY: clean