From: Sam Ravnborg Date: Sun, 25 Dec 2005 22:21:14 +0000 (+0100) Subject: kbuild: escape '#' in .target.cmd files X-Git-Tag: v2.6.16-rc1~474^2~22^2~4^2~12 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4d99f93bdaa1ab49188cac67b4aae9180f8e3960;p=linux-2.6-omap-h63xx.git kbuild: escape '#' in .target.cmd files Commandlines are contained in the ..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 --- diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 0b61bea869f..679124b11e1 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_ := + * 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;