kbuild: escape '#' in .target.cmd files
authorSam Ravnborg <sam@mars.ravnborg.org>
Sun, 25 Dec 2005 22:21:14 +0000 (23:21 +0100)
committerSam Ravnborg <sam@mars.ravnborg.org>
Sun, 25 Dec 2005 22:21:14 +0000 (23:21 +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 <sam@ravnborg.org>
scripts/basic/fixdep.c

index 0b61bea..679124b 100644 (file)
@@ -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;