diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-10 20:48:21 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-10 20:48:21 -0400 |
| commit | ffd602eb4693bbb49b301fa059b109bbdebf9524 (patch) | |
| tree | a7be15ffb7fe1a23dde4dc2831670f3abed6ce95 /scripts/Kbuild.include | |
| parent | 5af7f115886f7ec193171e2e49b8000ddd1e7147 (diff) | |
| parent | 9250d20e9ecedab6aa331a127fbfc1272383ed72 (diff) | |
Merge tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada:
- do not generate unneeded top-level built-in.a
- let git ignore O= directory entirely
- optimize scripts/kallsyms slightly
- exclude DWARF info from *.s regardless of config options
- fix GCC toolchain search path for Clang to prepare ld.lld support
- do not generate modules.order when CONFIG_MODULES is disabled
- simplify single target rules and remove VPATH for external module
build
- allow to add optional flags to dpkg-buildpackage when building
deb-pkg
- move some compiler option tests from Makefile to Kconfig
- various Makefile cleanups
* tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (40 commits)
kbuild: remove scripts/basic/% build target
kbuild: use -Werror=implicit-... instead of -Werror-implicit-...
kbuild: clean up scripts/gcc-version.sh
kbuild: remove cc-version macro
kbuild: update comment block of scripts/clang-version.sh
kbuild: remove commented-out INITRD_COMPRESS
kbuild: move -gsplit-dwarf, -gdwarf-4 option tests to Kconfig
kbuild: [bin]deb-pkg: add DPKG_FLAGS variable
kbuild: move ".config not found!" message from Kconfig to Makefile
kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing
kbuild: simplify single target rules
kbuild: remove empty rules for makefiles
kbuild: make -r/-R effective in top Makefile for old Make versions
kbuild: move tools_silent to a more relevant place
kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
kbuild: refactor cc-cross-prefix implementation
kbuild: hardcode genksyms path and remove GENKSYMS variable
scripts/gdb: refactor rules for symlink creation
kbuild: create symlink to vmlinux-gdb.py in scripts_gdb target
scripts/gdb: do not descend into scripts/gdb from scripts
...
Diffstat (limited to 'scripts/Kbuild.include')
| -rw-r--r-- | scripts/Kbuild.include | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 30816037036e..7484b9d8272f 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
| @@ -24,6 +24,10 @@ depfile = $(subst $(comma),_,$(dot-target).d) | |||
| 24 | basetarget = $(basename $(notdir $@)) | 24 | basetarget = $(basename $(notdir $@)) |
| 25 | 25 | ||
| 26 | ### | 26 | ### |
| 27 | # real prerequisites without phony targets | ||
| 28 | real-prereqs = $(filter-out $(PHONY), $^) | ||
| 29 | |||
| 30 | ### | ||
| 27 | # Escape single quote for use in echo statements | 31 | # Escape single quote for use in echo statements |
| 28 | escsq = $(subst $(squote),'\$(squote)',$1) | 32 | escsq = $(subst $(squote),'\$(squote)',$1) |
| 29 | 33 | ||
| @@ -67,14 +71,10 @@ endef | |||
| 67 | 71 | ||
| 68 | # cc-cross-prefix | 72 | # cc-cross-prefix |
| 69 | # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) | 73 | # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) |
| 70 | # Return first prefix where a prefix$(CC) is found in PATH. | 74 | # Return first <prefix> where a <prefix>gcc is found in PATH. |
| 71 | # If no $(CC) found in PATH with listed prefixes return nothing | 75 | # If no gcc found in PATH with listed prefixes return nothing |
| 72 | cc-cross-prefix = \ | 76 | cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \ |
| 73 | $(word 1, $(foreach c,$(1), \ | 77 | $(if $(shell which $(c)gcc), $(c)))) |
| 74 | $(shell set -e; \ | ||
| 75 | if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \ | ||
| 76 | echo $(c); \ | ||
| 77 | fi))) | ||
| 78 | 78 | ||
| 79 | # output directory for tests below | 79 | # output directory for tests below |
| 80 | TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) | 80 | TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) |
| @@ -134,12 +134,9 @@ cc-option-yn = $(call try-run,\ | |||
| 134 | cc-disable-warning = $(call try-run,\ | 134 | cc-disable-warning = $(call try-run,\ |
| 135 | $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) | 135 | $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) |
| 136 | 136 | ||
| 137 | # cc-version | ||
| 138 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) | ||
| 139 | |||
| 140 | # cc-ifversion | 137 | # cc-ifversion |
| 141 | # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) | 138 | # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) |
| 142 | cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) | 139 | cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4)) |
| 143 | 140 | ||
| 144 | # cc-ldoption | 141 | # cc-ldoption |
| 145 | # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) | 142 | # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) |
