Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
R := R
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly to help with alternate R installations one may want to install this on


.PHONY: all build check document test

all: document build check

build: document
R CMD build .
$(R) CMD build .

check: build
R CMD check injectr*tar.gz
$(R) CMD check injectr*tar.gz

clean:
-rm -f injectr*tar.gz
-rm -fr injectr.Rcheck
-rm -fr src/*.{o,so}

document: clean
Rscript -e 'devtools::document()'
Rscript -e 'rmarkdown::render("README.Rmd")'
document: clean install-devtools install-rmarkdown
$(R) -s -e 'devtools::document()'
$(R) -s -e 'rmarkdown::render("README.Rmd")'

test:
Rscript -e 'devtools::test()'
test: install-devtools
$(R) -s -e 'devtools::test()'

install: clean
R CMD INSTALL .
$(R) CMD INSTALL .

install-devtools:
$(R) -s -e "if (!require('devtools')) install.packages('devtools', repos = 'http://cran.rstudio.com/')"

install-rmarkdown:
$(R) -s -e "if (!require('rmarkdown')) install.packages('rmarkdown', repos = 'http://cran.rstudio.com/')"