Skip to content

Commit

Permalink
kbuild: escape '#' in .target.cmd files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sam Ravnborg committed Dec 25, 2005
1 parent f6333eb commit 4d99f93
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d99f93

Please sign in to comment.