forked from stephens999/dscr
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (46 loc) · 2.25 KB
/
Makefile
File metadata and controls
59 lines (46 loc) · 2.25 KB
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
# Makefile automatically generated by dscr::update_makefile
# https://github.com/stephens999/dscr/issues/3
PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGVERS := $(shell sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION)
PKGSRC := $(shell basename `pwd`)
all: check clean
deps:
Rscript -e 'if (!require("devtools")) install.packages("devtools", repos="http://cran.rstudio.com")';\
Rscript -e 'if (!require("roxygen2")) install.packages("roxygen2", repos="http://cran.rstudio.com")';\
Rscript -e 'if (!require("knitr")) install.packages("knitr", repos="http://cran.rstudio.com")';\
Rscript -e 'if (!require("plyr")) install.packages("plyr", repos="http://cran.rstudio.com")';\
Rscript -e 'if (!require("psych")) install.packages("psych", repos="http://cran.rstudio.com")';\
Rscript -e 'if (!require("reshape2")) install.packages("reshape2", repos="http://cran.rstudio.com")';\
docs:
R -q -e 'library("devtools"); document(".", roclets=c("rd", "collate", "namespace"))'
build:
cd ..;\
R CMD build --no-manual $(PKGSRC)
build-cran:
cd ..;\
R CMD build $(PKGSRC)
install: build
cd ..;\
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz
check: build-cran
cd ..;\
R CMD check $(PKGNAME)_$(PKGVERS).tar.gz --as-cran
clean:
cd ..;\
$(RM) -r $(PKGNAME).Rcheck/
run-methods: install
cd inst/examples/one_sample_location || { echo "Running method: one_sample_location failed"; exit 1; } ;\
R -q -e 'library("dscr"); source("datamaker.R"); source("method.R"); source("score.R"); source("scenario.R"); source("rundsc.R")';\
# test before running since this involves recursive deletion
run-methods-clean:
cd inst/examples/one_sample_location || { echo "Cleaning method: one_sample_location failed"; exit 1; } ;\
R -q -e 'unlink(setdiff(list.files(), c("datamaker.R", "method.R", "score.R", "scenario.R", "rundsc.R")), recursive=TRUE)';\
.PHONY: vignettes
vignettes: install
cd vignettes;\
R -q -e 'library("knitr"); knit2html("one_sample_location.rmd"); browseURL("one_sample_location.html")';\
R -q -e 'library("knitr"); knit2html("dsc_shrink.rmd"); browseURL("dsc_shrink.html")';\
# test before running since this involves recursive deletion
.PHONY: vignettes-clean
vignettes-clean:
cd vignettes || { echo "Cannot find the vignettes directory"; exit 1; } ;\