-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
62 lines (49 loc) · 1.38 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
51
52
53
54
55
56
57
58
59
60
61
62
objects := DESCRIPTION \
$(wildcard R/*.R) \
$(wildcard src/*.cpp) \
$(wildcard inst/include/*.h) \
$(wildcard inst/include/intsurv/*.h) \
$(wildcard inst/examples/*.R)
version := $(shell grep "Version" DESCRIPTION | awk '{print $$NF}')
pkg := $(shell grep "Package" DESCRIPTION | awk '{print $$NF}')
tar := $(pkg)_$(version).tar.gz
checkLog := $(pkg).Rcheck/00check.log
# tests := $(wildcard tests/testthat/*.R)
# rmd := vignettes/$(pkg)-intro.Rmd
# vignettes := vignettes/$(pkg)-intro.html
.PHONY: check
check: $(checkLog)
.PHONY: build
build: $(tar)
.PHONY: install
install: $(tar)
R CMD INSTALL $(tar)
# .PHONY: preview
# preview: $(vignettes)
$(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)
# $(vignettes): $(rmd)
# Rscript -e "rmarkdown::render('$(rmd)')"
.PHONY: pkgdown
pkgdown:
@Rscript -e "library(methods); pkgdown::build_site();"
## update copyright year in HEADER, R script and date in DESCRIPTION
.PHONY: updateTimestamp
updateTimestamp:
@bash misc/update_timestamp.sh
## make tags
.PHONY: TAGS
TAGS:
Rscript -e "utils::rtags(path = 'R', ofile = 'TAGS')"
gtags
## do some cleaning
.PHONY: clean
clean:
@$(RM) -rf *~ */*~ *.Rhistroy src/{*.o,*.so} *.tar.gz *.Rcheck/ .\#*