Makefile 725 B

12345678910111213141516171819202122232425
  1. #
  2. # This is a project Makefile. It is assumed the directory this Makefile resides in is a
  3. # project subdirectory.
  4. #
  5. PROJECT_NAME := gcov_example
  6. include $(IDF_PATH)/make/project.mk
  7. GCOV := $(call dequote,$(CONFIG_TOOLPREFIX))gcov
  8. REPORT_DIR := $(BUILD_DIR_BASE)/coverage_report
  9. lcov-report:
  10. echo "Generating coverage report in: $(REPORT_DIR)"
  11. echo "Using gcov: $(GCOV)"
  12. mkdir -p $(REPORT_DIR)/html
  13. lcov --gcov-tool $(GCOV) -c -d $(BUILD_DIR_BASE) -o $(REPORT_DIR)/$(PROJECT_NAME).info
  14. genhtml -o $(REPORT_DIR)/html $(REPORT_DIR)/$(PROJECT_NAME).info
  15. cov-data-clean:
  16. echo "Remove coverage data files..."
  17. find $(BUILD_DIR_BASE) -name "*.gcda" -exec rm {} +
  18. rm -rf $(REPORT_DIR)
  19. .PHONY: lcov-report cov-data-clean