forked from visionworkbench/visionworkbench
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
199 lines (166 loc) · 7.51 KB
/
Makefile.am
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# __BEGIN_LICENSE__
# Copyright (c) 2006-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NASA Vision Workbench is licensed under the Apache License,
# Version 2.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# __END_LICENSE__
########################################################################
# sources
########################################################################
ACLOCAL_AMFLAGS = -I m4 -I thirdparty/m4
DISTCHECK_CONFIGURE_FLAGS = --enable-ccache
LCOV_ARGS = --ignore-errors graph,gcov --follow --compat-libtool
SUBDIRS = src
EXTRA_DIST = \
autogen \
config.options.example \
config/rules.mak \
docs \
INSTALLGUIDE \
README.md \
scripts/include-graph.py \
scripts/.lcovrc \
scripts/python/vw/gdb/__init__.py \
scripts/python/vw/gdb/types.py \
scripts/python/vw/__init__.py \
scripts/relicense.pl \
thirdparty/gtest/CHANGES \
thirdparty/gtest/CONTRIBUTORS \
thirdparty/gtest/COPYING \
thirdparty/gtest/include/gtest/gtest_VW.h \
thirdparty/gtest/README \
thirdparty/gtest/src/gtest-all.cc \
thirdparty/gtest/src/gtest_main.cc
########################################################################
# special top-level rules
########################################################################
dist-hook:
rm -rf `find $(distdir) -name '.svn' -o -name '.git'`
make -C $(distdir)/docs/workbook clean
if DIST_LICENSE
cp $(DIST_LICENSE) $(distdir)/COPYING
endif
if DIST_LICENSE_SUMMARY
find $(distdir) -type f | scripts/relicense.pl $(DIST_LICENSE_SUMMARY)
endif
if DIST_CONFIG_OPTIONS_DEFAULT
cp $(DIST_CONFIG_OPTIONS_DEFAULT) $(distdir)/config/config.options.default
endif
if DIST_REMOVE_MODULES
for module in $(DIST_REMOVE_MODULES) ; do \
rm -rf $(distdir)/src/vw/$${module} $(distdir)/src/vw/$${module}.h ; \
grep -v "$${module}.*Makefile" $(distdir)/configure.ac > configure.new ; \
rebuild=0 ; \
if ! diff -q $(distdir)/configure.ac configure.new ; then \
mv configure.new $(distdir)/configure.ac ; \
rebuild=1 ; \
fi ; \
grep -v "= $${module}" $(distdir)/src/vw/Makefile.am > Makefile.new ; \
if ! diff -q $(distdir)/src/vw/Makefile.am Makefile.new ; then \
mv Makefile.new $(distdir)/src/vw/Makefile.am ; \
rebuild=1 ; \
fi ; \
rm -f configure.new Makefile.new ; \
done ; \
if test x"$$rebuild" = "x1"; then \
( cd $(distdir) && autoreconf && touch src/vw/config.h.pre.in && rm -rf autom4te.cache ) ; \
fi
endif
check-local:
@echo ==============================
@echo All tests passed successfully!
@echo ==============================
.gcno.stamp: .FORCE
$(MAKE) $(AM_MAKEFLAGS) STAMPFILE=$@ STAMPPATTERN='*.gcno' copy-timestamp
.gcda.stamp: .FORCE
$(MAKE) $(AM_MAKEFLAGS) STAMPFILE=$@ STAMPPATTERN='*.gcda' copy-timestamp
#This strange HOME bit is so lcov finds the config file we have in the scripts dir.
vw-base.trace: .gcno.stamp
rm -f $@
HOME=$(top_srcdir)/scripts $(LCOV) $(LCOV_ARGS) --capture --test-name 'Vision-Workbench' --directory $(top_srcdir) --output-file vw-base.trace --initial
$(MAKE) $(AM_MAKEFLAGS) TRACEFILE=vw-base.trace coverage-filter
vw-test.trace: .gcda.stamp
rm -f $@
HOME=$(top_srcdir)/scripts $(LCOV) $(LCOV_ARGS) --capture --test-name 'Vision-Workbench' --directory $(top_srcdir) --output-file vw-test.trace
$(MAKE) $(AM_MAKEFLAGS) TRACEFILE=vw-test.trace coverage-filter
vw.trace: vw-base.trace vw-test.trace
rm -f $@
HOME=$(top_srcdir)/scripts $(LCOV) $(LCOV_ARGS) -a vw-base.trace -a vw-test.trace -o vw.trace
$(top_srcdir)/coverage/index.html: vw.trace
rm -rf $(top_srcdir)/coverage
HOME=$(top_srcdir)/scripts $(GENHTML) --demangle-cpp -o $(top_srcdir)/coverage vw.trace
@echo "Generated code coverage report in $(top_srcdir)/coverage"
coverage: $(top_srcdir)/coverage/index.html
# The tracefiles can get really big. This removes unnecessary data from them.
coverage-filter:
rm -f $(TRACEFILE).tmp
HOME=$(top_srcdir)/scripts $(LCOV) $(LCOV_ARGS) -e $(TRACEFILE) '*/src/vw/*' -o $(TRACEFILE).tmp
HOME=$(top_srcdir)/scripts $(LCOV) $(LCOV_ARGS) -r $(TRACEFILE).tmp '*/tests/*' -o $(TRACEFILE).tmp
HOME=$(top_srcdir)/scripts $(LCOV) $(LCOV_ARGS) -r $(TRACEFILE).tmp '*/tools/*' -o $(TRACEFILE).tmp
mv $(TRACEFILE).tmp $(TRACEFILE)
rm -f $(TRACEFILE).tmp
# This copies the timestamp of the newest file that matches STAMPPATERN to the
# timestamp of STAMPFILE
copy-timestamp:
@test -f $(STAMPFILE) || touch -t 197001010001 $(STAMPFILE)
@find $(top_srcdir)/src/vw \( -name '$(STAMPPATTERN)' -a -newer $(STAMPFILE) \) \
-a -exec test {} -nt $(STAMPFILE) \; \
-a -exec touch -r {} $(STAMPFILE) \;
distclean-local:
cd $(srcdir)/docs/workbook && $(MAKE) $(AM_MAKEFLAGS) distclean
workbook: all
cd $(srcdir)/docs/workbook && $(MAKE) $(AM_MAKEFLAGS) workbook.pdf
doxygen:
cd src && doxygen
doc: workbook doxygen
install-with-doc: doc install
mkdir -p $(DESTDIR)usr/share/doc/visionworkbench
cp docs/workbook/workbook.pdf $(DESTDIR)usr/share/doc/visionworkbench/
cp -r docs/doxygen $(DESTDIR)usr/share/doc/visionworkbench/apiReference
push-coverage:
if test -n "$(LCOV_REMOTE_PATH)" ; then rsync --delete -P -e ssh -r coverage/ $(LCOV_REMOTE_PATH); fi
DEHYDRA_MODULES = \
$(top_srcdir)/scripts/templates.js
DEHYDRA_ARGS = \
$(top_srcdir)/thirdparty/static-checking.js \
--output-path=$(top_srcdir)/src/vw \
--no-backup \
--dehydra-modules=$(DEHYDRA_MODULES)
# Generate instantiation files for all templates
instantiate-all:
echo "#include <vw/vw.h>" | \
$(DEHYDRA_GCC) -x c++ - -S -o /dev/null -fplugin=$(DEHYDRA_PLUGIN) -fplugin-arg='$(DEHYDRA_ARGS)' $(VW_CPPFLAGS)
# List the instantiation percentages
instantiate-skipped:
@find -type f -name TestInstantiate\*List.hh -print0 | sort -z | xargs -0 -n1 awk '/^\/\//{n++}; END { printf "%5.1f%% of %4i lines skipped: %s\n", ((100*n)/NR), NR, FILENAME }'
# This is a list of every header (eventually) included when you include vw/vw.h
all-headers:
echo "#include <vw/vw.h>" | \
$(CXX) -x c++ -E - $(VW_CPPFLAGS) | \
grep '^#.*vw/' | sed -e 's#.*src/\(vw/[^"]\+\)".*#\1#' | sort -u
one-ctags-file:
ctags -R \
--regex-c++='/VW_DEFINE_EXCEPTION\(\s*(.*)\s*,\s*(.*)\s*\)/\1/s/' \
--regex-c++='/VW_DEFINE_EXCEPTION_EXT\(\s*(.*)\s*,\s*(.*)\s*\)/\1/s/' \
--regex-c++='/__VW_UNARY_MATH_FUNCTOR\(\s*([A-Z].*)\s*,\s*(.*)\s*\)/Arg\1Functor/s/' \
--regex-c++='/__VW_BINARY_MATH_FUNCTOR\(\s*([A-Z].*)\s*,\s*(.*)\s*\)/ArgArg\1Functor/s/' \
--regex-c++='/VW_DEFINE_ENUM\(\s*(.*)\s*,\s*(.*)\s*,\s*\(\s*(.*)\s*\)\)/\1/g/' \
--languages=C,C++ --exclude='*thirdparty/*' --exclude='*tests/*' --exclude='*vw/GPU/*' . --exclude='' thirdparty/gtest
.PHONY: push-coverage instantiate-all instantiate-skipped all-headers one-ctags-file copy-timestamp coverage-filter
# This rule is like .PHONY except it doesn't apply recursively to rules that depend on phony rules
.FORCE:
########################################################################
# general
########################################################################
CLEANFILES = vw.trace vw-base.trace vw-test.trace
include $(top_srcdir)/config/rules.mak