For some reason which I cannot remember, we didn't use the automatic
dependency generation for the generated .mod.[co] files. However, we do
of course need dependency information for those, too, they need to be updated
when e.g. the kernel version number changes.
# Compile version info for unresolved symbols
quiet_cmd_cc_o_c = CC $@
- cmd_cc_o_c = $(CC) $(CFLAGS) $(CFLAGS_MODULE) -c -o $@ $<
+ cmd_cc_o_c = $(CC) -Wp,-MD,$(depfile) $(CFLAGS) $(CFLAGS_MODULE) \
+ -c -o $@ $<
$(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
- $(call if_changed,cc_o_c)
+ $(call if_changed_dep,cc_o_c)
targets += $(modules:.ko=.mod.o)