Commit 4a6db079 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Handle removed headers

New and old way to handle dependencies would choke when a file
#include'd by other files was removed, since the dependency on it was
still recorded, but since it was gone, make has no idea what to do about
it (and would complain with "No rule to make <file> ...")

We now add targets for all the previously included files, so make will
just ignore them if they disappear.
parent c51db436
...@@ -446,7 +446,7 @@ if_changed = $(if $(strip $? \ ...@@ -446,7 +446,7 @@ if_changed = $(if $(strip $? \
# execute the command and also postprocess generated .d dependencies # execute the command and also postprocess generated .d dependencies
# file # file
if_changed_dep = $(if $(strip $? \ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
$(filter-out $(cmd_$(1)),$(cmd_$@))\ $(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\ $(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \ @set -e; \
......
...@@ -292,7 +292,7 @@ void parse_dep_file(void *map, size_t len) ...@@ -292,7 +292,7 @@ void parse_dep_file(void *map, size_t len)
exit(1); exit(1);
} }
memcpy(s, m, p-m); s[p-m] = 0; memcpy(s, m, p-m); s[p-m] = 0;
printf("%s: \\\n", target); printf("deps_%s := \\\n", target);
m = p+1; m = p+1;
clear_config(); clear_config();
...@@ -314,7 +314,8 @@ void parse_dep_file(void *map, size_t len) ...@@ -314,7 +314,8 @@ void parse_dep_file(void *map, size_t len)
} }
m = p + 1; m = p + 1;
} }
printf("\n"); printf("\n%s: $(deps_%s)\n\n", target, target);
printf("$(deps_%s):\n", target);
} }
void print_deps(void) void print_deps(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment