|
30 | 30 | # tsan - enable thread sanitizer compiler feature |
31 | 31 | # ubsan - undefined behaviour sanitizer compiler feature |
32 | 32 | # bcheck - extended build checks |
| 33 | +# gcov - enable GCOV support during build |
33 | 34 | # W=123 build with warnings (default: off) |
34 | 35 | # DEBUG_CFLAGS additional compiler flags for debugging build |
35 | 36 | # EXTRA_CFLAGS additional compiler flags |
@@ -284,6 +285,11 @@ ifeq ("$(origin D)", "command line") |
284 | 285 | DEBUG_LDFLAGS_INTERNAL = $(DEBUG_LDFLAGS_DEFAULT) $(DEBUG_LDFLAGS) |
285 | 286 | endif |
286 | 287 |
|
| 288 | +ifneq (,$(findstring gcov,$(D))) |
| 289 | + DEBUG_CFLAGS_INTERNAL += -fprofile-arcs -ftest-coverage --coverage |
| 290 | + DEBUG_LDFLAGS_INTERNAL += -fprofile-generate --coverage |
| 291 | +endif |
| 292 | + |
287 | 293 | ifneq (,$(findstring verbose,$(D))) |
288 | 294 | DEBUG_CFLAGS_INTERNAL += -DDEBUG_VERBOSE_ERROR=1 |
289 | 295 | endif |
@@ -841,6 +847,7 @@ clean: $(CLEANDIRS) |
841 | 847 | crypto/*.o crypto/.deps/*.o.d \ |
842 | 848 | tune/*.o tune/.deps/*.o.d \ |
843 | 849 | libbtrfs/*.o libbtrfs/.deps/*.o.d \ |
| 850 | + *.gcno *.gcda *.gcov */*.gcno */*.gcda */*/.gcov \ |
844 | 851 | ioctl-test quick-test library-test library-test-static \ |
845 | 852 | mktables btrfs.static mkfs.btrfs.static fssum \ |
846 | 853 | btrfs.box btrfs.box.static json-formatter-test \ |
|
0 commit comments