autoconfiscate.diff 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. diff --git a/Demo/Makefile.am b/Demo/Makefile.am
  2. new file mode 100644
  3. --- /dev/null
  4. +++ b/Demo/Makefile.am
  5. @@ -0,0 +1,54 @@
  6. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(SUITESPARSECONFIG_CFLAGS)
  7. +LDADD = $(top_builddir)/Source/libamd.la
  8. +
  9. +EXTRA_DIST = \
  10. + amd_demo.out \
  11. + amd_demo2.out \
  12. + amd_l_demo.out \
  13. + amd_simple.out \
  14. + amd_f77cross.out \
  15. + amd_f77demo.out \
  16. + amd_f77simple.out
  17. +
  18. +# Disable the .out implicit pattern rule. Prevents GNU make from
  19. +# adding bogus dependencies for the .out files listed above.
  20. +%.out: %
  21. +
  22. +check_PROGRAMS = \
  23. + amd_demo \
  24. + amd_demo2 \
  25. + amd_l_demo \
  26. + amd_simple \
  27. + amd_f77cross \
  28. + amd_f77demo \
  29. + amd_f77simple
  30. +
  31. +amd_demo_SOURCES = amd_demo.c
  32. +amd_demo2_SOURCES = amd_demo2.c
  33. +amd_l_demo_SOURCES = amd_l_demo.c
  34. +amd_simple_SOURCES = amd_simple.c
  35. +
  36. +check_LTLIBRARIES = libamd_f77wrapper.la
  37. +libamd_f77wrapper_la_SOURCES = amd_f77wrapper.c
  38. +libamd_f77wrapper_la_LIBADD = $(top_builddir)/Source/libamd.la
  39. +libamd_f77wrapper_la_CPPFLAGS = $(AM_CPPFLAGS) -DDINT
  40. +
  41. +amd_f77cross_SOURCES = amd_f77cross.f
  42. +amd_f77cross_LDADD = libamd_f77wrapper.la
  43. +amd_f77demo_SOURCES = amd_f77demo.f
  44. +amd_f77demo_LDADD = $(top_builddir)/Source/libamdf77.la
  45. +amd_f77simple_SOURCES = amd_f77simple.f
  46. +amd_f77simple_LDADD = $(top_builddir)/Source/libamdf77.la
  47. +
  48. +check-local: $(check_PROGRAMS) $(check_PROGRAMS:=.out)
  49. + @for i in $(check_PROGRAMS); do \
  50. + echo "Testing $$i"; \
  51. + ./$$i$(EXEEXT) > my_$$i.out; \
  52. + if diff -u $(srcdir)/$$i.out my_$$i.out; then \
  53. + echo "Test $$i PASSED."; \
  54. + else \
  55. + echo "Test $$i FAILED."; \
  56. + fi; \
  57. + done
  58. +
  59. +CLEANFILES = my_*.out
  60. diff --git a/Doc/Makefile.am b/Doc/Makefile.am
  61. new file mode 100644
  62. --- /dev/null
  63. +++ b/Doc/Makefile.am
  64. @@ -0,0 +1,27 @@
  65. +EXTRA_DIST = ChangeLog License.txt lesser.txt
  66. +
  67. +dist_noinst_DATA = AMD_UserGuide.tex AMD_UserGuide.bib
  68. +dist_pdf_DATA = AMD_UserGuide.pdf
  69. +
  70. +AMD_UserGuide.pdf AMD_UserGuide.aux: amd_h.tex
  71. +.INTERMEDIATE: AMD_UserGuide.aux amd_h.tex
  72. +
  73. +%_h.tex: $(top_srcdir)/Include/%.h
  74. + echo '\begin{verbatim}' > $@
  75. + expand -8 $< >> $@
  76. + echo '\end{verbatim}' >> $@
  77. +
  78. +TEX = TEXINPUTS="$(srcdir):" pdflatex -interaction nonstopmode -file-line-error
  79. +BIB = BIBINPUTS="$(srcdir):" bibtex
  80. +%.pdf: %.tex %.bbl
  81. + $(TEX) $*
  82. + while grep -q "Rerun to get cross-references right" $*.log; do \
  83. + $(TEX) $*; \
  84. + done
  85. +%.bbl: %.aux %.bib
  86. + $(BIB) $*
  87. +%.aux: %.tex
  88. + $(TEX) $*
  89. +
  90. +CLEANFILES = *.aux *.bbl *.blg *.log *.toc *_h.tex
  91. +MAINTAINERCLEANFILES = $(dist_pdf_DATA)
  92. diff --git a/Include/Makefile.am b/Include/Makefile.am
  93. new file mode 100644
  94. --- /dev/null
  95. +++ b/Include/Makefile.am
  96. @@ -0,0 +1 @@
  97. +pkginclude_HEADERS = amd.h amd_internal.h
  98. diff --git a/Makefile.am b/Makefile.am
  99. new file mode 100644
  100. --- /dev/null
  101. +++ b/Makefile.am
  102. @@ -0,0 +1,9 @@
  103. +ACLOCAL_AMFLAGS = -I m4
  104. +
  105. +SUBDIRS = Include Source Demo Doc
  106. +EXTRA_DIST = README.txt
  107. +
  108. +pkgconfig_DATA = amd.pc
  109. +
  110. +CODE_COVERAGE_BRANCH_COVERAGE = 1
  111. +@CODE_COVERAGE_RULES@
  112. diff --git a/Source/Makefile.am b/Source/Makefile.am
  113. new file mode 100644
  114. --- /dev/null
  115. +++ b/Source/Makefile.am
  116. @@ -0,0 +1,35 @@
  117. +AM_CPPFLAGS = -I$(top_srcdir)/Include $(SUITESPARSECONFIG_CFLAGS)
  118. +
  119. +AMDSRC = \
  120. + amd_1.c \
  121. + amd_2.c \
  122. + amd_aat.c \
  123. + amd_control.c \
  124. + amd_defaults.c \
  125. + amd_dump.c \
  126. + amd_info.c \
  127. + amd_order.c \
  128. + amd_postorder.c \
  129. + amd_post_tree.c \
  130. + amd_preprocess.c \
  131. + amd_valid.c
  132. +
  133. +lib_LTLIBRARIES = libamd.la libamdf77.la
  134. +noinst_LTLIBRARIES = libamdi.la libamdl.la
  135. +
  136. +libamdi_la_SOURCES = $(AMDSRC)
  137. +libamdi_la_LIBADD = $(SUITESPARSECONFIG_LIBS) -lm $(CODE_COVERAGE_LIBS)
  138. +libamdi_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS) -DDINT
  139. +libamdi_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  140. +
  141. +libamdl_la_SOURCES = $(AMDSRC)
  142. +libamdl_la_LIBADD = $(SUITESPARSECONFIG_LIBS) -lm $(CODE_COVERAGE_LIBS)
  143. +libamdl_la_CPPFLAGS = $(AM_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS) -DDLONG
  144. +libamdl_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  145. +
  146. +libamd_la_SOURCES =
  147. +libamd_la_LIBADD = libamdl.la libamdi.la
  148. +libamd_la_LDFLAGS = -no-undefined -release $(PACKAGE_VERSION)
  149. +
  150. +libamdf77_la_SOURCES = amd.f amdbar.f
  151. +libamdf77_la_LDFLAGS = -no-undefined -release $(PACKAGE_VERSION)
  152. diff --git a/amd.pc.in b/amd.pc.in
  153. new file mode 100644
  154. --- /dev/null
  155. +++ b/amd.pc.in
  156. @@ -0,0 +1,13 @@
  157. +prefix=@prefix@
  158. +exec_prefix=@exec_prefix@
  159. +libdir=@libdir@
  160. +includedir=@includedir@
  161. +
  162. +Name: @PACKAGE_NAME@
  163. +Description: Approximate minimum degree ordering
  164. +Version: @PACKAGE_VERSION@
  165. +URL: @PACKAGE_URL@
  166. +Requires.private: suitesparseconfig
  167. +Libs: -L${libdir} -lamd
  168. +Libs.private: -lm
  169. +Cflags: -I${includedir}/amd
  170. diff --git a/configure.ac b/configure.ac
  171. new file mode 100644
  172. --- /dev/null
  173. +++ b/configure.ac
  174. @@ -0,0 +1,48 @@
  175. +# -*- Autoconf -*-
  176. +# Process this file with autoconf to produce a configure script.
  177. +
  178. +AC_PREREQ([2.69])
  179. +AC_INIT([AMD],[2.4.6],[https://github.com/DrTimothyAldenDavis/SuiteSparse],[amd],[http://www.suitesparse.com/])
  180. +AC_CONFIG_SRCDIR([Source/amd_order.c])
  181. +AC_CONFIG_AUX_DIR([build-aux])
  182. +AC_CONFIG_MACRO_DIR([m4])
  183. +AC_CONFIG_HEADERS([config.h])
  184. +AM_INIT_AUTOMAKE([foreign])
  185. +AM_SILENT_RULES([yes])
  186. +LT_INIT([disable-static])
  187. +
  188. +# Checks for programs.
  189. +PKG_PROG_PKG_CONFIG
  190. +AC_PROG_INSTALL
  191. +AC_PROG_CC
  192. +AC_PROG_F77
  193. +AX_CODE_COVERAGE
  194. +
  195. +AS_VAR_SET([LIBS_SAVED], [$LIBS])
  196. +
  197. +# Checks for libraries.
  198. +AC_CHECK_LIB([m], [sqrt])
  199. +
  200. +PKG_CHECK_MODULES([SUITESPARSECONFIG], [suitesparseconfig])
  201. +
  202. +# Checks for header files.
  203. +AC_CHECK_HEADERS([limits.h stddef.h stdlib.h])
  204. +
  205. +# Checks for typedefs, structures, and compiler characteristics.
  206. +AC_TYPE_SIZE_T
  207. +
  208. +# Checks for library functions.
  209. +AC_CHECK_FUNCS([sqrt])
  210. +
  211. +AS_VAR_SET([LIBS], [$LIBS_SAVED])
  212. +
  213. +m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], [${libdir}/pkgconfig])])
  214. +AC_CONFIG_FILES([
  215. + amd.pc
  216. + Makefile
  217. + Demo/Makefile
  218. + Doc/Makefile
  219. + Include/Makefile
  220. + Source/Makefile
  221. +])
  222. +AC_OUTPUT
  223. diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4
  224. new file mode 100644
  225. --- /dev/null
  226. +++ b/m4/ax_code_coverage.m4
  227. @@ -0,0 +1,271 @@
  228. +# ===========================================================================
  229. +# https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
  230. +# ===========================================================================
  231. +#
  232. +# SYNOPSIS
  233. +#
  234. +# AX_CODE_COVERAGE()
  235. +#
  236. +# DESCRIPTION
  237. +#
  238. +# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
  239. +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included
  240. +# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every
  241. +# build target (program or library) which should be built with code
  242. +# coverage support. Also defines CODE_COVERAGE_RULES which should be
  243. +# substituted in your Makefile; and $enable_code_coverage which can be
  244. +# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
  245. +# and substituted, and corresponds to the value of the
  246. +# --enable-code-coverage option, which defaults to being disabled.
  247. +#
  248. +# Test also for gcov program and create GCOV variable that could be
  249. +# substituted.
  250. +#
  251. +# Note that all optimization flags in CFLAGS must be disabled when code
  252. +# coverage is enabled.
  253. +#
  254. +# Usage example:
  255. +#
  256. +# configure.ac:
  257. +#
  258. +# AX_CODE_COVERAGE
  259. +#
  260. +# Makefile.am:
  261. +#
  262. +# @CODE_COVERAGE_RULES@
  263. +# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ...
  264. +# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
  265. +# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
  266. +# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
  267. +#
  268. +# This results in a "check-code-coverage" rule being added to any
  269. +# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
  270. +# has been configured with --enable-code-coverage). Running `make
  271. +# check-code-coverage` in that directory will run the module's test suite
  272. +# (`make check`) and build a code coverage report detailing the code which
  273. +# was touched, then print the URI for the report.
  274. +#
  275. +# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined
  276. +# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of
  277. +# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is
  278. +# deprecated. They have the same value.
  279. +#
  280. +# This code was derived from Makefile.decl in GLib, originally licenced
  281. +# under LGPLv2.1+.
  282. +#
  283. +# LICENSE
  284. +#
  285. +# Copyright (c) 2012, 2016 Philip Withnall
  286. +# Copyright (c) 2012 Xan Lopez
  287. +# Copyright (c) 2012 Christian Persch
  288. +# Copyright (c) 2012 Paolo Borelli
  289. +# Copyright (c) 2012 Dan Winship
  290. +# Copyright (c) 2015 Bastien ROUCARIES
  291. +#
  292. +# This library is free software; you can redistribute it and/or modify it
  293. +# under the terms of the GNU Lesser General Public License as published by
  294. +# the Free Software Foundation; either version 2.1 of the License, or (at
  295. +# your option) any later version.
  296. +#
  297. +# This library is distributed in the hope that it will be useful, but
  298. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  299. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
  300. +# General Public License for more details.
  301. +#
  302. +# You should have received a copy of the GNU Lesser General Public License
  303. +# along with this program. If not, see <https://www.gnu.org/licenses/>.
  304. +
  305. +#serial 27
  306. +
  307. +AC_DEFUN([_AX_CODE_COVERAGE_ENABLED],[
  308. + # check for gcov
  309. + AC_CHECK_TOOL([GCOV],
  310. + [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
  311. + [:])
  312. + AS_IF([test "X$GCOV" = "X:"],
  313. + [AC_MSG_ERROR([gcov is needed to do coverage])])
  314. + AC_SUBST([GCOV])
  315. +
  316. + dnl Check if gcc is being used
  317. + AS_IF([ test "$GCC" = "no" ], [
  318. + AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
  319. + ])
  320. +
  321. + AC_CHECK_PROG([LCOV], [lcov], [lcov])
  322. + AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
  323. +
  324. + AS_IF([ test x"$LCOV" = x ], [
  325. + AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed])
  326. + ])
  327. +
  328. + AS_IF([ test x"$GENHTML" = x ], [
  329. + AC_MSG_ERROR([Could not find genhtml from the lcov package])
  330. + ])
  331. +
  332. + dnl Build the code coverage flags
  333. + dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
  334. + CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
  335. + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  336. + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
  337. + CODE_COVERAGE_LIBS="-lgcov"
  338. + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
  339. +
  340. + AC_SUBST([CODE_COVERAGE_CPPFLAGS])
  341. + AC_SUBST([CODE_COVERAGE_CFLAGS])
  342. + AC_SUBST([CODE_COVERAGE_CXXFLAGS])
  343. + AC_SUBST([CODE_COVERAGE_LIBS])
  344. + AC_SUBST([CODE_COVERAGE_LDFLAGS])
  345. +
  346. + [CODE_COVERAGE_RULES_CHECK='
  347. + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
  348. + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
  349. +']
  350. + [CODE_COVERAGE_RULES_CAPTURE='
  351. + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
  352. + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
  353. + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
  354. + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
  355. + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
  356. +']
  357. + [CODE_COVERAGE_RULES_CLEAN='
  358. +clean: code-coverage-clean
  359. +distclean: code-coverage-clean
  360. +code-coverage-clean:
  361. + -$(LCOV) --directory $(top_builddir) -z
  362. + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  363. + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
  364. +']
  365. +])
  366. +
  367. +AC_DEFUN([_AX_CODE_COVERAGE_DISABLED],[
  368. + [CODE_COVERAGE_RULES_CHECK='
  369. + @echo "Need to reconfigure with --enable-code-coverage"
  370. + ']
  371. + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK"
  372. + CODE_COVERAGE_RULES_CLEAN=''
  373. +])
  374. +
  375. +AC_DEFUN([AX_CODE_COVERAGE],[
  376. + dnl Check for --enable-code-coverage
  377. +
  378. + # allow to override gcov location
  379. + AC_ARG_WITH([gcov],
  380. + [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
  381. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
  382. + [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
  383. +
  384. + AC_MSG_CHECKING([whether to build with code coverage support])
  385. + AC_ARG_ENABLE([code-coverage],
  386. + AS_HELP_STRING([--enable-code-coverage],
  387. + [Whether to enable code coverage support]),,
  388. + enable_code_coverage=no)
  389. +
  390. + AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test "x$enable_code_coverage" = xyes])
  391. + AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
  392. + AC_MSG_RESULT($enable_code_coverage)
  393. +
  394. + AS_IF([ test "x$enable_code_coverage" = xyes ], [
  395. + _AX_CODE_COVERAGE_ENABLED
  396. + ], [
  397. + _AX_CODE_COVERAGE_DISABLED
  398. + ])
  399. +
  400. +[CODE_COVERAGE_RULES='
  401. +# Code coverage
  402. +#
  403. +# Optional:
  404. +# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
  405. +# Multiple directories may be specified, separated by whitespace.
  406. +# (Default: $(top_builddir))
  407. +# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
  408. +# by lcov for code coverage. (Default:
  409. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
  410. +# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
  411. +# reports to be created. (Default:
  412. +# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
  413. +# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
  414. +# set to 0 to disable it and leave empty to stay with the default.
  415. +# (Default: empty)
  416. +# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
  417. +# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  418. +# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
  419. +# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  420. +# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
  421. +# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
  422. +# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  423. +# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
  424. +# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  425. +# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
  426. +# lcov instance. (Default: empty)
  427. +# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
  428. +# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  429. +# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
  430. +# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
  431. +# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
  432. +# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  433. +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
  434. +#
  435. +# The generated report will be titled using the $(PACKAGE_NAME) and
  436. +# $(PACKAGE_VERSION). In order to add the current git hash to the title,
  437. +# use the git-version-gen script, available online.
  438. +
  439. +# Optional variables
  440. +CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
  441. +CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
  442. +CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
  443. +CODE_COVERAGE_BRANCH_COVERAGE ?=
  444. +CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  445. +--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  446. +CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
  447. +CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
  448. +CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
  449. +CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
  450. +CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
  451. +CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
  452. +CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
  453. +$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
  454. +--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
  455. +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
  456. +CODE_COVERAGE_IGNORE_PATTERN ?=
  457. +
  458. +GITIGNOREFILES ?=
  459. +GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  460. +
  461. +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
  462. +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
  463. +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
  464. + $(CODE_COVERAGE_OUTPUT_FILE);
  465. +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
  466. +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
  467. +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
  468. + $(CODE_COVERAGE_IGNORE_PATTERN);
  469. +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
  470. +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
  471. +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
  472. +code_coverage_quiet = $(code_coverage_quiet_$(V))
  473. +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
  474. +code_coverage_quiet_0 = --quiet
  475. +
  476. +# sanitizes the test-name: replaces with underscores: dashes and dots
  477. +code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
  478. +
  479. +# Use recursive makes in order to ignore errors during check
  480. +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"'
  481. +
  482. +# Capture code coverage data
  483. +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"'
  484. +
  485. +# Hook rule executed before code-coverage-capture, overridable by the user
  486. +code-coverage-capture-hook:
  487. +
  488. +'"$CODE_COVERAGE_RULES_CLEAN"'
  489. +
  490. +A''M_DISTCHECK_CONFIGURE_FLAGS ?=
  491. +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
  492. +
  493. +.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
  494. +']
  495. +
  496. + AC_SUBST([CODE_COVERAGE_RULES])
  497. + m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
  498. +])