diff options
| author | Robert Norton | 2018-06-27 18:02:14 +0100 |
|---|---|---|
| committer | Robert Norton | 2018-06-27 18:03:12 +0100 |
| commit | 405eb545df745c300a910c261dde219fc5322ab4 (patch) | |
| tree | 13f26eba39eea118c767e27080c4c76da459dd47 /mips/Makefile | |
| parent | 230cbb018b6808b103d1a815de64d48422a88191 (diff) | |
Add a mips_c_gcov target that builds mips_c model with coverage reporting.
Diffstat (limited to 'mips/Makefile')
| -rw-r--r-- | mips/Makefile | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mips/Makefile b/mips/Makefile index 3592ac54..a8bce143 100644 --- a/mips/Makefile +++ b/mips/Makefile @@ -18,8 +18,19 @@ mips: $(MIPS_PRE) $(MIPS_TLB) $(MIPS_SAILS) $(MIPS_MAIN) ../sail mips.c: $(MIPS_PRE) $(MIPS_TLB) $(MIPS_SAILS) $(MIPS_MAIN) Makefile ../sail $(SAIL) -O -memo_z3 -c $(filter %.sail, $^) 1> $@ +C_WARNINGS=-Wall -Wno-unused-but-set-variable -Wno-unused-label -Wno-maybe-uninitialized -Wno-return-type +C_OPT=-O2 +GCOV_FLAGS= mips_c: mips.c ../lib/sail.h ../lib/*.c Makefile - gcc -Wall -Wno-unused-but-set-variable -Wno-unused-label -Wno-maybe-uninitialized -Wno-return-type -O2 -g -I ../lib $< ../lib/*.c -lgmp -lz -o $@ + gcc $(C_OPT) $(C_WARNINGS) $(GCOV_FLAGS) -g -I ../lib $< ../lib/*.c -lgmp -lz -o $@ + +# Note that for coverage purposes O1 appears optimal. O0 means lots of obviously dead code but O2 risks reducing granularity too much. +mips_c_gcov: C_OPT=-O1 +mips_c_gcov: GCOV_FLAGS=-fprofile-arcs -ftest-coverage +mips_c_gcov: mips_c + +gcovr: + gcovr -r . --html --html-detail -o index.html sim.dtb: sim.dts dtc -O dtb -o $@ -b 0 $< |
