-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
69 lines (52 loc) · 2.19 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
R := R
SOURCEDIR := src
INCLUDEDIR := inst/include
SOURCES := $(shell find $(SOURCEDIR) -name '*.cpp')
INCLUDES := $(shell find $(INCLUDEDIR) -name '*.hpp') $(shell find $(SOURCEDIR) -name '*.h')
CPPCHECK := cppcheck
SCAN_BUILD := scan-build
.PHONY: all build check document test
all: clean document build check
build: document
$(R) CMD build .
check: build
$(R) CMD check instrumentr*tar.gz
clean:
-rm -f instrumentr*tar.gz
-rm -fr instrumentr.Rcheck
-rm -rf src/*.o src/*.so
install: clean
$(R) CMD INSTALL .
uninstall:
$(R) --slave -e "remove.packages('instrumentr')"
generate-callback-api:
$(R) --slave --file=inst/meta/generate-callback-api.R --args R/callbacks.R
document: generate-callback-api install-devtools
$(R) --slave -e "devtools::document()"
test: install-devtools
$(R) --slave -e "devtools::test()"
lintr: install-lintr
$(R) --slave -e "quit(status = length(print(lintr::lint_package())) != 0)"
install-devtools:
$(R) --slave -e "if (!require('devtools')) install.packages('devtools')"
install-lintr:
$(R) --slave -e "if (!require('lintr')) install.packages('lintr')"
clang-tidy: clean
$(SCAN_BUILD) make build
cppcheck:
$(CPPCHECK) --version
@$(CPPCHECK) --force \
--enable=all \
--language=c++ \
--inconclusive \
--std=c++11 \
--std=c++14 \
--inline-suppr \
--error-exitcode=1 \
--quiet \
--suppress=missingIncludeSystem \
--suppress=unusedFunction \
--suppress=useStlAlgorithm \
-I inst/include/ \
$(SOURCES) \
$(INCLUDES)