summaryrefslogtreecommitdiff
path: root/scripts/basic/fixdep.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2005-12-26 01:21:14 +0300
committerSam Ravnborg <sam@mars.ravnborg.org>2005-12-26 01:21:14 +0300
commit4d99f93bdaa1ab49188cac67b4aae9180f8e3960 (patch)
treeabc13c11bd350117117777e547d80804f8257fb6 /scripts/basic/fixdep.c
parentf6333eb4e788bf70d6455c9004b6b676df62c500 (diff)
downloadlinux-4d99f93bdaa1ab49188cac67b4aae9180f8e3960.tar.xz
kbuild: escape '#' in .target.cmd files
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>
Diffstat (limited to 'scripts/basic/fixdep.c')
-rw-r--r--scripts/basic/fixdep.c15
1 files changed, 14 insertions, 1 deletions
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_<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;