-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
51 lines (41 loc) · 1.46 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
R=R
# -> you can do R=R-devel make ....
PACKAGE=tmbstan
VERSION := $(shell sed -n '/^Version: /s///p' tmbstan/DESCRIPTION)
DATE := $(shell sed -n '/^Date: /s///p' tmbstan/DESCRIPTION)
TARBALL := $(PACKAGE)_$(VERSION).tar.gz
install:
R CMD INSTALL --preclean tmbstan
## TODO: Add this to tools/autogen.R
update-makevars:
rm -f tmbstan/src/Makevars
echo "rstantools:::.setup_Makevars('tmbstan')" | R --slave
test:
R --vanilla < test.R
doc-update: $(PACKAGE)/R/*.R
echo "library(roxygen2);roxygenize(\"$(PACKAGE)\",roclets = c(\"namespace\"))" | $(R) --slave
echo "library(roxygen2);roxygenize(\"$(PACKAGE)\",roclets = c(\"collate\", \"rd\"))" | $(R) --slave
build:
$(R) CMD build --resave-data=no $(PACKAGE)
check:
$(R) CMD check --as-cran $(TARBALL)
pdf:
rm -f $(PACKAGE).pdf
$(R) CMD Rd2pdf --no-preview $(PACKAGE)
cran-version:
cd tmbstan; git clean -xdf
#rm -rf tmbstan/tests
#mkdir -p tmbstan/tests
#cp test.R tmbstan/tests
make doc-update
make build
## Get a rough changelog since most recent github revision tag
## (Use as starting point when updating NEWS file)
## NOTE: Run *after* updating version and date in DESCRIPTION.
changelog:
echo; \
echo "------------------------------------------------------------------------"; \
echo tmbstan $(VERSION) \($(DATE)\); \
echo "------------------------------------------------------------------------"; \
echo; \
git --no-pager log --format="o %B" `git describe --abbrev=0 --tags`..HEAD | sed s/^-/\ \ -/g