diff mbox

fixdep: suppress consecutive / from file paths in dependency list files

Message ID nycvar.YSQ.7.76.1804161456540.28462@knanqh.ubzr (mailing list archive)
State New, archived
Headers show

Commit Message

Nicolas Pitre April 16, 2018, 7:07 p.m. UTC
Underscores in symbol names are translated into slashes for path names.
Filesystems treat consecutive slashes as if there was only one, so
let's do the same in the dependency list for easier grepping, etc.

Signed-off-by: Nicolas Pitre <nico@linaro.org>

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Masahiro Yamada May 5, 2018, 10:31 a.m. UTC | #1
2018-04-17 4:07 GMT+09:00 Nicolas Pitre <nicolas.pitre@linaro.org>:
> Underscores in symbol names are translated into slashes for path names.
> Filesystems treat consecutive slashes as if there was only one, so
> let's do the same in the dependency list for easier grepping, etc.
>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>


Applied to linux-kbuild. Thanks!
diff mbox

Patch

diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index f387538c58..850966f3d6 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -115,7 +115,7 @@  static void usage(void)
  */
 static void print_dep(const char *m, int slen, const char *dir)
 {
-	int c, i;
+	int c, prev_c = '/', i;
 
 	printf("    $(wildcard %s/", dir);
 	for (i = 0; i < slen; i++) {
@@ -124,7 +124,9 @@  static void print_dep(const char *m, int slen, const char *dir)
 			c = '/';
 		else
 			c = tolower(c);
-		putchar(c);
+		if (c != '/' || prev_c != '/')
+			putchar(c);
+		prev_c = c;
 	}
 	printf(".h) \\\n");
 }