-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
69 lines (52 loc) · 1.61 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
63
64
65
66
67
68
PACKAGE=spict
R=R
VERSION=`grep "Version" spict/DESCRIPTION | grep -oi '[0-9.]*'`
SUBDIRS := $(wildcard testmore/*/.)
TARBALL=${PACKAGE}_${VERSION}.tar.gz
ifeq (testonemore,$(firstword $(MAKECMDGOALS)))
ARG := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(ARG):;@:)
endif
all:
make doc-update
make install
make pdf
doc-update:
echo "roxygen2::roxygenize('spict/', roclets=c('rd', 'collate', 'namespace'))" | R --slave
#echo "library(roxygen2);roxygenize(\"$(PACKAGE)\",roclets = c(\"collate\", \"rd\"))" | R --slave
build-package:
echo 'source("make.description.R")' | R --vanilla
R CMD build --no-build-vignettes --resave-data=no $(PACKAGE)
install:
make build-package
echo 'remotes::install_deps("spict")' | R --vanilla
R CMD INSTALL --preclean --no-multiarch $(TARBALL)
date
unexport TEXINPUTS
pdf:
rm -f $(PACKAGE).pdf
R CMD Rd2pdf --no-preview $(PACKAGE)
check:
R CMD check $(PACKAGE)
quick-install: $(PACKAGE)/src/spict.so
$(R) CMD INSTALL $(PACKAGE)
$(PACKAGE)/src/spict.so: $(PACKAGE)/src/spict.cpp
cd $(PACKAGE)/src; echo "library(TMB); compile('spict.cpp','-O0 -g')" | $(R) --slave
vignette:
for f in spict/vignettes/*.Rmd; do \
R -e "library(rmarkdown); render('$$f', 'all')"; \
done
mkdir -p spict/inst/doc
mv spict/vignettes/*.pdf spict/inst/doc/
mv spict/vignettes/*.html spict/inst/doc/
cp spict/vignettes/*.Rmd spict/inst/doc/
.PHONY: testmoreseq testonemore testmore $(SUBDIRS)
testmore:
$(MAKE) -j $(NPROCS) testmoreseq
testmoreseq: $(SUBDIRS)
testonemore:
@$(MAKE) testmore/$(ARG)/.
$(SUBDIRS):
@cp testmore/Makefile $@
@$(MAKE) -i -s -C $@
@rm -f $@/Makefile