forked from yihui/knitr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (49 loc) · 1.71 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
# prepare the package for release
NEWS = NEWS
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename $(PWD))
all: news check clean
# convert markdown to R's NEWS format
news: $(NEWS)
sed -e 's/^-/ -/' -e 's/^## *//' -e 's/^#/\t\t/' <NEWS.md | fmt -80 >$(NEWS)
deps:
Rscript -e 'if (!require("Rd2roxygen")) install.packages("Rd2roxygen", repos="http://cran.r-project.org")'
docs:
R -q -e 'library(Rd2roxygen); rab(".", build = FALSE)'
build: docs
cd ..;\
R CMD build $(PKGSRC)
install: build
cd ..;\
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
check: build
cd ..;\
R CMD check $(PKGNAME)_$(PKGVERS).tar.gz --as-cran
examples:
cd inst/examples;\
Rscript knit-all.R
vignettes:
cd inst/doc;\
lyx -e knitr knitr-intro.lyx;\
lyx -e knitr knitr-refcard.lyx
# the svn mirror created by
# svn co svn://svn.rforge.net/knitr/trunk knitr-svn
# commit everything to RForge.net
svn:
git archive master > ../knitr.tar;\
cd ../knitr-svn && rm -r `ls` && tar -xf ../knitr.tar;\
svn add --force . && svn commit -m 'sync with git'
# another svn mirror from
# svn checkout svn+ssh://[email protected]/svnroot/isu/pkg/knitr knitr-rforge
rforge:
git archive master > ../knitr.tar;\
cd ../knitr-rforge && rm -r `ls` && tar -xf ../knitr.tar;\
svn add --force . && svn commit -m 'sync with git'
downstream:
Rscript -e "source('http://developer.r-project.org/CRAN/Scripts/depends.R');" \
-e "x = reverse_dependencies_with_maintainers('knitr', c('Depends', 'Imports', 'LinkingTo', 'Suggests'))" \
-e "cat('\n'); cat(unique(x[, 'Maintainer']), sep = ', \n'); cat('\n')"
clean:
cd ..;\
$(RM) -r $(PKGNAME).Rcheck/