-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 885 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (25 loc) · 885 Bytes
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
PKG_VERSION = $(shell grep -i ^version DESCRIPTION | cut -d : -d \ -f 2)
PKG_NAME = $(shell grep -i ^package DESCRIPTION | cut -d : -d \ -f 2)
INST_FILES := $(shell find inst -type f -print)
MAN_FILES := $(wildcard man/*.Rd)
R_FILES := $(wildcard R/*.R)
TEST_FILES := $(shell find tests -name '*.R')
PKG_FILES := DESCRIPTION NAMESPACE $(TEST_FILES) $(R_FILES) $(MAN_FILES) $(INST_FILES)
.PHONY: build check test lint install run clean
build: $(PKG_NAME)_$(PKG_VERSION).tar.gz
$(PKG_NAME)_$(PKG_VERSION).tar.gz: $(PKG_FILES)
R CMD build ./
check: $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD check --as-cran $<
test:
Rscript -e 'testthat::test_local()'
lint:
Rscript -e 'lintr::lint_package()'
install: $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD INSTALL $<
run: $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD INSTALL $<
R
clean:
-rm $(PKG_NAME)*.tar.gz
-rm -rf $(PKG_NAME).Rcheck