summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-06-15 17:45:45 +0200
committerMichal Marek <mmarek@suse.com>2016-07-18 21:31:35 +0200
commit3308b28569ba3327419658edd194a967e3fd51e2 (patch)
tree1cfececb58f0640f42ae6a009724e0eeae28ca6e /Makefile
parentdc33db7c338e1a7a4a7cb94d73745c8ca54b1ac8 (diff)
downloadlwn-3308b28569ba3327419658edd194a967e3fd51e2.tar.gz
lwn-3308b28569ba3327419658edd194a967e3fd51e2.zip
Kbuild: always prefix objtree in LINUXINCLUDE
When $(LINUXINCLUDE) is added to the cflags of a target that normall doesn't have it (e.g. HOSTCFLAGS), each entry in the list is expanded so that we search both $(objtree) and $(srctree), which is a bit silly, as we already know which of the two we want for each entry in LINUXINCLUDE. Also, a follow-up patch changes the behavior so we only look in $(srctree) for manually added include path, and that breaks finding the generated headers. This adds an explicit $(objtree) for each tree that we want to look for generated files. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 337686db5fd3..64684b19d49c 100644
--- a/Makefile
+++ b/Makefile
@@ -375,19 +375,19 @@ CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE := \
-I$(srctree)/arch/$(hdr-arch)/include/uapi \
- -Iarch/$(hdr-arch)/include/generated/uapi \
+ -I$(objtree)/arch/$(hdr-arch)/include/generated/uapi \
-I$(srctree)/include/uapi \
- -Iinclude/generated/uapi \
+ -I$(objtree)/include/generated/uapi \
-include $(srctree)/include/linux/kconfig.h
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := \
-I$(srctree)/arch/$(hdr-arch)/include \
- -Iarch/$(hdr-arch)/include/generated/uapi \
- -Iarch/$(hdr-arch)/include/generated \
+ -I$(objtree)/arch/$(hdr-arch)/include/generated/uapi \
+ -I$(objtree)/arch/$(hdr-arch)/include/generated \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
- -Iinclude
+ -I$(objtree)/include
LINUXINCLUDE += $(filter-out $(LINUXINCLUDE),$(USERINCLUDE))