From bf5cece51a20eb4773d196ec650fb3af574afa17 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 12 Feb 2024 16:18:03 -0600 Subject: mk: initial commit This is a complete overhaul of the build system. This new implementations upports many new features and is very extensible. --- mk/cov.mk | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mk/cov.mk (limited to 'mk/cov.mk') diff --git a/mk/cov.mk b/mk/cov.mk new file mode 100644 index 0000000..1281e4e --- /dev/null +++ b/mk/cov.mk @@ -0,0 +1,30 @@ +targets += cov + +cov_cores = $(call per_target,cov_cores) + +define target/cov/prepare + enable_cov := 1 +endef + +define target/cov/setup + $$(call target_var,cov_cores) := \ + $$(foreach dep,$$(dep_tree/$$(rule_top)), \ + $$(if $$(filter test,$$(core_info/$$(dep)/targets)), \ + $$(eval $$(call build_target_top,$$(dep),test)) \ + $$(dep))) +endef + +define target/cov/rules + .PHONY: $$(rule_top_path)/cov + $$(rule_top_path)/cov: $$(obj)/html + + $$(obj)/html: $$(obj)/coverage.info | $$(obj) + @rm -rf $$@ + $$(call run,GENHTML) $$(GENHTML) $$< --output-dir=$$@ + + $$(obj)/coverage.info: $$(foreach core,$$(cov_cores),$$(obj/test/$$(core))/results.xml) | $$(obj) + $$(call run,COVERAGE) $$(VERILATOR)_coverage -write-info $$@ \ + $$(wildcard $$(foreach core,$$(cov_cores),$$(obj/test/$$(core))/coverage.dat)) + + $(call target_entrypoint,$(obj)/html) +endef -- cgit v1.2.3