History

kbuild: external module build warnings when KBUILD_OUTPUT set and W=1

Commit db547ef19064 ("Kbuild: don't add obj tree in additional includes") causes warnings (-Wmissing-include-dirs) when compiling external modules with KBUILD_OUTPUT set and W=1. This is because $src can be an absolute path to the external module source which when prefixed with -I$(srctree)/ generates an incorrect directory path.

Allan, Bruce W committed 9 years ago

Commit 4607ebf1 parent 8b38f891 file · +1 −1Browse files

Unified · Split

scripts/Makefile.lib+1−1
@@ -155,7 +155,7 @@ else · 154 unmodified lines
155155 # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
156156 # and locates generated .h files
157157 # FIXME: Replace both with specific CFLAGS* statements in the makefiles
158−__c_flags = $(if $(obj),-I$(srctree)/$(src) -I$(obj)) \
158+__c_flags = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \
159159 $(call flags,_c_flags)
160160 __a_flags = $(call flags,_a_flags)
161161 __cpp_flags = $(call flags,_cpp_flags)