[Skiboot] [PATCH] consolidate gcov flags into HOSTGCOVFLAGS for host binaries
Stewart Smith
stewart at linux.vnet.ibm.com
Thu Sep 1 15:46:37 AEST 2016
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
Makefile.main | 2 ++
ccan/Makefile.check | 2 +-
core/test/Makefile.check | 4 ++--
hdata/test/Makefile.check | 2 +-
hw/ipmi/test/Makefile.check | 2 +-
libc/test/Makefile.check | 4 ++--
libflash/test/Makefile.check | 2 +-
7 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Makefile.main b/Makefile.main
index 041aab1..ac74e46 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -41,6 +41,8 @@ HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \
$(call try-cflag,$(HOSTCC),-Wstack-usage=1024)
HOSTCFLAGS += -DDEBUG -DCCAN_LIST_DEBUG
+HOSTGCOVCFLAGS = -fprofile-arcs -ftest-coverage -lgcov -O0 -g -pg
+
VALGRIND=valgrind -q --show-reachable=yes --error-exitcode=99
# Target options
diff --git a/ccan/Makefile.check b/ccan/Makefile.check
index 2bc1f1d..a596766 100644
--- a/ccan/Makefile.check
+++ b/ccan/Makefile.check
@@ -28,7 +28,7 @@ $(CCAN_TEST) : % : %.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I . -Iccan/ -o $@ $<,$<)
$(CCAN_TEST:%=%-gcov): %-gcov : %.c
- $(call Q, HOSTCC , (cd $(dir $<); $(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -O0 -g -I $(shell pwd) -I$(shell pwd)/./ccan/ -pg -o $(notdir $@) $(notdir $<) ), $<)
+ $(call Q, HOSTCC , (cd $(dir $<); $(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I $(shell pwd) -I$(shell pwd)/./ccan/ -o $(notdir $@) $(notdir $<) ), $<)
-include $(wildcard ccan/*/test/*.d)
diff --git a/core/test/Makefile.check b/core/test/Makefile.check
index 69abd01..fa1b806 100644
--- a/core/test/Makefile.check
+++ b/core/test/Makefile.check
@@ -62,10 +62,10 @@ $(CORE_TEST_NOSTUB) : % : %.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -I libfdt -o $@ $< , $<)
$(CORE_TEST:%=%-gcov): %-gcov : %.c %
- $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -O0 -g -I include -I . -I libfdt -lgcov -o $@ $< core/test/stubs.o, $<)
+ $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I include -I . -I libfdt -lgcov -o $@ $< core/test/stubs.o, $<)
$(CORE_TEST_NOSTUB:%=%-gcov) : %-gcov : %.c %
- $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -O0 -g -I include -I . -I libfdt -lgcov -o $@ $< , $<)
+ $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I include -I . -I libfdt -lgcov -o $@ $< , $<)
-include $(wildcard core/test/*.d)
diff --git a/hdata/test/Makefile.check b/hdata/test/Makefile.check
index 612321b..8318eab 100644
--- a/hdata/test/Makefile.check
+++ b/hdata/test/Makefile.check
@@ -40,7 +40,7 @@ $(HDATA_TEST) : % : %.c
$(call Q, HOSTCC , $(HOSTCC) $(HOSTCFLAGS) -DTEST -O0 -g -I hdata -I include -I . -I libfdt -o $@ $< hdata/test/stubs.o, $<)
$(HDATA_TEST:%=%-gcov): %-gcov : %.c %
- $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -DTEST -O0 -g -I include -I . -I data -I libfdt -lgcov -o $@ $< hdata/test/stubs.o, $<)
+ $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -DTEST -I include -I . -I data -I libfdt -lgcov -o $@ $< hdata/test/stubs.o, $<)
-include $(wildcard hdata/test/*.d)
diff --git a/hw/ipmi/test/Makefile.check b/hw/ipmi/test/Makefile.check
index be5b563..c3d6359 100644
--- a/hw/ipmi/test/Makefile.check
+++ b/hw/ipmi/test/Makefile.check
@@ -20,7 +20,7 @@ $(IPMI_TEST) : % : %.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -o $@ $<, $<)
$(IPMI_TEST:%=%-gcov): %-gcov : %.c %
- $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -O0 -g -I include -I . -I libfdt -lgcov -o $@ $<, $<)
+ $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I include -I . -I libfdt -lgcov -o $@ $<, $<)
$(IPMI_TEST:%=%-gcov): % : $(%.d:-gcov=)
diff --git a/libc/test/Makefile.check b/libc/test/Makefile.check
index b757f2f..265c586 100644
--- a/libc/test/Makefile.check
+++ b/libc/test/Makefile.check
@@ -35,13 +35,13 @@ $(LIBC_TEST) : % : %.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -I libfdt -I libc/include -o $@ $<, $<)
$(LIBC_TEST:%=%-gcov): %-gcov : %.c %
- $(call Q, HOSTCC ,(cd $(dir $<); $(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -lgcov -O0 -g -I$(shell pwd)/include -I$(shell pwd) -I$(shell pwd)/libfdt -I$(shell pwd)/libc/include -o $(notdir $@) $(notdir $<)), $<)
+ $(call Q, HOSTCC ,(cd $(dir $<); $(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I$(shell pwd)/include -I$(shell pwd) -I$(shell pwd)/libfdt -I$(shell pwd)/libc/include -o $(notdir $@) $(notdir $<)), $<)
$(LIBC_DUALLIB_TEST) : % : %.o %-test.o
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -I libfdt -o $@ $@-test.o $<, $<)
$(LIBC_DUALLIB_TEST:%=%-gcov) : %-gcov : %-gcov.o %-gcov-test.o
- $(call Q, HOSTCC ,(cd $(dir $<); $(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -lgcov -O0 -pg -g -I$(shell pwd)/include -I$(shell pwd)/. -I$(shell pwd)/libfdt -o $(notdir $@) $(notdir $@)-test.o $(notdir $<)), $<)
+ $(call Q, HOSTCC ,(cd $(dir $<); $(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I$(shell pwd)/include -I$(shell pwd)/. -I$(shell pwd)/libfdt -o $(notdir $@) $(notdir $@)-test.o $(notdir $<)), $<)
$(LIBC_DUALLIB_TEST:%=%-test.o): %-test.o : %-test.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -I libfdt -I libc/include -ffreestanding -o $@ -c $<, $<)
diff --git a/libflash/test/Makefile.check b/libflash/test/Makefile.check
index 0351a64..1f92b9d 100644
--- a/libflash/test/Makefile.check
+++ b/libflash/test/Makefile.check
@@ -25,7 +25,7 @@ $(LIBFLASH_TEST) : % : %.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -o $@ $< libflash/test/stubs.o, $<)
$(LIBFLASH_TEST:%=%-gcov): %-gcov : %.c %
- $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -lgcov -O0 -g -I include -I . -o $@ $< libflash/test/stubs.o, $<)
+ $(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I include -I . -o $@ $< libflash/test/stubs.o, $<)
-include $(wildcard libflash/test/*.d)
--
2.7.4
More information about the Skiboot
mailing list