Skip to contentSkip to conversation

Makefile: A few fixes to tag generation

PATCH Applied Peter Xu 2 participants 7 messages Aug 4, 2021 – Oct 15, 2021 Kbuild

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

v2 cover Makefile: A few fixes to tag generation

I didn't squash patch 1 because they fix different things at different places (patch 1 removes the "meson" dir warning on master branch already for gtags). Patch 2 is the same as posted previous on the list.

Please have a look, thanks.

Peter Xu (2):
Makefile: Fix gtags generation
Makefile: Fix cscope issues on MacOS and soft links

 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH v2 1/2 Makefile: Fix gtags generation

We should use "-print" or otherwise all "-prone" is ignored.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 401c623a65..d39d3670de 100644
@@ -250,7 +250,7 @@ gtags:
 		"GTAGS", "Remove old $@ files")
 	$(call quiet-command, 				\
 	        (cd $(SRC_PATH) && 			\
-		 $(find-src-path) | gtags -f -), 	\
+		 $(find-src-path) -print | gtags -f -),	\
 		"GTAGS", "Re-index $(SRC_PATH)")
 
 .PHONY: TAGS
Signature · 1 line
2.31.1
author
#2 lore raw

PATCH v2 2/2 Makefile: Fix cscope issues on MacOS and soft links

In reply to Peter Xu

This patch fixes actually two issues with 'make cscope'.

Firstly, it fixes the command for MacOS "find" command as MacOS will append the full path of "$(SRC_PATH)/" before each found entry, then after the final "./" replacement trick it'll look like (e.g., "qapi/qmp-dispatch.c"):

/qapi/qmp-dispatch.c

Which will point to the root directory instead.

Fix it by simply remove the "/" in "$(SRC_PATH)/" of "find-src-path", then it'll work for at least both Linux and MacOS.

The other OS-independent issue is to start proactively ignoring soft links when generating tags, otherwise by default on master branch we'll see this error when "make cscope":

cscope: cannot find file subprojects/libvhost-user/include/atomic.h

This patch should fix the two issues altogether.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index d39d3670de..eeb21f0e6a 100644
@@ -229,7 +229,8 @@ distclean: clean
 	rm -f linux-headers/asm
 	rm -Rf .sdk
 
-find-src-path = find "$(SRC_PATH)/" -path "$(SRC_PATH)/meson" -prune -o \( -name "*.[chsS]" -o -name "*.[ch].inc" \)
+find-src-path = find "$(SRC_PATH)" -path "$(SRC_PATH)/meson" -prune -o \
+	-type l -prune -o \( -name "*.[chsS]" -o -name "*.[ch].inc" \)
 
 .PHONY: ctags
 ctags:
Signature · 1 line
2.31.1
author
#3 lore raw
In reply to Peter Xu
Quoted 4 lines · Peter Xu

I didn't squash patch 1 because they fix different things at different places (patch 1 removes the "meson" dir warning on master branch already for gtags). Patch 2 is the same as posted previous on the list.

Quoted 8 lines

Please have a look, thanks.

Peter Xu (2):
Makefile: Fix gtags generation
Makefile: Fix cscope issues on MacOS and soft links

 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Ping - Anyone would like to pick this up? Even on linux I still see:

cscope: cannot find file subprojects/libvhost-user/include/atomic.h

Thanks,

Signature · 1 line
Peter Xu
author
#4 lore raw
Quoted 11 lines · Peter Xu
Quoted 10 lines · Peter Xu

I didn't squash patch 1 because they fix different things at different places (patch 1 removes the "meson" dir warning on master branch already for gtags). Patch 2 is the same as posted previous on the list.

Please have a look, thanks.

Peter Xu (2):
Makefile: Fix gtags generation
Makefile: Fix cscope issues on MacOS and soft links

Quoted 6 lines
Quoted 2 lines
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Ping - Anyone would like to pick this up? Even on linux I still see:

cscope: cannot find file subprojects/libvhost-user/include/atomic.h

Ping?

Signature · 1 line
Peter Xu
author
#5 lore raw
In reply to Peter Xu
Quoted 5 lines · Peter Xu

I didn't squash patch 1 because they fix different things at different places (patch 1 removes the "meson" dir warning on master branch already for gtags). Patch 2 is the same as posted previous on the list.

Please have a look, thanks.

Ping again.. comments welcomed..

Signature · 1 line
Peter Xu
#6 lore raw
In reply to Peter Xu
Quoted 4 lines · Peter Xu

I didn't squash patch 1 because they fix different things at different places (patch 1 removes the "meson" dir warning on master branch already for gtags). Patch 2 is the same as posted previous on the list.

Quoted 9 lines

Please have a look, thanks.

Peter Xu (2):
Makefile: Fix gtags generation
Makefile: Fix cscope issues on MacOS and soft links

  Makefile | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

Queued, thanks!

Paolo