diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-02-12 16:18:03 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-02-20 11:11:18 -0600 |
| commit | bf5cece51a20eb4773d196ec650fb3af574afa17 (patch) | |
| tree | 8abd33c815b38a3dee673ea345f106d4ddcae9ab /mk/cov.mk | |
| parent | 691a441bfeb90642840d2869cb04ec146e274a1e (diff) | |
mk: initial commit
This is a complete overhaul of the build system. This new
implementations upports many new features and is very extensible.
Diffstat (limited to 'mk/cov.mk')
| -rw-r--r-- | mk/cov.mk | 30 |
1 files changed, 30 insertions, 0 deletions
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 |
