From patchwork Fri Dec 17 00:42:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 204F8C43217 for ; Fri, 17 Dec 2021 00:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbhLQAmV (ORCPT ); Thu, 16 Dec 2021 19:42:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbhLQAmS (ORCPT ); Thu, 16 Dec 2021 19:42:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 423E0C06173E for ; Thu, 16 Dec 2021 16:42:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D2F5D61F67 for ; Fri, 17 Dec 2021 00:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B91C36AEE; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004DQ-Te; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 9/9] libtracefs: Have make tags and TAGS honor O= build directory Date: Thu, 16 Dec 2021 19:42:14 -0500 Message-Id: <20211217004214.16074-10-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" 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) --- Makefile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 58b4219e7b62..bf085bfdb800 100644 --- a/Makefile +++ b/Makefile @@ -198,7 +198,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 @@ -221,18 +221,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.