-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (40 loc) · 1.07 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
objects := $(wildcard R/*.R) DESCRIPTION
version := $(shell grep -E "^Version:" DESCRIPTION | awk '{print $$NF}')
pkg := $(shell grep -E "^Package:" DESCRIPTION | awk '{print $$NF}')
tar := $(pkg)_$(version).tar.gz
checkLog := $(pkg).Rcheck/00check.log
.PHONY: check
check: $(checkLog)
.PHONY: build
build: $(tar)
.PHONY: install
install: $(tar)
R CMD INSTALL $(tar)
.PHONY: pkgdown
pkgdown:
Rscript -e "library(methods); pkgdown::build_site();"
$(tar): $(objects)
@$(RM) -rf src/RcppExports.cpp R/RcppExports.R
@Rscript -e "library(methods);" \
-e "Rcpp::compileAttributes()" \
-e "devtools::document();";
@$(MAKE) updateTimestamp
R CMD build .
$(checkLog): $(tar)
R CMD check --as-cran $(tar)
.PHONY: readme
readme: README.md
README.md: README.Rmd
@Rscript -e "rmarkdown::render('$<')"
.PHONY: updateTimestamp
updateTimestamp:
@bash misc/update_timestamp.sh
## make tags
.PHONY: tags
tags:
Rscript -e "utils::rtags(path = 'R', ofile = 'TAGS')"
gtags
.PHONY: clean
clean:
@$(RM) -r *~ */*~ *.Rhistroy *.tar.gz src/*.so src/*.o src/*.o.tmp \
*.Rcheck/ *.Rout .\#* *_cache