Skip to contentSkip to conversation

Makefile: Skip symbolic links to files for cscope

PATCH New Andy Shevchenko 2 participants 2 messages Oct 8, 2019 – Oct 17, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Skip symbolic links to files for cscope

cscope complains that it can't find files that appears to be symbolic links

cscope: cannot find file tools/binman/test/u_boot_binman_syms_bad.c
cscope: cannot find file tools/version.h

find -L tests properties, but name, and cscope can't cope with symbolic links (a lot of bugs in upstream were simple closed as kinda invalid).

To work around the problem, exclude symbolic links from the cscope.files. Note, it's done in two pass to speed up the process (-exec realpath ... approach is not portable and introduces a 3x delay).

---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)
Makefile +3 -0
index 54da5cd51c..968a70885b 100644
@@ -1793,6 +1793,9 @@ etags:
 cscope:
 		$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \
 						cscope.files
+		@find $(TAG_SUBDIRS) -name '*.[chS]' -type l -print | \
+			grep -xvf - cscope.files > cscope.files.no-symlinks; \
+		mv cscope.files.no-symlinks cscope.files
 		cscope -b -q -k
 
 SYSTEM_MAP = \
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 Makefile: Skip symbolic links to files for cscope

Quoted 5 lines · Andy Shevchenko

cscope complains that it can't find files that appears to be symbolic links

cscope: cannot find file tools/binman/test/u_boot_binman_syms_bad.c
cscope: cannot find file tools/version.h

Quoted 8 lines

find -L tests properties, but name, and cscope can't cope with symbolic links (a lot of bugs in upstream were simple closed as kinda invalid).

To work around the problem, exclude symbolic links from the cscope.files. Note, it's done in two pass to speed up the process (-exec realpath ... approach is not portable and introduces a 3x delay).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191017/bdf23c08/attachment.sig>