From: Aaron Merey Date: Thu, 9 May 2024 23:17:20 +0000 (-0400) Subject: Makefile.am: Avoid code duplication X-Git-Tag: elfutils-0.192~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d69b0f46215960bd9487cf68dba92d88573eed2;p=thirdparty%2Felfutils.git Makefile.am: Avoid code duplication Parameterize lcov/genhtml option ignore-errors in order to avoid code duplication. Signed-off-by: Aaron Merey --- diff --git a/Makefile.am b/Makefile.am index a1f0b0c3..69af63ac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -78,24 +78,16 @@ coverage: $(COVERAGE_OUTPUT_INDEX_HTML) @echo 'file://$(abs_builddir)/$(COVERAGE_OUTPUT_INDEX_HTML)' if LCOV_OLD -$(COVERAGE_OUTPUT_INDEX_HTML): $(COVERAGE_OUTPUT_FILE) - LC_ALL=C $(GENHTML) \ - --legend \ - --show-details \ - --rc=genhtml_branch_coverage=1 \ - --title='$(COVERAGE_TITLE)' \ - --prefix='$(abspath $(abs_srcdir))' \ - --prefix='$(realpath $(abs_srcdir))' \ - --prefix='$(abspath $(abs_builddir)/..)' \ - --prefix='$(realpath $(abs_builddir)/..)' \ - --output-directory='$(COVERAGE_OUTPUT_DIRECTORY)' \ - $< +ignore_errors = else +ignore_errors = --ignore-errors empty,negative +endif + $(COVERAGE_OUTPUT_INDEX_HTML): $(COVERAGE_OUTPUT_FILE) LC_ALL=C $(GENHTML) \ --legend \ --show-details \ - --ignore-errors empty,negative \ + $(ignore_errors) \ --rc=genhtml_branch_coverage=1 \ --title='$(COVERAGE_TITLE)' \ --prefix='$(abspath $(abs_srcdir))' \ @@ -104,30 +96,17 @@ $(COVERAGE_OUTPUT_INDEX_HTML): $(COVERAGE_OUTPUT_FILE) --prefix='$(realpath $(abs_builddir)/..)' \ --output-directory='$(COVERAGE_OUTPUT_DIRECTORY)' \ $< -endif -if LCOV_OLD $(COVERAGE_OUTPUT_FILE): $(LCOV) \ --capture \ --no-external \ --no-checksum \ + $(ignore_errors) \ --rc=lcov_branch_coverage=1 \ --gcov-tool='$(GCOV)' \ --output-file='$@' \ $(LCOV_DIRS_ARGS) -else -$(COVERAGE_OUTPUT_FILE): - $(LCOV) \ - --capture \ - --no-external \ - --no-checksum \ - --ignore-errors empty,negative \ - --rc=lcov_branch_coverage=1 \ - --gcov-tool='$(GCOV)' \ - --output-file='$@' \ - $(LCOV_DIRS_ARGS) -endif endif # Tell version 3.79 and up of GNU make to not build goals in this