@@ -210,7 +210,8 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
- scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
+ scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' \
+ "$(force-deps)" > $(dot-target).tmp; \
rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd)
@@ -272,8 +272,8 @@ define rule_cc_o_c
$(cmd_modversions) \
$(call echo-cmd,record_mcount) \
$(cmd_record_mcount) \
- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
- $(dot-target).tmp; \
+ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' \
+ "$(force-deps)" > $(dot-target).tmp; \
rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd
endef
@@ -62,7 +62,7 @@
*
* It is invoked as
*
- * fixdep <depfile> <target> <cmdline>
+ * fixdep <depfile> <target> <cmdline> [<force-deps>]
*
* and will read the dependency file <depfile>
*
@@ -91,6 +91,9 @@
* unrelated CONFIG_ options all over the place, it's not an
* efficiency problem either.
*
+ * An optional <force-deps> may also be added to include a list of
+ * files that are forced dependencies.
+ *
* (Note: it'd be easy to port over the complete mkdep state machine,
* but I don't think the added complexity is worth it)
*/
@@ -123,6 +126,7 @@
char *target;
char *depfile;
char *cmdline;
+char *forced;
static void usage(void)
{
@@ -333,6 +337,7 @@ static void parse_dep_file(void *map, size_t len)
clear_config();
first = 1;
+ again:
while (m < end) {
while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
m++;
@@ -362,6 +367,13 @@ static void parse_dep_file(void *map, size_t len)
first = 0;
m = p + 1;
}
+ if (forced) {
+ m = forced;
+ end = m + strlen(m);
+ forced = NULL;
+ goto again;
+ }
+
printf("\n%s: $(deps_%s)\n\n", target, target);
printf("$(deps_%s):\n", target);
}
@@ -418,12 +430,14 @@ int main(int argc, char *argv[])
{
traps();
- if (argc != 4)
+ if (argc != 4 && argc != 5)
usage();
depfile = argv[1];
target = argv[2];
cmdline = argv[3];
+ if (argc == 5)
+ forced = argv[4];
print_cmdline();
print_deps();