diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2015-03-27 07:43:36 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2015-04-02 10:42:08 -0400 |
commit | a436bb7b806383ae0593cab53d17fc9676270cd3 (patch) | |
tree | 4d51b1a8b5474fd0d3000f5026032efc71a961b0 | |
parent | 7aacad53aeb57b7ff52399f56eb6d7d4010e72e9 (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>
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | arch/mips/Makefile | 2 | ||||
-rw-r--r-- | arch/um/Makefile | 6 | ||||
-rw-r--r-- | arch/x86/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/Makefile.um | 2 |
5 files changed, 16 insertions, 18 deletions
@@ -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); |
15 | MAKEFLAGS += -rR | 15 | # o Look for make include files relative to root of kernel src |
16 | MAKEFLAGS += -rR --include-dir=$(CURDIR) | ||
16 | 17 | ||
17 | # Avoid funny character set dependencies | 18 | # Avoid funny character set dependencies |
18 | unexport LC_ALL | 19 | unexport LC_ALL |
@@ -344,12 +345,9 @@ endif | |||
344 | export COMPILER | 345 | export COMPILER |
345 | endif | 346 | endif |
346 | 347 | ||
347 | # Look for make include files relative to root of kernel src | ||
348 | MAKEFLAGS += --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: ; | 349 | scripts/Kbuild.include: ; |
352 | include $(srctree)/scripts/Kbuild.include | 350 | include scripts/Kbuild.include |
353 | 351 | ||
354 | # Make variables (CC, etc...) | 352 | # Make variables (CC, etc...) |
355 | AS = $(CROSS_COMPILE)as | 353 | AS = $(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' |
536 | include $(srctree)/arch/$(SRCARCH)/Makefile | 534 | include arch/$(SRCARCH)/Makefile |
537 | export KBUILD_DEFCONFIG KBUILD_KCONFIG | 535 | export KBUILD_DEFCONFIG KBUILD_KCONFIG |
538 | 536 | ||
539 | config: scripts_basic outputmakefile FORCE | 537 | config: 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 |
610 | all: vmlinux | 608 | all: vmlinux |
611 | 609 | ||
612 | include $(srctree)/arch/$(SRCARCH)/Makefile | 610 | include arch/$(SRCARCH)/Makefile |
613 | 611 | ||
614 | KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) | 612 | KBUILD_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 |
782 | endif | 780 | endif |
783 | 781 | ||
784 | include $(srctree)/scripts/Makefile.kasan | 782 | include scripts/Makefile.kasan |
785 | include $(srctree)/scripts/Makefile.extrawarn | 783 | include 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 |
788 | KBUILD_CPPFLAGS += $(KCPPFLAGS) | 786 | KBUILD_CPPFLAGS += $(KCPPFLAGS) |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 8f57fc72d62c..d152dfbc360d 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -225,7 +225,7 @@ endif | |||
225 | # | 225 | # |
226 | # Board-dependent options and extra files | 226 | # Board-dependent options and extra files |
227 | # | 227 | # |
228 | include $(srctree)/arch/mips/Kbuild.platforms | 228 | include arch/mips/Kbuild.platforms |
229 | 229 | ||
230 | ifdef CONFIG_PHYSICAL_START | 230 | ifdef CONFIG_PHYSICAL_START |
231 | load-y = $(CONFIG_PHYSICAL_START) | 231 | load-y = $(CONFIG_PHYSICAL_START) |
diff --git a/arch/um/Makefile b/arch/um/Makefile index e4b1a9639c4d..17d4460b1af3 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -43,8 +43,8 @@ endif | |||
43 | 43 | ||
44 | HOST_DIR := arch/$(HEADER_ARCH) | 44 | HOST_DIR := arch/$(HEADER_ARCH) |
45 | 45 | ||
46 | include $(srctree)/$(ARCH_DIR)/Makefile-skas | 46 | include $(ARCH_DIR)/Makefile-skas |
47 | include $(srctree)/$(HOST_DIR)/Makefile.um | 47 | include $(HOST_DIR)/Makefile.um |
48 | 48 | ||
49 | core-y += $(HOST_DIR)/um/ | 49 | core-y += $(HOST_DIR)/um/ |
50 | 50 | ||
@@ -73,7 +73,7 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ | |||
73 | $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include | 73 | $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include |
74 | 74 | ||
75 | #This will adjust *FLAGS accordingly to the platform. | 75 | #This will adjust *FLAGS accordingly to the platform. |
76 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | 76 | include $(ARCH_DIR)/Makefile-os-$(OS) |
77 | 77 | ||
78 | KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \ | 78 | KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \ |
79 | -I$(srctree)/$(HOST_DIR)/include/uapi \ | 79 | -I$(srctree)/$(HOST_DIR)/include/uapi \ |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 5ba2d9ce82dc..2fda005bb334 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -63,7 +63,7 @@ ifeq ($(CONFIG_X86_32),y) | |||
63 | $(call cc-option,-fno-unit-at-a-time)) | 63 | $(call cc-option,-fno-unit-at-a-time)) |
64 | 64 | ||
65 | # CPU-specific tuning. Anything which can be shared with UML should go here. | 65 | # CPU-specific tuning. Anything which can be shared with UML should go here. |
66 | include $(srctree)/arch/x86/Makefile_32.cpu | 66 | include arch/x86/Makefile_32.cpu |
67 | KBUILD_CFLAGS += $(cflags-y) | 67 | KBUILD_CFLAGS += $(cflags-y) |
68 | 68 | ||
69 | # temporary until string.h is fixed | 69 | # temporary until string.h is fixed |
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um index 95eba554baf9..5b7e898ffd9a 100644 --- a/arch/x86/Makefile.um +++ b/arch/x86/Makefile.um | |||
@@ -18,7 +18,7 @@ LDS_EXTRA := -Ui386 | |||
18 | export LDS_EXTRA | 18 | export LDS_EXTRA |
19 | 19 | ||
20 | # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. | 20 | # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. |
21 | include $(srctree)/arch/x86/Makefile_32.cpu | 21 | include arch/x86/Makefile_32.cpu |
22 | 22 | ||
23 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. | 23 | # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. |
24 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) | 24 | cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) |