test/memzone: fix copy-paste typo
[dpdk.git] / mk / rte.sdkgcov.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 ifdef T
5 ifeq ("$(origin T)", "command line")
6 $(error "Cannot use T= with gcov target")
7 endif
8 endif
9
10 ifeq (,$(wildcard $(RTE_OUTPUT)/.config))
11   $(error "need a make config first")
12 else
13   include $(RTE_SDK)/mk/rte.vars.mk
14 endif
15 ifeq (,$(wildcard $(RTE_OUTPUT)/Makefile))
16   $(error "need a make config first")
17 endif
18
19 INPUTDIR  = $(RTE_OUTPUT)
20 OUTPUTDIR =  $(RTE_OUTPUT)/gcov
21
22 .PHONY: gcovclean
23 gcovclean:
24         $(Q)find $(INPUTDIR)/build -name "*.gcno" -o -name "*.gcda" -exec rm {} \;
25         $(Q)rm -rf $(OUTPUTDIR)
26
27 .PHONY: gcov
28 gcov:
29         $(Q)for APP in test ; do \
30                 mkdir -p $(OUTPUTDIR)/$$APP ; cd $(OUTPUTDIR)/$$APP ; \
31                 for FIC in `strings $(RTE_OUTPUT)/app/$$APP | grep gcda | sed s,gcda,o,` ; do \
32                         SUBDIR=`basename $$FIC`;\
33                         mkdir $$SUBDIR ;\
34                         cd $$SUBDIR ;\
35                         $(GCOV) $(RTE_OUTPUT)/app/$$APP -o $$FIC > gcov.log; \
36                         cd - >/dev/null;\
37                 done ; \
38                 cd - >/dev/null; \
39         done