diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-07 17:09:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-07 17:09:24 -0400 |
commit | 58f051fc9828709e6c55803510761413d92c4e57 (patch) | |
tree | 8b92cf129f74105d9b17ada2b227aa45f2898d51 /Makefile | |
parent | ef3ad0898a60d30da7f170032992914998c366e5 (diff) | |
parent | c4e6fff1ae5729c2af159008b13fca39fbbac70e (diff) |
Merge tag 'kbuild-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada:
- Clean up Makefiles and scripts
- Improve clang support
- Remove unneeded genhdr-y syntax
- Remove unneeded cc-option-align macro
- Introduce __cc-option macro and use it to fix x86 boot code compiler
flags
* tag 'kbuild-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: improve comments on KBUILD_SRC
x86/build: Specify stack alignment for clang
x86/build: Use __cc-option for boot code compiler options
kbuild: Add __cc-option macro
kbuild: remove cc-option-align
kbuild: replace genhdr-y with generated-y
kbuild: clang: Disable 'address-of-packed-member' warning
kbuild: remove duplicated arch/*/include/generated/uapi include path
kbuild: speed up checksyscalls.sh
kbuild: simplify silent build (-s) detection
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 24 |
1 files changed, 8 insertions, 16 deletions
@@ -84,17 +84,10 @@ endif | |||
84 | # If the user is running make -s (silent mode), suppress echoing of | 84 | # If the user is running make -s (silent mode), suppress echoing of |
85 | # commands | 85 | # commands |
86 | 86 | ||
87 | ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 | 87 | ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) |
88 | ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) | ||
89 | quiet=silent_ | 88 | quiet=silent_ |
90 | tools_silent=s | 89 | tools_silent=s |
91 | endif | 90 | endif |
92 | else # make-3.8x | ||
93 | ifneq ($(filter s% -s%,$(MAKEFLAGS)),) | ||
94 | quiet=silent_ | ||
95 | tools_silent=-s | ||
96 | endif | ||
97 | endif | ||
98 | 91 | ||
99 | export quiet Q KBUILD_VERBOSE | 92 | export quiet Q KBUILD_VERBOSE |
100 | 93 | ||
@@ -113,8 +106,8 @@ export quiet Q KBUILD_VERBOSE | |||
113 | # The O= assignment takes precedence over the KBUILD_OUTPUT environment | 106 | # The O= assignment takes precedence over the KBUILD_OUTPUT environment |
114 | # variable. | 107 | # variable. |
115 | 108 | ||
116 | # KBUILD_SRC is set on invocation of make in OBJ directory | 109 | # KBUILD_SRC is not intended to be used by the regular user (for now), |
117 | # KBUILD_SRC is not intended to be used by the regular user (for now) | 110 | # it is set on invocation of make with KBUILD_OUTPUT or O= specified. |
118 | ifeq ($(KBUILD_SRC),) | 111 | ifeq ($(KBUILD_SRC),) |
119 | 112 | ||
120 | # OK, Make called in directory where kernel src resides | 113 | # OK, Make called in directory where kernel src resides |
@@ -135,7 +128,6 @@ ifneq ($(words $(subst :, ,$(CURDIR))), 1) | |||
135 | endif | 128 | endif |
136 | 129 | ||
137 | ifneq ($(KBUILD_OUTPUT),) | 130 | ifneq ($(KBUILD_OUTPUT),) |
138 | # Invoke a second make in the output directory, passing relevant variables | ||
139 | # check that the output directory actually exists | 131 | # check that the output directory actually exists |
140 | saved-output := $(KBUILD_OUTPUT) | 132 | saved-output := $(KBUILD_OUTPUT) |
141 | KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ | 133 | KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ |
@@ -148,6 +140,7 @@ PHONY += $(MAKECMDGOALS) sub-make | |||
148 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make | 140 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make |
149 | @: | 141 | @: |
150 | 142 | ||
143 | # Invoke a second make in the output directory, passing relevant variables | ||
151 | sub-make: | 144 | sub-make: |
152 | $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ | 145 | $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ |
153 | -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) | 146 | -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) |
@@ -303,7 +296,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ | |||
303 | 296 | ||
304 | HOSTCC = gcc | 297 | HOSTCC = gcc |
305 | HOSTCXX = g++ | 298 | HOSTCXX = g++ |
306 | HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 | 299 | HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 |
307 | HOSTCXXFLAGS = -O2 | 300 | HOSTCXXFLAGS = -O2 |
308 | 301 | ||
309 | ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1) | 302 | ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1) |
@@ -388,12 +381,10 @@ USERINCLUDE := \ | |||
388 | # Needed to be compatible with the O= option | 381 | # Needed to be compatible with the O= option |
389 | LINUXINCLUDE := \ | 382 | LINUXINCLUDE := \ |
390 | -I$(srctree)/arch/$(hdr-arch)/include \ | 383 | -I$(srctree)/arch/$(hdr-arch)/include \ |
391 | -I$(objtree)/arch/$(hdr-arch)/include/generated/uapi \ | ||
392 | -I$(objtree)/arch/$(hdr-arch)/include/generated \ | 384 | -I$(objtree)/arch/$(hdr-arch)/include/generated \ |
393 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ | 385 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ |
394 | -I$(objtree)/include | 386 | -I$(objtree)/include \ |
395 | 387 | $(USERINCLUDE) | |
396 | LINUXINCLUDE += $(filter-out $(LINUXINCLUDE),$(USERINCLUDE)) | ||
397 | 388 | ||
398 | KBUILD_CPPFLAGS := -D__KERNEL__ | 389 | KBUILD_CPPFLAGS := -D__KERNEL__ |
399 | 390 | ||
@@ -707,6 +698,7 @@ KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) | |||
707 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) | 698 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) |
708 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) | 699 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) |
709 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) | 700 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) |
701 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) | ||
710 | # Quiet clang warning: comparison of unsigned expression < 0 is always false | 702 | # Quiet clang warning: comparison of unsigned expression < 0 is always false |
711 | KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) | 703 | KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) |
712 | # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the | 704 | # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the |