diff mbox series

[2/2] Makefile: Skip the meson subdir in cscope/TAGS/ctags

Message ID 159916247553.691541.10480293747685886851.stgit@bahia.lan (mailing list archive)
State New, archived
Headers show
Series Makefile: Some more cleanups for cscope/TAGS/ctags | expand

Commit Message

Greg Kurz Sept. 3, 2020, 7:47 p.m. UTC
If the meson submodule is present, we don't really want to index its
source code. Consolidate the find command in a single place and use
it for cscope, ctags and etags. Note that this now causes ctags and
etags to also index assembly files, but this is okay since they both
have been supporting assembly since 2001 at least.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 Makefile |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Paolo Bonzini Sept. 3, 2020, 8:17 p.m. UTC | #1
On 03/09/20 21:47, Greg Kurz wrote:
> If the meson submodule is present, we don't really want to index its
> source code. Consolidate the find command in a single place and use
> it for cscope, ctags and etags. Note that this now causes ctags and
> etags to also index assembly files, but this is okay since they both
> have been supporting assembly since 2001 at least.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  Makefile |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index a9d3e2c4d375..34dd9e6c4c4a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -229,20 +229,22 @@ distclean: clean ninja-distclean
>  	rm -f linux-headers/asm
>  	rm -Rf .sdk
>  
> +find-src-path = find "$(SRC_PATH)/" -path "$(SRC_PATH)/meson" -prune -o -name "*.[chsS]"
> +
>  .PHONY: ctags
>  ctags:
>  	rm -f tags
> -	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
> +	$(find-src-path) -exec ctags --append {} +
>  
>  .PHONY: TAGS
>  TAGS:
>  	rm -f TAGS
> -	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
> +	$(find-src-path) -exec etags --append {} +
>  
>  .PHONY: cscope
>  cscope:
>  	rm -f "$(SRC_PATH)"/cscope.*
> -	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
> +	$(find-src-path) -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
>  	cscope -b -i"$(SRC_PATH)/cscope.files"
>  
>  # Needed by "meson install"
> 
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

so this can go through the trivial tree as well.

Paolo
Laurent Vivier Sept. 9, 2020, 1:45 p.m. UTC | #2
Le 03/09/2020 à 21:47, Greg Kurz a écrit :
> If the meson submodule is present, we don't really want to index its
> source code. Consolidate the find command in a single place and use
> it for cscope, ctags and etags. Note that this now causes ctags and
> etags to also index assembly files, but this is okay since they both
> have been supporting assembly since 2001 at least.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
>  Makefile |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index a9d3e2c4d375..34dd9e6c4c4a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -229,20 +229,22 @@ distclean: clean ninja-distclean
>  	rm -f linux-headers/asm
>  	rm -Rf .sdk
>  
> +find-src-path = find "$(SRC_PATH)/" -path "$(SRC_PATH)/meson" -prune -o -name "*.[chsS]"
> +
>  .PHONY: ctags
>  ctags:
>  	rm -f tags
> -	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
> +	$(find-src-path) -exec ctags --append {} +
>  
>  .PHONY: TAGS
>  TAGS:
>  	rm -f TAGS
> -	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
> +	$(find-src-path) -exec etags --append {} +
>  
>  .PHONY: cscope
>  cscope:
>  	rm -f "$(SRC_PATH)"/cscope.*
> -	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
> +	$(find-src-path) -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
>  	cscope -b -i"$(SRC_PATH)/cscope.files"
>  
>  # Needed by "meson install"
> 
> 

Applied to my trivial-patches branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index a9d3e2c4d375..34dd9e6c4c4a 100644
--- a/Makefile
+++ b/Makefile
@@ -229,20 +229,22 @@  distclean: clean ninja-distclean
 	rm -f linux-headers/asm
 	rm -Rf .sdk
 
+find-src-path = find "$(SRC_PATH)/" -path "$(SRC_PATH)/meson" -prune -o -name "*.[chsS]"
+
 .PHONY: ctags
 ctags:
 	rm -f tags
-	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
+	$(find-src-path) -exec ctags --append {} +
 
 .PHONY: TAGS
 TAGS:
 	rm -f TAGS
-	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
+	$(find-src-path) -exec etags --append {} +
 
 .PHONY: cscope
 cscope:
 	rm -f "$(SRC_PATH)"/cscope.*
-	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
+	$(find-src-path) -print | sed -e 's,^\./,,' > "$(SRC_PATH)/cscope.files"
 	cscope -b -i"$(SRC_PATH)/cscope.files"
 
 # Needed by "meson install"