aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-03-27 07:43:36 -0400
committerMichal Marek <mmarek@suse.cz>2015-04-02 10:42:08 -0400
commita436bb7b806383ae0593cab53d17fc9676270cd3 (patch)
tree4d51b1a8b5474fd0d3000f5026032efc71a961b0 /Makefile
parent7aacad53aeb57b7ff52399f56eb6d7d4010e72e9 (diff)
kbuild: use relative path more to include Makefile
Prior to this commit, it was impossible to use relative path to include Makefiles from the top level Makefile because the option "--include-dir=$(srctree)" becomes effective when Make enters into sub Makefiles. To use relative path in any places, this commit moves the option above the "sub-make" target. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 10 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index d3726e5f93ef..929d805b4f62 100644
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,10 @@ NAME = Hurr durr I'ma sheep
10# Comments in this file are targeted only to the developer, do not 10# Comments in this file are targeted only to the developer, do not
11# expect to learn how to build the kernel reading this file. 11# expect to learn how to build the kernel reading this file.
12 12
13# Do not use make's built-in rules and variables 13# o Do not use make's built-in rules and variables
14# (this increases performance and avoids hard-to-debug behaviour); 14# (this increases performance and avoids hard-to-debug behaviour);
15MAKEFLAGS += -rR 15# o Look for make include files relative to root of kernel src
16MAKEFLAGS += -rR --include-dir=$(CURDIR)
16 17
17# Avoid funny character set dependencies 18# Avoid funny character set dependencies
18unexport LC_ALL 19unexport LC_ALL
@@ -344,12 +345,9 @@ endif
344export COMPILER 345export COMPILER
345endif 346endif
346 347
347# Look for make include files relative to root of kernel src
348MAKEFLAGS += --include-dir=$(srctree)
349
350# We need some generic definitions (do not try to remake the file). 348# We need some generic definitions (do not try to remake the file).
351$(srctree)/scripts/Kbuild.include: ; 349scripts/Kbuild.include: ;
352include $(srctree)/scripts/Kbuild.include 350include scripts/Kbuild.include
353 351
354# Make variables (CC, etc...) 352# Make variables (CC, etc...)
355AS = $(CROSS_COMPILE)as 353AS = $(CROSS_COMPILE)as
@@ -533,7 +531,7 @@ ifeq ($(config-targets),1)
533# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. 531# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
534# KBUILD_DEFCONFIG may point out an alternative default configuration 532# KBUILD_DEFCONFIG may point out an alternative default configuration
535# used for 'make defconfig' 533# used for 'make defconfig'
536include $(srctree)/arch/$(SRCARCH)/Makefile 534include arch/$(SRCARCH)/Makefile
537export KBUILD_DEFCONFIG KBUILD_KCONFIG 535export KBUILD_DEFCONFIG KBUILD_KCONFIG
538 536
539config: scripts_basic outputmakefile FORCE 537config: scripts_basic outputmakefile FORCE
@@ -609,7 +607,7 @@ endif # $(dot-config)
609# Defaults to vmlinux, but the arch makefile usually adds further targets 607# Defaults to vmlinux, but the arch makefile usually adds further targets
610all: vmlinux 608all: vmlinux
611 609
612include $(srctree)/arch/$(SRCARCH)/Makefile 610include arch/$(SRCARCH)/Makefile
613 611
614KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) 612KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
615 613
@@ -781,8 +779,8 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
781 KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO 779 KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
782endif 780endif
783 781
784include $(srctree)/scripts/Makefile.kasan 782include scripts/Makefile.kasan
785include $(srctree)/scripts/Makefile.extrawarn 783include scripts/Makefile.extrawarn
786 784
787# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments 785# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
788KBUILD_CPPFLAGS += $(KCPPFLAGS) 786KBUILD_CPPFLAGS += $(KCPPFLAGS)