-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
59 lines (44 loc) · 1.88 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
# Capture the current value of the version of the package in DESCRIPTION
VERSION := $(shell grep Version DESCRIPTION | sed -e 's/Version: //')
build:
cd .. && R CMD build epiworldR
debug: clean
docker run --rm -ti -w/mnt -v $(PWD):/mnt uofuepibio/epiworldr:debug make docker-debug
docker-debug:
EPI_CONFIG="-DEPI_DEBUG -Wall -pedantic -g" R CMD INSTALL \
--no-docs --build .
install-dev: clean
sed -i -E 's/@useDynLib\s+[a-zA-Z]+/@useDynLib epiworldRdev/g' R/epiworldR-package.R
sed -i -E 's/useDynLib\(+[a-zA-Z]+/useDynLib(epiworldRdev/g' NAMESPACE
sed -i -E 's/^Package:.+/Package: epiworldRdev/g' DESCRIPTION
sed -i -E 's/^library\(epiworldR\)/library(epiworldRdev)/g' README.*
Rscript --vanilla -e 'roxygen2::roxygenize()'
EPI_DEV=yes R CMD INSTALL .& $(MAKE) clean
install:
cd .. && \
R CMD INSTALL epiworldR_$(VERSION).tar.gz
README.md: README.Rmd
Rscript --vanilla -e 'rmarkdown::render("README.Rmd")'
# update:
# wget https://raw.githubusercontent.com/UofUEpiBio/epiworld/master/epiworld.hpp && \
# mv epiworld.hpp inst/include/epiworld.hpp
local-update:
rsync -avz ../epiworld/include/epiworld inst/include/.
check: build
cd .. && R CMD check epiworldR_*.tar.gz
clean:
rm -f src/*.dll src/*.so src/*.o
sed -i -E 's/@useDynLib\s+[a-zA-Z]+/@useDynLib epiworldR/g' R/epiworldR-package.R
sed -i -E 's/useDynLib\(+[a-zA-Z]+/useDynLib(epiworldR/g' NAMESPACE
sed -i -E 's/^Package:.+/Package: epiworldR/g' DESCRIPTION
# sed -i -E 's/^\\(name|alias|title)\{[a-zA-Z]+/\\\1{epiworldR/g' man/epiworldR-package.Rd
sed -i -E 's/^library\(epiworldRdev\)/library(epiworldR)/g' README.*
docs:
Rscript --vanilla -e 'roxygen2::roxygenize()'
checkv: build
R CMD check --as-cran --use-valgrind epiworldR*.tar.gz
# Builds and installs without vignettes
dev: clean
R CMD build --no-build-vignettes .
R CMD INSTALL epiworldR_$(VERSION).tar.gz
.PHONY: build update check clean docs docker-debug dev