Makefile: add a prerequisite to the coverage-report target
Directly invoking make coverage-report as a target results in an error because its prerequisites are missing, This patch adds the compile-test prerequisite, which is run only once each time the compile-report target is invoked. In practice, the developer may decide to review the coverage-report results without necessarily rerunning for this coverage-test, if it has already been run. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto committed
Apr 14, 2022 at 02:25 UTC
96ddfecc5b9cd8d8b7b6316ed2523a489e879682
1 file changed
+6
-1
Makefile
+6
-1
@@ -3398,6 +3398,7 @@ coverage-clean-results:
3398
$(RM) coverage-untested-functions
3399
$(RM) -r cover_db/
3400
$(RM) -r cover_db_html/
3401
+ $(RM) coverage-test.made
3402
3403
coverage-clean: coverage-clean-results
3404
$(RM) $(addsuffix *.gcno,$(object_dirs))
@@ -3412,13 +3413,17 @@ coverage-compile:
3413
coverage-test: coverage-clean-results coverage-compile
3414
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
3415
DEFAULT_TEST_TARGET=test -j1 test
3416
+ touch coverage-test.made
3417
+
3418
+coverage-test.made:
3419
+ $(MAKE) coverage-test
3420
3421
coverage-prove: coverage-clean-results coverage-compile
3422
$(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
3423
DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS="$(GIT_PROVE_OPTS) -j1" \
3424
-j1 test
3425
3421
-coverage-report:
3426
+coverage-report: coverage-test.made
3427
$(QUIET_GCOV)for dir in $(object_dirs); do \
3428
$(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \
3429
done