Cleanup futility test coverage framework a bit

This cleans up the Makfile and test scripts a bit, and adds a new test for
the builtin commands.

BUG=chromium:224734
BRANCH=ToT
TEST=make runtests

Change-Id: Ibf5aa867d4dcabc0e46daac6633036b035c99ac8
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207718
diff --git a/Makefile b/Makefile
index 33ca966..2f94d2e 100644
--- a/Makefile
+++ b/Makefile
@@ -172,7 +172,7 @@
 
 # Code coverage
 ifneq (${COV},)
-  COV_FLAGS = -O0 --coverage
+  COV_FLAGS = -O0 --coverage -DCOVERAGE
   CFLAGS += ${COV_FLAGS}
   LDFLAGS += ${COV_FLAGS}
   COV_INFO = ${BUILD}/coverage.info
@@ -758,8 +758,8 @@
 ${BUILD}/firmware/linktest/main: LIBS = ${FWLIB}
 ALL_OBJS += ${BUILD}/firmware/linktest/main.o
 
-.phony: fwlinktest
-fwlinktest: ${FWLIB} \
+.PHONY: fwlinktest
+fwlinktest: \
 	${BUILD}/firmware/linktest/main_vbinit \
 	${BUILD}/firmware/linktest/main_vbsf \
 	${BUILD}/firmware/linktest/main
@@ -1227,9 +1227,9 @@
 	lcov -a ${COV_INFO}.initial -a ${COV_INFO}.tests -o ${COV_INFO}.total
 	lcov -r ${COV_INFO}.total '/usr/*' '*/linktest/*' -o ${COV_INFO}.local
 	genhtml ${COV_INFO}.local -o ${BUILD}/coverage
-
-# Generate addtional coverage stats just for firmware subdir, because the
-# per-directory stats for the whole project don't include their own subdirs.
+# Generate addtional coverage stats just for firmware subdir, because the stats
+# for the whole project don't include subdirectory summaries. This will print
+# the summary for just the firmware sources.
 	lcov -r ${COV_INFO}.local '*/stub/*' -o ${COV_INFO}.nostub
 	lcov -e ${COV_INFO}.nostub '${SRCDIR}/firmware/*' \
 		-o ${COV_INFO}.firmware