Having a target defined as phony within a condition
while another target is always defined as phony
causes an automake warning:
Makefile.am:67: warning: .PHONY was already defined in condition TRUE, which includes condition GCOV ...
config/eu.am:141: ... '.PHONY' previously defined here
Makefile.am:21: 'config/eu.am' included from here
tests/Makefile.am:895: warning: .PHONY was already defined in condition TRUE, which includes condition GCOV ...
config/eu.am:141: ... '.PHONY' previously defined here
tests/Makefile.am:19: 'config/eu.am' included from here
Instead, list all the custom targets that are phony
in the common definitions in the eu.am file.
Since it is all related to coverage at this moment,
the list can be grouped as it is instead of moved or split.
* Makefile.am: remove .PHONY list in conditional
* config/eu.am: add coverage target to .PHONY list
* tests/Makefile.am: remove .PHONY list in conditional
Signed-off-by: Michael Pratt <mcpratt@pm.me>
all_COVERAGE_DIRS = $(sort $(src_COVERAGE_DIRS) $(build_COVERAGE_DIRS))
LCOV_DIRS_ARGS = $(patsubst %,--directory=%,$(all_COVERAGE_DIRS))
-.PHONY: coverage
coverage: $(COVERAGE_OUTPUT_INDEX_HTML)
@echo 'file://$(abs_builddir)/$(COVERAGE_OUTPUT_INDEX_HTML)'
COVERAGE_OUTPUT_DIRECTORY = coverage
COVERAGE_OUTPUT_FILE = $(PACKAGE_NAME).lcov
-.PHONY: clean-coverage
+.PHONY: clean-coverage coverage
+
clean-local: clean-coverage
clean-coverage:
-rm -rf $(COVERAGE_OUTPUT_DIRECTORY)
if GCOV
check: check-am coverage
-.PHONY: coverage
coverage:
-$(srcdir)/coverage.sh
endif