-# All the source files that have coverage counters.
-COVERAGE_FILES = \
- lib/dpif.c \
- lib/flow.c \
- lib/lockfile.c \
- lib/hmap.c \
- lib/mac-learning.c \
- lib/netdev.c \
- lib/netdev-linux.c \
- lib/netlink.c \
- lib/odp-util.c \
- lib/poll-loop.c \
- lib/process.c \
- lib/rconn.c \
- lib/rtnetlink.c \
- lib/stream.c \
- lib/timeval.c \
- lib/unixctl.c \
- lib/util.c \
- lib/vconn.c \
- ofproto/ofproto.c \
- ofproto/pktbuf.c \
- vswitchd/bridge.c \
- vswitchd/ovs-brcompatd.c
-lib/coverage-counters.c: $(COVERAGE_FILES) lib/coverage-scan.pl
- (cd $(srcdir) && $(PERL) lib/coverage-scan.pl $(COVERAGE_FILES)) > $@.tmp
- mv $@.tmp $@
-EXTRA_DIST += lib/coverage-scan.pl
-
-
-# Make sure that every vlog module listed in vlog-modules.def is
-# actually used somewhere.
-ALL_LOCAL += check-for-unused-vlog-modules
-check-for-unused-vlog-modules:
- if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
- cd $(srcdir); \
- decl_vlog=`sed -n 's/^VLOG_MODULE(\([_a-z0-9]\{1,\}\)).*$$/\1/p' \
- lib/vlog-modules.def | \
- LC_ALL=C sort -u | \
- xargs echo`; \
- used_vlog=`git grep VLM_ | \
- sed -n 's/.*VLM_\([a-z_0-9]\{1,\}\).*/\1/p' | \
- LC_ALL=C sort -u | \
- xargs echo`; \
- rc=0; \
- for decl in $$decl_vlog; do \
- case " $$used_vlog " in \
- *" $$decl "*) ;; \
- *) echo "vlog module $$decl is declared in lib/vlog-modules.def \
-but not used by any source file"; \
- rc=1 ;; \
- esac \
- done; \
- exit $$rc; \
- fi
-.PHONY: check-for-unused-vlog-modules