Add 'tags' target to Makefile

Handy for quick code searches.

BUG=none
BRANCH=ToT
TEST=manual

  make tags

Change-Id: Icc21769a168d1760f4f21802e1183a519cfeb019
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/214620
Reviewed-by: Randall Spangler <rspangler@chromium.org>
diff --git a/Makefile b/Makefile
index 2cdecc0..300d317 100644
--- a/Makefile
+++ b/Makefile
@@ -226,7 +226,7 @@
 # If we're not building for a specific target, just stub out things like the
 # TPM commands and various external functions that are provided by the BIOS.
 ifeq (${FIRMWARE_ARCH},)
-INCLUDES += -Ifirmware/stub/include -Ihost/include -Ihost/lib/include
+INCLUDES += -Ihost/include -Ihost/lib/include
 else
 INCLUDES += -Ifirmware/arch/${FIRMWARE_ARCH}/include
 endif
@@ -681,6 +681,13 @@
 # Don't delete intermediate object files
 .SECONDARY:
 
+.PHONY: tags TAGS
+tags TAGS: ${CGPT_SRCS} ${FUTIL_SRCS} ${UTILLIB_SRCS} ${FWLIB_SRCS} \
+		$(if ${VBOOT2},${FWLIB2_SRCS}) \
+		$(wildcard $(patsubst -I%,%/*.h,${INCLUDES}))
+	${Q}\rm -f cscope.* TAGS
+	${Q}echo $^ | tr ' ' '\012' > cscope.files
+	${Q}$(if $(shell which etags 2>/dev/null),etags $^,echo "no etags")
 
 # ----------------------------------------------------------------------------
 # Firmware library