-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
122 lines (92 loc) · 4.31 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
110
111
112
113
114
115
116
117
118
119
120
121
122
CC=g++
OPTIONS=-Wall -std=c++17
INCLUDES=-I/usr/include/eigen3
VERSION=0.1.0
FILES=src/datagrams/DatagramParser.cpp src/datagrams/DatagramParserFactory.cpp src/datagrams/s7k/S7kParser.cpp src/datagrams/kongsberg/KongsbergParser.cpp src/datagrams/xtf/XtfParser.cpp src/utils/NmeaUtils.cpp src/utils/StringUtils.cpp src/sidescan/SidescanPing.cpp src/hydroblock/Hydroblock20Parser.cpp src/datagrams/kmall/KmallParser.cpp src/sbet/SbetProcessor.cpp
EXECUTABLES=georeference data-cleaning datagram-dump datagram-list bounding-box cidco-decoder
root=$(shell pwd)
exec_dir=build/bin
doc_dir=build/doc
test_exec_dir=build/test/bin
test_work_dir=build/test/work
test_result_dir=build/reports
coverage_dir=build/coverage
coverage_exec_dir=build/coverage/bin
coverage_report_dir=build/coverage/report
default: prepare datagram-dump datagram-list georeference data-cleaning cidco-decoder bounding-box
echo "Building all"
georeference: prepare
$(CC) $(OPTIONS) $(INCLUDES) -o $(exec_dir)/georeference src/examples/georeference.cpp $(FILES)
datagram-raytracer: prepare
$(CC) $(OPTIONS) -O3 $(INCLUDES) -o $(exec_dir)/datagram-raytracer src/examples/datagram-raytracer.cpp $(FILES)
datagram-raytracer-debug: prepare
$(CC) $(OPTIONS) -g -static $(INCLUDES) -o $(exec_dir)/datagram-raytracer src/examples/datagram-raytracer.cpp $(FILES)
raytrace: prepare
$(CC) $(OPTIONS) -O3 $(INCLUDES) -o $(exec_dir)/raytrace src/examples/raytrace.cpp $(FILES)
raytrace-debug: prepare
$(CC) $(OPTIONS) -g -static $(INCLUDES) -o $(exec_dir)/raytrace src/examples/raytrace.cpp $(FILES)
data-cleaning: prepare
$(CC) $(OPTIONS) $(INCLUDES) -o $(exec_dir)/data-cleaning src/examples/data-cleaning.cpp $(FILES)
debugGeoreference: prepare
$(CC) $(OPTIONS) -g -static $(INCLUDES) -o $(exec_dir)/georeference src/examples/georeference.cpp $(FILES)
debugDump: prepare
$(CC) $(OPTIONS) -g -static $(INCLUDES) -o $(exec_dir)/datagram-dump src/examples/datagram-dump.cpp $(FILES)
debugList: prepare
$(CC) $(OPTIONS) -g -static $(INCLUDES) -o $(exec_dir)/datagram-list src/examples/datagram-list.cpp $(FILES)
bounding-box: prepare
$(CC) $(OPTIONS) $(INCLUDES) -o $(exec_dir)/bounding-box src/examples/bounding-box.cpp $(FILES)
cidco-decoder: prepare
$(CC) $(OPTIONS) $(INCLUDES) -o $(exec_dir)/cidco-decoder src/examples/cidco-decoder.cpp $(FILES)
datagram-dump: prepare
$(CC) $(OPTIONS) $(INCLUDES) -o $(exec_dir)/datagram-dump src/examples/datagram-dump.cpp $(FILES)
datagram-list: prepare
$(CC) $(OPTIONS) $(INCLUDES) -o $(exec_dir)/datagram-list src/examples/datagram-list.cpp $(FILES)
test: default
mkdir -p $(test_exec_dir)
$(CC) $(OPTIONS) $(INCLUDES) -o $(test_exec_dir)/tests test/main.cpp $(FILES)
mkdir -p $(test_result_dir)
mkdir -p $(test_work_dir)
$(root)/$(test_exec_dir)/tests -r junit -o $(test_result_dir)/mbes-lib-test-report.xml
test-quick: default
mkdir -p $(test_exec_dir)
$(CC) $(OPTIONS) $(INCLUDES) -o $(test_exec_dir)/tests test/main.cpp $(FILES)
mkdir -p $(test_result_dir)
mkdir -p $(test_work_dir)
cd $(test_work_dir)
$(root)/$(test_exec_dir)/tests || true
test-debug: default
mkdir -p $(test_exec_dir)
$(CC) $(OPTIONS) -g -static $(INCLUDES) -o $(test_exec_dir)/tests test/main.cpp $(FILES)
coverage: default
mkdir -p $(coverage_dir)
mkdir -p $(coverage_report_dir)
mkdir -p $(coverage_exec_dir)
mkdir -p $(test_work_dir)
mkdir -p $(test_result_dir)
cppcheck --xml --xml-version=2 --enable=all --inconclusive --language=c++ src 2> $(coverage_report_dir)/cppcheck.xml
$(CC) $(OPTIONS) $(INCLUDES) -fprofile-arcs -ftest-coverage -fPIC -O0 test/main.cpp $(FILES) -o $(coverage_exec_dir)/tests
$(root)/$(coverage_exec_dir)/tests || true
gcovr --branches -r $(root) --xml --xml-pretty -o $(coverage_report_dir)/gcovr-report.xml
gcovr --branches -r $(root) --html --html-details -o $(coverage_report_dir)/gcovr-report.html
doc:
rm -rf build/doxygen
mkdir -p build/doxygen
doxygen
mkdir -p $(doc_dir)
clean:
rm -rf build
rm *.txt || true
rm *.svp || true
rm *.gcno || true
rm *.gcda || true
overlap: prepare
rm -rf build/tempCMake
mkdir -p build/tempCMake
cd build/tempCMake && cmake ../../src/examples/overlap/ && make && mv overlap ../bin/
rm -rf build/tempCMake
install: default
install -s build/bin/georeference /usr/bin/georeference
install -s build/bin/bounding-box /usr/bin/bounding-box
prepare:
mkdir -p $(exec_dir)
.PHONY: all test clean doc