[PATCH 03/10] libtraceevent: Have make tags and TAGS honor O= build directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>

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.

Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
---
 Makefile | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 4363e9b73dc3..8b3b5cc1ea35 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;	\
-- 
2.33.0




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux