forked from pbs-assess/sdmTMB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 1.06 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
PACKAGE=sdmTMB
VERSION := $(shell sed -n '/^Version: /s///p' DESCRIPTION)
DATE := $(shell sed -n '/^Date: /s///p' DESCRIPTION)
TARBALL=${PACKAGE}_${VERSION}.tar.gz
ZIPFILE=${PACKAGE}_${VERSION}.zip
# Allow e.g. "make R=R-devel install"
R=R
all:
make doc-update
make build-package
make install
doc-update:
echo "roxygen2::roxygenize(\".\")" | $(R) --slave
build-package:
$(R) CMD build --no-build-vignettes --no-manual .
install:
$(R) CMD INSTALL --preclean --no-multiarch --with-keep.source .
cran-check:
$(R) CMD check --as-cran $(TARBALL)
build-parallel:
rsync -qav --exclude='build' --exclude='.git' --exclude='*.tar.gz' --exclude='*.o' --exclude='*.so' --exclude='inst/*.rds' --exclude='.Rproj.user' . build
echo 'PKG_CXXFLAGS += $$(SHLIB_OPENMP_CXXFLAGS)' >> build/src/Makevars
echo 'PKG_LIBS = $$(SHLIB_OPENMP_CXXFLAGS)' >> build/src/Makevars
sed -i "" "s/Type jnll = 0;/parallel_accumulator<Type> jnll(this);/g" build/src/sdmTMB.cpp
install-parallel:
make build-parallel
$(R) CMD INSTALL --preclean --no-multiarch --with-keep.source build
rm -rf build