diff options
Diffstat (limited to 'scripts/basic')
| -rw-r--r-- | scripts/basic/fixdep.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index c9a16abacab4..291228e25984 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
| @@ -309,12 +309,18 @@ 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; |
| 315 | char *end = m + len; | 320 | char *end = m + len; |
| 316 | char *p; | 321 | char *p; |
| 317 | char s[PATH_MAX]; | 322 | char s[PATH_MAX]; |
| 323 | int first; | ||
| 318 | 324 | ||
| 319 | p = strchr(m, ':'); | 325 | p = strchr(m, ':'); |
| 320 | if (!p) { | 326 | if (!p) { |
| @@ -322,11 +328,11 @@ static void parse_dep_file(void *map, size_t len) | |||
| 322 | exit(1); | 328 | exit(1); |
| 323 | } | 329 | } |
| 324 | memcpy(s, m, p-m); s[p-m] = 0; | 330 | memcpy(s, m, p-m); s[p-m] = 0; |
| 325 | printf("deps_%s := \\\n", target); | ||
| 326 | m = p+1; | 331 | m = p+1; |
| 327 | 332 | ||
| 328 | clear_config(); | 333 | clear_config(); |
| 329 | 334 | ||
| 335 | first = 1; | ||
| 330 | while (m < end) { | 336 | while (m < end) { |
| 331 | while (m < end && (*m == ' ' || *m == '\\' || *m == '\n')) | 337 | while (m < end && (*m == ' ' || *m == '\\' || *m == '\n')) |
| 332 | m++; | 338 | m++; |
| @@ -340,9 +346,20 @@ static void parse_dep_file(void *map, size_t len) | |||
| 340 | if (strrcmp(s, "include/generated/autoconf.h") && | 346 | if (strrcmp(s, "include/generated/autoconf.h") && |
| 341 | strrcmp(s, "arch/um/include/uml-config.h") && | 347 | strrcmp(s, "arch/um/include/uml-config.h") && |
| 342 | strrcmp(s, ".ver")) { | 348 | strrcmp(s, ".ver")) { |
| 343 | printf(" %s \\\n", s); | 349 | /* |
| 350 | * Do not list the source file as dependency, so that | ||
| 351 | * kbuild is not confused if a .c file is rewritten | ||
| 352 | * into .S or vice versa. Storing it in source_* is | ||
| 353 | * needed for modpost to compute srcversions. | ||
| 354 | */ | ||
| 355 | if (first) { | ||
| 356 | printf("source_%s := %s\n\n", target, s); | ||
| 357 | printf("deps_%s := \\\n", target); | ||
| 358 | } else | ||
| 359 | printf(" %s \\\n", s); | ||
| 344 | do_config_file(s); | 360 | do_config_file(s); |
| 345 | } | 361 | } |
| 362 | first = 0; | ||
| 346 | m = p + 1; | 363 | m = p + 1; |
| 347 | } | 364 | } |
| 348 | printf("\n%s: $(deps_%s)\n\n", target, target); | 365 | printf("\n%s: $(deps_%s)\n\n", target, target); |
