diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2005-12-25 17:21:14 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2005-12-25 17:21:14 -0500 |
commit | 4d99f93bdaa1ab49188cac67b4aae9180f8e3960 (patch) | |
tree | abc13c11bd350117117777e547d80804f8257fb6 | |
parent | f6333eb4e788bf70d6455c9004b6b676df62c500 (diff) |
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>
-rw-r--r-- | scripts/basic/fixdep.c | 15 |
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) | |||
130 | exit(1); | 130 | exit(1); |
131 | } | 131 | } |
132 | 132 | ||
133 | /* | ||
134 | * Print out the commandline prefixed with cmd_<target filename> := | ||
135 | * If commandline contains '#' escape with '\' so make to not see | ||
136 | * the '#' as a start-of-comment symbol | ||
137 | **/ | ||
133 | void print_cmdline(void) | 138 | void print_cmdline(void) |
134 | { | 139 | { |
135 | printf("cmd_%s := %s\n\n", target, cmdline); | 140 | char *p = cmdline; |
141 | |||
142 | printf("cmd_%s := ", target); | ||
143 | for (; *p; p++) { | ||
144 | if (*p == '#') | ||
145 | printf("\\"); | ||
146 | printf("%c", *p); | ||
147 | } | ||
148 | printf("\n\n"); | ||
136 | } | 149 | } |
137 | 150 | ||
138 | char * str_config = NULL; | 151 | char * str_config = NULL; |