-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
59 lines (48 loc) · 1.45 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
# prepare the package for release
NEWS = NEWS
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)
DATE := $(shell date +%F)
VERSION := $(shell ./tools/convertversion.sh)
UNAME := $(shell uname -s)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(UNAME),Darwin)
WGET := curl -O
else
WGET := WGET
endif
all: update check clean
alldev: update checkdevel cleandevel
build:
cd ..;\
R CMD build $(PKGSRC) --resave-data --compact-vignettes=gs+qpdf
install: build
cd ..;\
R CMD INSTALL $(PKGNAME)_$(VERSION).tar.gz
check: build
cd ..;\
R CMD check $(PKGNAME)_$(VERSION).tar.gz --as-cran
clean:
cd ..;\
$(RM) -r $(PKGNAME).Rcheck/
cleandevel:
cd ..;\
$(RM) -r R-devel*
branchup:
perl -pi -e "s/branch=.+?\)/branch=$(BRANCH))/g" README.md
# Make files do not like a $ there, so you have to double it to escape.
update: branchup
perl -pi -e "s/^Date:.+?$$/Date: $(DATE)/" DESCRIPTION
rm -fv vignettes/*bbl
rm -fv vignettes/*toc
rm -fv vignettes/*log
perl -p -i -e "s/^Version: .*$$/Version: $(VERSION)/" DESCRIPTION
checkdevel: build
cd ..;\
$(WGET) ftp://ftp.stat.math.ethz.ch/Software/R/R-devel.tar.gz;\
tar -xzvf R-devel.tar.gz;\
cd R-devel;\
./configure;\
make;\
bin/./R -e Rscript -e 'library("devtools"); library("methods"); options(repos=c(CRAN="http://cran.rstudio.com")); install_deps("../poppr", dependencies = TRUE)';\
bin/./R CMD check ../$(PKGNAME)_$(VERSION).tar.gz --as-cran