summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-10-28 13:22:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-28 13:22:35 -0700
commitac747c0715f29c2be3848b719a1b7e65b07f7b21 (patch)
tree600d57fa0f71b545fea3eb5fe3f47a7124c713e3 /scripts/Makefile.build
parentf8cab69be0a8a756a7409f6d2bd1e6e96ce46482 (diff)
parentc2b1a9226fe7c1cee8f0ae42496f3eb282d73ebb (diff)
downloadlinux-stable-ac747c0715f29c2be3848b719a1b7e65b07f7b21.tar.gz
linux-stable-ac747c0715f29c2be3848b719a1b7e65b07f7b21.tar.bz2
linux-stable-ac747c0715f29c2be3848b719a1b7e65b07f7b21.zip
Merge tag 'kbuild-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada: - optimize kallsyms slightly - remove check for old CFLAGS usage - add some compiler flags unconditionally instead of evaluating $(call cc-option,...) - fix variable shadowing in host tools - refactor scripts/mkmakefile - refactor various makefiles * tag 'kbuild-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: modpost: Create macro to avoid variable shadowing ASN.1: Remove unnecessary shadowed local variable kbuild: use 'else ifeq' for checksrc to improve readability kbuild: remove unneeded link_multi_deps kbuild: add -Wno-unused-but-set-variable flag unconditionally kbuild: add -Wdeclaration-after-statement flag unconditionally kbuild: add -Wno-pointer-sign flag unconditionally modpost: remove leftover symbol prefix handling for module device table kbuild: simplify command line creation in scripts/mkmakefile kbuild: do not pass $(objtree) to scripts/mkmakefile kbuild: remove user ID check in scripts/mkmakefile kbuild: remove VERSION and PATCHLEVEL from $(objtree)/Makefile kbuild: add --include-dir flag only for out-of-tree build kbuild: remove dead code in cmd_files calculation in top Makefile kbuild: hide most of targets when running config or mixed targets kbuild: remove old check for CFLAGS use kbuild: prefix Makefile.dtbinst path with $(srctree) unconditionally kallsyms: remove left-over Blackfin code kallsyms: reduce size a little on 64-bit
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build44
1 files changed, 8 insertions, 36 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 54da4b070db3..a8e7ba9f73e8 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -36,21 +36,11 @@ subdir-ccflags-y :=
include scripts/Kbuild.include
-# For backward compatibility check that these variables do not change
-save-cflags := $(CFLAGS)
-
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
include $(kbuild-file)
-# If the save-* variables changed error out
-ifeq ($(KBUILD_NOPEDANTIC),)
- ifneq ("$(save-cflags)","$(CFLAGS)")
- $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use ccflags-y)
- endif
-endif
-
include scripts/Makefile.lib
# Do not include host rules unless needed
@@ -83,14 +73,12 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
@:
# Linus' kernel sanity checking tool
-ifneq ($(KBUILD_CHECKSRC),0)
- ifeq ($(KBUILD_CHECKSRC),2)
- quiet_cmd_force_checksrc = CHECK $<
- cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
- else
- quiet_cmd_checksrc = CHECK $<
- cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
- endif
+ifeq ($(KBUILD_CHECKSRC),1)
+ quiet_cmd_checksrc = CHECK $<
+ cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
+else ifeq ($(KBUILD_CHECKSRC),2)
+ quiet_cmd_force_checksrc = CHECK $<
+ cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
endif
ifneq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),)
@@ -495,28 +483,12 @@ targets += $(obj)/lib-ksyms.o
endif
-#
-# Rule to link composite objects
-#
-# Composite objects are specified in kbuild makefile as follows:
-# <composite-object>-objs := <list of .o files>
-# or
-# <composite-object>-y := <list of .o files>
-# or
-# <composite-object>-m := <list of .o files>
-# The -m syntax only works if <composite object> is a module
-link_multi_deps = \
-$(filter $(addprefix $(obj)/, \
-$($(subst $(obj)/,,$(@:.o=-objs))) \
-$($(subst $(obj)/,,$(@:.o=-y))) \
-$($(subst $(obj)/,,$(@:.o=-m)))), $^)
-
quiet_cmd_link_multi-m = LD [M] $@
-cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
+cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(filter %.o,$^) $(cmd_secanalysis)
$(multi-used-m): FORCE
$(call if_changed,link_multi-m)
- @{ echo $(@:.o=.ko); echo $(link_multi_deps); \
+ @{ echo $(@:.o=.ko); echo $(filter %.o,$^); \
$(cmd_undef_syms); } > $(MODVERDIR)/$(@F:.o=.mod)
$(call multi_depend, $(multi-used-m), .o, -objs -y -m)