Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
110 lines (92 loc) · 3.58 KB
/
Copy pathMakefile
File metadata and controls
110 lines (92 loc) · 3.58 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
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
PREFIX ?= `pwd`/install
docdir = ${PREFIX}/share/doc/gnatdoc
SCENARIO_VARIABLES=\
-XGPR_UNIT_PROVIDER_LIBRARY_TYPE=static \
-XGPR_UNIT_PROVIDER_BUILD=debug \
-XVSS_LIBRARY_TYPE=static \
-XMARKDOWN_LIBRARY_TYPE=static \
-XLIBADALANG_LIBRARY_TYPE=static \
-XLANGKIT_SUPPORT_LIBRARY_TYPE=static \
-XPRETTIER_ADA_LIBRARY_TYPE=static \
-XGPR2_LIBRARY_TYPE=static
all: build-gnatdoc
build-all: build-libgnatdoc build-gnatdoc build-tests
install: install-gnatdoc
build-libgnatdoc:
gprbuild -j0 -p -P gnat/libgnatdoc.gpr
build-gnatdoc:
gprbuild -j0 -p -P gnat/gnatdoc.gpr ${SCENARIO_VARIABLES}
install-gnatdoc:
gprinstall -f -p -P gnat/gnatdoc.gpr --prefix="${PREFIX}" --no-project ${SCENARIO_VARIABLES}
clean:
rm -rf .objs bin
build-tests:
gprbuild -j0 -p -P gnat/tests/test_drivers.gpr ${SCENARIO_VARIABLES}
check: build-tests
make -C testsuite
build-documentation:
make -C documentation/users_guide html latexpdf
install-documentation: build-documentation
mkdir -p $(docdir)/html
mkdir -p $(docdir)/html/users_guide
mkdir -p $(docdir)/pdf
cp -r documentation/users_guide/_build/html/* $(docdir)/html/users_guide
cp documentation/users_guide/_build/latex/gnatdoc_ug.pdf $(docdir)/pdf
####################
# Coverage support #
####################
coverage-setup: clean
# Create a local gnatcov RTS - do not do this in the gnatcov install prefix
gnatcov setup --prefix=$$(pwd)/.objs/gnatcov-rts
coverage-instrument: coverage-setup
# Create the instrumented sources for gnatdoc and libgnatdoc.
# Do not process subprojects, to avoid measuring coverage on
# the markdown subproject.
#
# Note: due to a GPR2 bug, the two instrumentation passes may assign
# different source files to libgnatdoc depending on the root project,
# causing the second pass to overwrite files the first pass needs.
# Work around this by saving and merging the libgnatdoc output.
gnatcov instrument -P gnat/tests/test_drivers.gpr \
--level=stmt \
--projects=libgnatdoc.gpr \
--runtime-project $$(pwd)/.objs/gnatcov-rts/share/gpr/gnatcov_rts.gpr \
--no-subprojects \
${SCENARIO_VARIABLES}
cp -a .objs/libgnatdoc-gnatcov-instr .objs/libgnatdoc-gnatcov-instr.save
gnatcov instrument -P gnat/gnatdoc.gpr \
--level=stmt \
--projects=gnatdoc.gpr --projects=libgnatdoc.gpr \
--runtime-project $$(pwd)/.objs/gnatcov-rts/share/gpr/gnatcov_rts.gpr \
--no-subprojects \
${SCENARIO_VARIABLES}
cp -n .objs/libgnatdoc-gnatcov-instr.save/* .objs/libgnatdoc-gnatcov-instr/
rm -rf .objs/libgnatdoc-gnatcov-instr.save
coverage-build: coverage-instrument
# Build the project and the test drivers
gprbuild -j0 -p -P gnat/gnatdoc.gpr \
--src-subdirs=gnatcov-instr \
--implicit-with=$$(pwd)/.objs/gnatcov-rts/share/gpr/gnatcov_rts.gpr \
${SCENARIO_VARIABLES}
gprbuild -j0 -p -P gnat/tests/test_drivers.gpr \
--src-subdirs=gnatcov-instr \
--implicit-with=$$(pwd)/.objs/gnatcov-rts/share/gpr/gnatcov_rts.gpr \
${SCENARIO_VARIABLES}
coverage-test: coverage-build
# Run the testsuite with the instrumented binaries; aggregate the
# traces in a local directory.
rm -rf gnatcov_traces
mkdir -p gnatcov_traces
export PATH=$$(pwd)/bin:$$PATH && \
export GNATCOV_TRACE_FILE=$$(pwd)/gnatcov_traces/ && \
make -C testsuite
coverage-report: coverage-test
# Create a report from the traces; use the HTML and Cobertura formats for
# the report, and place it in a local directory.
export GNATCOV_TRACE_FILE=$$(pwd)/gnatcov_traces/ && \
gnatcov coverage -P gnat/gnatdoc.gpr \
--level=stmt \
--annotate=html,cobertura \
--projects=gnatdoc.gpr --projects=libgnatdoc.gpr \
--output-dir gnatcov_report/ \
gnatcov_traces/