From 4d99f93bdaa1ab49188cac67b4aae9180f8e3960 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 25 Dec 2005 23:21:14 +0100 Subject: 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 --- scripts/basic/fixdep.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'scripts/basic/fixdep.c') diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 0b61bea869f7..679124b11e12 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; -- cgit v1.2.3-59-g8ed1b