kbuild: fix make TAGS (for emacs use)
From: bongiojp@clarkson.edu <Jeremy Bongio>
make TAGS does not make source code tags for emacs. It instead
returns an error than "etags -" isn't valid. The problem is
easily remedied.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
diff --git a/Makefile b/Makefile
index 06995fe..d01b004 100644
--- a/Makefile
+++ b/Makefile
@@ -1203,9 +1203,15 @@
$(call cmd,cscope)
quiet_cmd_TAGS = MAKE $@
-cmd_TAGS = $(all-sources) | etags -
+define cmd_TAGS
+ rm -f $@; \
+ ETAGSF=`etags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
+ $(all-sources) | xargs etags $$ETAGSF -a
+endef
-# Exuberant ctags works better with -I
+TAGS: FORCE
+ $(call cmd,TAGS)
+
quiet_cmd_tags = MAKE $@
define cmd_tags
@@ -1214,9 +1220,6 @@
$(all-sources) | xargs ctags $$CTAGSF -a
endef
-TAGS: FORCE
- $(call cmd,TAGS)
-
tags: FORCE
$(call cmd,tags)