-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (27 loc) · 1.09 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
VERSION:=$(shell Rscript -e 'x<-readLines("DESCRIPTION");cat(gsub(".+[:]\\s*", "", x[grepl("^Vers", x)]))')
PKGNAME:=$(shell Rscript -e 'x<-readLines("DESCRIPTION");cat(gsub(".+[:]\\s*", "", x[grepl("^Package", x)]))')
.PHONY: build
${PKGNAME}_${VERSION}.tar.gz: R/* src/*.cpp src/*.h inst/include/barry/** man
$(MAKE) clean ;\
Rscript -e 'Rcpp::compileAttributes();roxygen2::roxygenize()' && \
R CMD build .
build: ${PKGNAME}_${VERSION}.tar.gz
install: build
R CMD INSTALL ${PKGNAME}_${VERSION}.tar.gz
check: build
R CMD check --as-cran ${PKGNAME}_${VERSION}.tar.gz
# Once running, we can set a debug point using 'break [filename].hpp:[linenumber]
# and then type 'run'
debug:
R -d gdb switch
profile: install
R --debugger=valgrind --debugger-args='--tool=cachegrind --cachegrind-out-file=test.cache.out'
update:
rsync -av ../barry/include/barry inst/include
.PHONY: man docker
man: R/*
Rscript --vanilla -e 'Rcpp::compileAttributes();devtools::document()'
.PHONY: clean
clean:
rm -rf src/*.o; rm -rf src/*.a; rm -f ${PKGNAME}_${VERSION}.tar.gz
# Activate debugging by modifying the