-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (45 loc) · 1.65 KB
/
Makefile
File metadata and controls
59 lines (45 loc) · 1.65 KB
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
excludes = lr_test
## If testing with CppAD we must exclude folder TMBad
ifeq ($(TMB_AD_FRAMEWORK), CppAD)
tmbad_examples = $(basename $(wildcard TMBad/*.cpp))
excludes += $(tmbad_examples)
endif
rfiles = $(basename $(wildcard *.R)) $(basename $(wildcard */*.R))
cppfiles = $(basename $(wildcard *.cpp)) $(basename $(wildcard */*.cpp))
all_examples = $(filter $(rfiles), $(cppfiles))
examples = $(filter-out $(excludes), $(all_examples))
outputfiles = $(examples:=.output.RData)
profiletargets = $(examples:=.profile)
logpidtargets = $(examples:=.logpid)
# Allow e.g. "make R=R-devel"
R=R
%.output.RData : %.R %.cpp
unset MAKEFLAGS; example=$(basename $<) $(R) --slave < tools/unittest.R
all: $(outputfiles)
make report
$(all_examples) : % : %.output.RData
report:
report_level=0 $(R) --slave < tools/unittest.R
report-full:
report_level=1 $(R) --slave < tools/unittest.R
clean :
rm -rf *.o *.so *.dll *~ core *.output.RData *.pdf *.profile *.memprofile
rm -rf */*.o */*.so */*.dll */*~ core */*.output.RData */*.pdf */*.profile */*.memprofile
%.profile : %.R %.cpp
example=$(basename $<) type=hotspots $(R) --slave < tools/profiler.R
%.memprofile : %.R %.cpp
example=$(basename $<) type=mi1 $(R) --slave < tools/profiler.R
%.logpid : %.R %.cpp
example=$(basename $<) $(R) --slave < tools/logpid.R
profile_all: $(outputfiles) $(profiletargets)
logpid_all: $(outputfiles) $(logpidtargets)
##########################################################
## For travis tests
test:
make $(examples) | grep slave
make report
cat REPORT.md
if grep -q FALSE REPORT.md; then exit 1; fi;
ifeq ($(TMB_AD_FRAMEWORK), TMBad)
if grep -q NA REPORT.md; then exit 1; fi;
endif