Makefile 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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_SDK_TOOLPREFIX))gcov
  8. REPORT_DIR := $(BUILD_DIR_BASE)/coverage_report
  9. pre-cov-report:
  10. echo "Generating coverage report in: $(REPORT_DIR)"
  11. echo "Using gcov: $(GCOV)"
  12. mkdir -p $(REPORT_DIR)/html
  13. lcov-report: | pre-cov-report
  14. echo "WARNING: lcov-report is deprecated. Please use gcovr-report instead."
  15. lcov --gcov-tool $(GCOV) -c -d $(BUILD_DIR_BASE) -o $(REPORT_DIR)/$(PROJECT_NAME).info
  16. genhtml -o $(REPORT_DIR)/html $(REPORT_DIR)/$(PROJECT_NAME).info
  17. gcovr-report: | check_python_dependencies pre-cov-report
  18. cd $(BUILD_DIR_BASE)
  19. gcovr -r $(PROJECT_PATH) --gcov-executable $(GCOV) -s --html-details $(REPORT_DIR)/html/index.html
  20. cov-data-clean:
  21. echo "Remove coverage data files..."
  22. find $(BUILD_DIR_BASE) -name "*.gcda" -exec rm {} +
  23. rm -rf $(REPORT_DIR)
  24. .PHONY: lcov-report gcovr-report cov-data-clean