[PATCH 15/26] kbuild: escape '#' in .target.cmd files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sam Ravnborg <[email protected]>
Date: 1135549274 +0100

Commandlines are contained in the .<target>.cmd files and in case they
contain a '#' char make see this as start of comment.
Teach fixdep to escape the '#' char so make will assing the full commandline.

Signed-off-by: Sam Ravnborg <[email protected]>

---

 scripts/basic/fixdep.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

4d99f93bdaa1ab49188cac67b4aae9180f8e3960
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 0b61bea..679124b 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -130,9 +130,22 @@ void usage(void)
 	exit(1);
 }
 
+/*
+ * Print out the commandline prefixed with cmd_<target filename> :=
+ * If commandline contains '#' escape with '\' so make to not see
+ * the '#' as a start-of-comment symbol
+ **/
 void print_cmdline(void)
 {
-	printf("cmd_%s := %s\n\n", target, cmdline);
+	char *p = cmdline;
+
+	printf("cmd_%s := ", target);
+	for (; *p; p++) {
+		if (*p == '#')
+			printf("\\");
+		printf("%c", *p);
+	}
+	printf("\n\n");
 }
 
 char * str_config  = NULL;
-- 
1.0.6

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux