aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2021-12-16 16:39:49 -0500
committerSteven Rostedt <rostedt@goodmis.org>2021-12-17 22:07:04 -0500
commitff03c2ba76353f0f34acece5226d99d8eaff84d9 (patch)
tree5b7258da0c6029f6f1c65057e487a2c6661f3553
parentba30cea26c3cc4b0670bcd36ed16edac6a7fa67c (diff)
downloadlibtraceevent-ff03c2ba76353f0f34acece5226d99d8eaff84d9.tar.gz
libtraceevent: Have make tags and TAGS honor O= build directory
Currently if one does a "make O=/tmp/build tags" the tags are still built in the source directory. Although this is uncommon to do, the tags (and TAGS) target should still honor the build directory. Link: https://lore.kernel.org/linux-trace-devel/20211216213956.13934-4-rostedt@goodmis.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--Makefile25
1 files changed, 16 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 4363e9b..8b3b5cc 100644
--- a/Makefile
+++ b/Makefile
@@ -246,15 +246,22 @@ define update_dir
fi);
endef
-tags: force
- $(RM) tags
- find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \
- --regex-c++='/_PE\(([^,)]*).*/TEP_ERRNO__\1/'
-
-TAGS: force
- $(RM) TAGS
- find . -name '*.[ch]' | xargs etags \
- --regex='/_PE(\([^,)]*\).*/TEP_ERRNO__\1/'
+VIM_TAGS = $(obj)/tags
+EMACS_TAGS = $(obj)/TAGS
+
+$(VIM_TAGS): force
+ $(RM) $(VIM_TAGS)
+ find $(src) -name '*.[ch]' | (cd $(obj) && xargs ctags --extra=+f --c-kinds=+px \
+ --regex-c++='/_PE\(([^,)]*).*/TEP_ERRNO__\1/')
+
+tags: $(VIM_TAGS)
+
+$(EMACS_TAGS): force
+ $(RM) $(EMACS_TAGS)
+ find $(src) -name '*.[ch]' | (cd $(obj) && xargs etags \
+ --regex='/_PE(\([^,)]*\).*/TEP_ERRNO__\1/')
+
+TAGS: $(EMACS_TAGS)
define build_prefix
(echo $1 > $@.tmp; \