-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
32 lines (21 loc) · 870 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
PKG_VERSION=$(shell grep -i ^version ./DESCRIPTION | cut -d : -d \ -f 2)
PKG_NAME=$(shell grep -i ^package ./DESCRIPTION | cut -d : -d \ -f 2)
R_FILES := $(wildcard ./R/*.R)
PKG_FILES := ./DESCRIPTION ./NAMESPACE $(R_FILES) README.md
.PHONY: tarball install check clean roxygen
sourcetar:
zip -r ../$(PKG_NAME)_$(PKG_VERSION).zip $(PKG_FILES) man test
#zip -d $(PKG_NAME)_$(PKG_VERSION).zip .Rproj.user/*
tarball: $(PKG_NAME)_$(PKG_VERSION).tar.gz
$(PKG_NAME)_$(PKG_VERSION).tar.gz: $(PKG_FILES)
R CMD build .
all: check install
check: roxygen $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD check $(PKG_NAME)_$(PKG_VERSION).tar.gz
install: roxygen $(PKG_NAME)_$(PKG_VERSION).tar.gz
R CMD INSTALL $(PKG_NAME)_$(PKG_VERSION).tar.gz
roxygen:
Rscript -e "library(roxygen2);roxygenize('.')"
clean:
-rm -f $(PKG_NAME)_*.tar.gz
-rm -r -f $(PKG_NAME).Rcheck