All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Subject: [PATCH v2 02/15] libtracefs: Have make tags and TAGS honor O= build directory
Date: Fri, 17 Dec 2021 00:50:28 -0500	[thread overview]
Message-ID: <20211217055041.19559-3-rostedt@goodmis.org> (raw)
In-Reply-To: <20211217055041.19559-1-rostedt@goodmis.org>

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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@goodmis.org>
---
 Makefile | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 85b3c39a867c..4910ebe140b9 100644
--- a/Makefile
+++ b/Makefile
@@ -207,7 +207,7 @@ endif
 		$(src)/$(UTEST_DIR)/$(UTEST_BINARY)
 
 define find_tag_files
-	find . -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' \
+	find $(src) -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' \
 		! -name '\.#' -print
 endef
 
@@ -230,18 +230,26 @@ $(BUILD_PREFIX): force
 $(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template $(BUILD_PREFIX) $(VERSION_FILE)
 	$(Q) $(call do_make_pkgconfig_file,$(prefix))
 
-tags:	force
-	$(RM) tags
-	$(call find_tag_files) | xargs ctags --extra=+f --c-kinds=+px
+VIM_TAGS = $(obj)/tags
+EMACS_TAGS = $(obj)/TAGS
+CSCOPE_TAGS = $(obj)/cscope
 
-TAGS:	force
-	$(RM) TAGS
-	$(call find_tag_files) | xargs etags
+$(VIM_TAGS): force
+	$(RM) $@
+	$(call find_tag_files) | (cd $(obj) && xargs ctags --extra=+f --c-kinds=+px)
 
-cscope: force
-	$(RM) cscope*
+$(EMACS_TAGS): force
+	$(RM) $@
+	$(call find_tag_files) | (cd $(obj) && xargs etags)
+
+$(CSCOPE_TAGS): force
+	$(RM) $(obj)/cscope*
 	$(call find_tag_files) | cscope -b -q
 
+tags: $(VIM_TAGS)
+TAGS: $(EMACS_TAGS)
+cscope: $(CSCOPE_TAGS)
+
 ifeq ("$(DESTDIR)", "")
 # If DESTDIR is not defined, then test if after installing the library
 # and running ldconfig, if the library is visible by ld.so.
-- 
2.33.0


  parent reply	other threads:[~2021-12-17  5:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  5:50 [PATCH v2 00/15] libtracefs: Updates to the Makefile Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 01/15] libtracefs: Update gitignore file Steven Rostedt
2021-12-17  5:50 ` Steven Rostedt [this message]
2021-12-17  5:50 ` [PATCH v2 03/15] libtracefs: Fix stream example Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 04/15] libtracefs: Fix samples Makefile Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 05/15] libtracefs: Remove unused "bindir" from Makefile Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 06/15] libtracefs: Remove unneeded blkflags " Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 07/15] libtracefs: Add "DESCEND" output when descending into directories during build Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 08/15] libtracefs: Have make clean output cleaner Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 09/15] libtracefs: Quiet mv: cannot stat message for libtracefs.a Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 10/15] libtracefs: Quiet "Nothing to be done for" messages Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 11/15] libtracefs: Have sample build look cleaner Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 12/15] libtracefs: Have samples build in separate directory from bin Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 13/15] libtracefs: Build in the same directories as the source Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 14/15] libtracefs: Add clean descend Steven Rostedt
2021-12-17  5:50 ` [PATCH v2 15/15] libtracefs: Remove build_prefix file on make clean Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211217055041.19559-3-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.