mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
kbuild: remove 'addtree' and 'flags' magic for header search paths
The 'addtree' and 'flags' in scripts/Kbuild.include are so compilecated and ugly. As I mentioned in [1], Kbuild should stop automatic prefixing of header search path options. I fixed up (almost) all Makefiles in the kernel. Now 'addtree' and 'flags' have been removed. Kbuild still caters to add $(srctree)/$(src) and $(objtree)/$(obj) to the header search path for O= building, but never touches extra compiler options from ccflags-y etc. [1]: https://patchwork.kernel.org/patch/9632347/ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
@@ -192,14 +192,6 @@ clean := -f $(srctree)/scripts/Makefile.clean obj
|
||||
# $(Q)$(MAKE) $(hdr-inst)=dir
|
||||
hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
|
||||
|
||||
# Prefix -I with $(srctree) if it is not an absolute path.
|
||||
# skip if -I has no parameter
|
||||
addtree = $(if $(patsubst -I%,%,$(1)), \
|
||||
$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1))
|
||||
|
||||
# Find all -I options and call addtree
|
||||
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
|
||||
|
||||
# echo command.
|
||||
# Short version is used, if $(quiet) equals `quiet_', otherwise full one.
|
||||
echo-cmd = $(if $($(quiet)cmd_$(1)),\
|
||||
|
Reference in New Issue
Block a user