forked from mhunter1/dynr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·110 lines (89 loc) · 3.6 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
REXEC = R
export REXEC
# Uncomment the next line to build fat binaries (32 and 64) for Windows
BUILDARGS = --force-biarch --dsym
#BUILDARGS = --dsym
TESTFILE = tools/testModels.R
# subdirectories
RSOURCE = R
RDOCUMENTS = man
RDATA = data
# file types
#RFILES = $(wildcard R/*.R)
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo ""
@echo "INSTALL"
@echo ""
@echo " install install dynr on your local machine"
@echo ""
@echo "CLEANING"
@echo ""
@echo " clean remove all files from the build directory"
@echo ""
@echo "TESTING"
@echo ""
@echo " test run the test suite (demo inst/models/passing)"
@echo " torture run the test suite with gctorture(TRUE)"
@echo " cran-check check documentation and so on for CRAN"
@echo " cran-check-as same as cran-check but with --as-cran option"
@echo " slow-test run the test suite with gctorture(TRUE)"
@echo ""
@echo "BUILDS"
@echo ""
@echo " build create a dynr binary for the local system"
@echo " srcbuild create a dynr source release"
@echo " cran-build create a dynr source release for CRAN"
r-libs-user-dir:
sh ./inst/tools/mk-r-libs-user-dir
build-prep:
@if [ $$(git status --short --untracked-files=no 2> /dev/null | wc -l) != 0 ]; then \
echo '***'; echo "*** UNCOMMITTED CHANGES IGNORED ***"; \
echo '***'; echo "*** Use 'git diff' to see what is uncommitted"; \
echo '***'; fi
-[ -d build ] && rm -r ./build
mkdir build
git archive --format=tar HEAD | (cd build; tar -xf -)
build: build-prep
cd build && sh ./tools/prep && $(REXEC) CMD INSTALL $(BUILDARGS) --build .
grep -v '@[A-Z]+@' DESCRIPTION.in > DESCRIPTION
srcbuild: build-prep
cd build && sh ./tools/prep && $(REXEC) CMD build .
grep -v '@[A-Z]+@' DESCRIPTION.in > DESCRIPTION
@echo 'To generate a PACKAGES file, use:'
@echo ' echo "library(tools); write_PACKAGES('"'.', type='source'"')" | R --vanilla'
cran-build: build-prep
cd build && sh ./tools/prep && rm Makefile DESCRIPTION.in && $(REXEC) CMD build .
grep -v '@[A-Z]+@' DESCRIPTION.in > DESCRIPTION
install:
sh ./tools/prep
MAKEFLAGS="$(INSTALLMAKEFLAGS)" $(REXEC) CMD INSTALL $(BUILDARGS) .
grep -v '@[A-Z]+@' DESCRIPTION.in > DESCRIPTION
#MAKEFLAGS="$(INSTALLMAKEFLAGS)" $(REXEC) CMD SHLIB $(BUILDARGS) src/wrappernegloglike.c src/estimation_nloptR.c src/PANAmodel.c src/functions/*.c
clean:
mkdir -p build
-rm -f build/dynr_*.tar.gz build/dynr_*.zip
-rm -f src/*.*o src/*.dll
-rm -f src-i386/*.*o src-i386/*.dll
-rm -f src-x64/*.*o src-x64/*.dll
-rm -f inst/models/passing/*.*o inst/models/passing/*.dll
-find demo -type f ! -name '*.R' ! -name 00Index | xargs rm -f
-find inst/models/passing -type f ! -name '*.R' | xargs rm -f
-rm -f src/Makevars
-rm -f config.log config.status
-grep -l 'Generated by roxygen2' man/*.Rd | xargs rm -f
grep -v '@[A-Z]+@' DESCRIPTION.in > DESCRIPTION
test:
$(REXEC) --vanilla --slave -f $(TESTFILE)
torture:
$(REXEC) --vanilla --slave -f $(TESTFILE) --args gctorture
slow-test:
$(REXEC) --vanilla --slave -f $(TESTFILE) --args slow
cran-check-as: cran-build
$(REXEC) CMD check --as-cran build/dynr_*.tar.gz | tee cran-test.log
wc -l dynr.Rcheck/00check.log
@if [ $$(wc -l dynr.Rcheck/00check.log | cut -d ' ' -f 1) -gt 59 ]; then echo "CRAN check problems have grown; see cran-check.log" ; false; fi
cran-check: cran-build
$(REXEC) CMD check build/dynr_*.tar.gz | tee cran-test.log
wc -l dynr.Rcheck/00check.log
@if [ $$(wc -l dynr.Rcheck/00check.log | cut -d ' ' -f 1) -gt 59 ]; then echo "CRAN check problems have grown; see cran-check.log" ; false; fi