Verified Commit 4ad75c84 authored by Karel Koci's avatar Karel Koci 🤘

Add option to generate coverage data using gcov

If user defines COV variable in environment, then C files are built
with gcov.

Always execute "make clean" before using "COV" variable when it wasn't
used in previous call to make.
parent 4f7843d2
......@@ -40,6 +40,11 @@ endif
CFLAGS_ALL += $(CFLAGS) --std=$(STANDARD) -pedantic -Wall -Wextra -fno-omit-frame-pointer -DOUTPUT_DIRECTORY=\"$(abspath $(O))\" -DSOURCE_DIRECTORY=\"$(abspath $(S))\" -DPAGE_SIZE=$(PAGE_SIZE) -DPREFIX=$(abspath $(O)) -DMAX_LOG_LEVEL=$(MAX_LOG_LEVEL) -DPLUGIN_PATH=\"$(PLUGIN_PATH)\" $(addprefix -D,$(EXTRA_DEFINES))
CXXFLAGS_ALL += $(CXXFLAGS) $(CFLAGS) --std=$(STANDARD) -pedantic -Wall -Wextra -fno-omit-frame-pointer -DOUTPUT_DIRECTORY=\"$(abspath $(O))\" -DSOURCE_DIRECTORY=\"$(abspath $(S))\" -DPAGE_SIZE=$(PAGE_SIZE) -DPREFIX=$(abspath $(O)) -DMAX_LOG_LEVEL=$(MAX_LOG_LEVEL) -DPLUGIN_PATH=\"$(PLUGIN_PATH)\" $(addprefix -D,$(EXTRA_DEFINES))
ifdef COV
CFLAGS_ALL += -fprofile-arcs -ftest-coverage -DCOVERAGE
CXXFLAGS_ALL += -fprofile-arcs -ftest-coverage -DCOVERAGE
LDFLAGS_ALL += -fprofile-arcs
ifdef STATIC
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment