diff options
Diffstat (limited to 'scripts/basic/fixdep.c')
-rw-r--r-- | scripts/basic/fixdep.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 6c94c6ce2925..291228e25984 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -309,6 +309,11 @@ static void do_config_file(const char *filename) | |||
309 | close(fd); | 309 | close(fd); |
310 | } | 310 | } |
311 | 311 | ||
312 | /* | ||
313 | * Important: The below generated source_foo.o and deps_foo.o variable | ||
314 | * assignments are parsed not only by make, but also by the rather simple | ||
315 | * parser in scripts/mod/sumversion.c. | ||
316 | */ | ||
312 | static void parse_dep_file(void *map, size_t len) | 317 | static void parse_dep_file(void *map, size_t len) |
313 | { | 318 | { |
314 | char *m = map; | 319 | char *m = map; |
@@ -323,7 +328,6 @@ static void parse_dep_file(void *map, size_t len) | |||
323 | exit(1); | 328 | exit(1); |
324 | } | 329 | } |
325 | memcpy(s, m, p-m); s[p-m] = 0; | 330 | memcpy(s, m, p-m); s[p-m] = 0; |
326 | printf("deps_%s := \\\n", target); | ||
327 | m = p+1; | 331 | m = p+1; |
328 | 332 | ||
329 | clear_config(); | 333 | clear_config(); |
@@ -343,12 +347,15 @@ static void parse_dep_file(void *map, size_t len) | |||
343 | strrcmp(s, "arch/um/include/uml-config.h") && | 347 | strrcmp(s, "arch/um/include/uml-config.h") && |
344 | strrcmp(s, ".ver")) { | 348 | strrcmp(s, ".ver")) { |
345 | /* | 349 | /* |
346 | * Do not output the first dependency (the | 350 | * Do not list the source file as dependency, so that |
347 | * source file), so that kbuild is not confused | 351 | * kbuild is not confused if a .c file is rewritten |
348 | * if a .c file is rewritten into .S or vice | 352 | * into .S or vice versa. Storing it in source_* is |
349 | * versa. | 353 | * needed for modpost to compute srcversions. |
350 | */ | 354 | */ |
351 | if (!first) | 355 | if (first) { |
356 | printf("source_%s := %s\n\n", target, s); | ||
357 | printf("deps_%s := \\\n", target); | ||
358 | } else | ||
352 | printf(" %s \\\n", s); | 359 | printf(" %s \\\n", s); |
353 | do_config_file(s); | 360 | do_config_file(s); |
354 | } | 361 | } |