From c8589d1e9e01debdb4f574afe7c585714353ad79 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 19 Aug 2014 16:34:20 +0900 Subject: [PATCH 01/17] kbuild: handle multi-objs dependency appropriately The comment in scripts/Makefile.build says as follows: We would rather have a list of rules like foo.o: $(foo-objs) but that's not so easy, so we rather make all composite objects depend on the set of all their parts This commit makes it possible! For example, assume a Makefile like this obj-m = foo.o bar.o foo-objs := foo1.o foo2.o bar-objs := bar1.o bar2.o Without this patch, foo.o depends on all of foo1.o foo2.o bar1.o bar2.o. It looks funny that foo.o is regenerated when bar1.c is updated. Now we can handle the dependency of foo.o and bar.o separately. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Marek --- scripts/Makefile.build | 10 ++++------ scripts/Makefile.lib | 9 +++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index bf3e6778cd71..5b09d3637855 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -382,16 +382,14 @@ cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalys quiet_cmd_link_multi-m = LD [M] $@ cmd_link_multi-m = $(cmd_link_multi-y) -# We would rather have a list of rules like -# foo.o: $(foo-objs) -# but that's not so easy, so we rather make all composite objects depend -# on the set of all their parts -$(multi-used-y) : %.o: $(multi-objs-y) FORCE +$(multi-used-y): FORCE $(call if_changed,link_multi-y) +$(call multi_depend, $(multi-used-y), .o, -objs -y) -$(multi-used-m) : %.o: $(multi-objs-m) FORCE +$(multi-used-m): FORCE $(call if_changed,link_multi-m) @{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod) +$(call multi_depend, $(multi-used-m), .o, -objs -y) targets += $(multi-used-y) $(multi-used-m) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 260bf8acfce9..54be19a0fa51 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -159,6 +159,15 @@ dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ modname-multi = $(sort $(foreach m,$(multi-used),\ $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) +# Useful for describing the dependency of composite objects +# Usage: +# $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add) +define multi_depend +$(foreach m, $(notdir $1), \ + $(eval $(obj)/$m: \ + $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) +endef + ifdef REGENERATE_PARSERS # GPERF From 97e3226e6e984c8cd9bed47010f30827a3ce816a Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 19 Aug 2014 16:34:21 +0900 Subject: [PATCH 02/17] kbuild: handle the dependency of multi-objs hostprogs appropriately Assume we have a Makefile like: hostprogs-y := foo bar foo-objs := foo1.o foo2.o bar-objs := bar1.o bar2.o Without this commit, the host program foo depends on all of foo1.o foo2.o bar1.o bar2.o. This commit allows to handle the dependency of each host program separately. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Marek --- scripts/Makefile.host | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.host b/scripts/Makefile.host index ab5980f91714..133edfae5b8a 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -96,8 +96,9 @@ quiet_cmd_host-cmulti = HOSTLD $@ cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ $(addprefix $(obj)/,$($(@F)-objs)) \ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -$(host-cmulti): $(obj)/%: $(host-cobjs) FORCE +$(host-cmulti): FORCE $(call if_changed,host-cmulti) +$(call multi_depend, $(host-cmulti), , -objs) # Create .o file from a single .c file # host-cobjs -> .o @@ -113,8 +114,9 @@ quiet_cmd_host-cxxmulti = HOSTLD $@ $(foreach o,objs cxxobjs,\ $(addprefix $(obj)/,$($(@F)-$(o)))) \ $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) FORCE +$(host-cxxmulti): FORCE $(call if_changed,host-cxxmulti) +$(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) # Create .o file from a single .cc (C++) file quiet_cmd_host-cxxobjs = HOSTCXX $@ From 022af62d0190e1e3db63c19aeb5f51ae0612cd71 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 19 Aug 2014 16:34:22 +0900 Subject: [PATCH 03/17] kbuild: refactor script/kconfig/Makefile Now it is harmless to add all host programs to hostprogs-y. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Marek --- scripts/kconfig/Makefile | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 9c4d2412fb72..76f6171768e4 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -157,35 +157,7 @@ qconf-cxxobjs := qconf.o qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o -hostprogs-y := conf - -ifeq ($(MAKECMDGOALS),nconfig) - hostprogs-y += nconf -endif - -ifeq ($(MAKECMDGOALS),menuconfig) - hostprogs-y += mconf -endif - -ifeq ($(MAKECMDGOALS),update-po-config) - hostprogs-y += kxgettext -endif - -ifeq ($(MAKECMDGOALS),xconfig) - qconf-target := 1 -endif -ifeq ($(MAKECMDGOALS),gconfig) - gconf-target := 1 -endif - - -ifeq ($(qconf-target),1) - hostprogs-y += qconf -endif - -ifeq ($(gconf-target),1) - hostprogs-y += gconf -endif +hostprogs-y := conf nconf mconf kxgettext qconf gconf clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h @@ -224,7 +196,7 @@ HOSTLOADLIBES_nconf = $(shell \ || echo "-lmenu -lpanel -lncurses" ) $(obj)/qconf.o: $(obj)/.tmp_qtcheck -ifeq ($(qconf-target),1) +ifeq ($(MAKECMDGOALS),xconfig) $(obj)/.tmp_qtcheck: $(src)/Makefile -include $(obj)/.tmp_qtcheck @@ -281,7 +253,7 @@ endif $(obj)/gconf.o: $(obj)/.tmp_gtkcheck -ifeq ($(gconf-target),1) +ifeq ($(MAKECMDGOALS),gconfig) -include $(obj)/.tmp_gtkcheck # GTK needs some extra effort, too... From 221ecca6cafefbb5106cfc8bf9f1105233a33745 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 19 Aug 2014 16:34:23 +0900 Subject: [PATCH 04/17] kbuild: remove redundant clean-files from scripts/kconfig/Makefile Now mconf, qconf, gconf, nconf are always added to hostprogs-y. Files added to hostprogs-y are removed by "make clean". Signed-off-by: Masahiro Yamada Signed-off-by: Michal Marek --- scripts/kconfig/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 76f6171768e4..e7bf38e92007 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -161,7 +161,6 @@ hostprogs-y := conf nconf mconf kxgettext qconf gconf clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h -clean-files += mconf qconf gconf nconf clean-files += config.pot linux.pot # Check that we have the required ncurses stuff installed for lxdialog (menuconfig) From 06ed5c2bfacaf67039e87a213fa5d1cdde34246a Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Wed, 20 Aug 2014 16:02:59 +0200 Subject: [PATCH 05/17] kbuild: Make scripts executable The Makefiles call the respective interpreter explicitly, but this makes it easier to use the scripts manually. Signed-off-by: Michal Marek --- scripts/bootgraph.pl | 0 scripts/export_report.pl | 0 scripts/gcc-goto.sh | 0 scripts/gcc-ld | 0 scripts/gcc-version.sh | 0 scripts/gcc-x86_32-has-stack-protector.sh | 0 scripts/gcc-x86_64-has-stack-protector.sh | 0 scripts/gen_initramfs_list.sh | 0 scripts/headers_check.pl | 0 scripts/headers_install.sh | 0 scripts/kconfig/lxdialog/check-lxdialog.sh | 0 scripts/kconfig/streamline_config.pl | 0 scripts/link-vmlinux.sh | 0 scripts/markup_oops.pl | 0 scripts/mkmakefile | 0 scripts/mksysmap | 0 scripts/package/builddeb | 0 scripts/package/buildtar | 0 scripts/profile2linkerlist.pl | 0 scripts/rt-tester/rt-tester.py | 0 scripts/selinux/install_policy.sh | 0 scripts/tracing/draw_functrace.py | 0 scripts/xz_wrap.sh | 0 23 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/bootgraph.pl mode change 100644 => 100755 scripts/export_report.pl mode change 100644 => 100755 scripts/gcc-goto.sh mode change 100644 => 100755 scripts/gcc-ld mode change 100644 => 100755 scripts/gcc-version.sh mode change 100644 => 100755 scripts/gcc-x86_32-has-stack-protector.sh mode change 100644 => 100755 scripts/gcc-x86_64-has-stack-protector.sh mode change 100644 => 100755 scripts/gen_initramfs_list.sh mode change 100644 => 100755 scripts/headers_check.pl mode change 100644 => 100755 scripts/headers_install.sh mode change 100644 => 100755 scripts/kconfig/lxdialog/check-lxdialog.sh mode change 100644 => 100755 scripts/kconfig/streamline_config.pl mode change 100644 => 100755 scripts/link-vmlinux.sh mode change 100644 => 100755 scripts/markup_oops.pl mode change 100644 => 100755 scripts/mkmakefile mode change 100644 => 100755 scripts/mksysmap mode change 100644 => 100755 scripts/package/builddeb mode change 100644 => 100755 scripts/package/buildtar mode change 100644 => 100755 scripts/profile2linkerlist.pl mode change 100644 => 100755 scripts/rt-tester/rt-tester.py mode change 100644 => 100755 scripts/selinux/install_policy.sh mode change 100644 => 100755 scripts/tracing/draw_functrace.py mode change 100644 => 100755 scripts/xz_wrap.sh diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl old mode 100644 new mode 100755 diff --git a/scripts/export_report.pl b/scripts/export_report.pl old mode 100644 new mode 100755 diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh old mode 100644 new mode 100755 diff --git a/scripts/gcc-ld b/scripts/gcc-ld old mode 100644 new mode 100755 diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh old mode 100644 new mode 100755 diff --git a/scripts/gcc-x86_32-has-stack-protector.sh b/scripts/gcc-x86_32-has-stack-protector.sh old mode 100644 new mode 100755 diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh old mode 100644 new mode 100755 diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh old mode 100644 new mode 100755 diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl old mode 100644 new mode 100755 diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh old mode 100644 new mode 100755 diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh old mode 100644 new mode 100755 diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl old mode 100644 new mode 100755 diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh old mode 100644 new mode 100755 diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl old mode 100644 new mode 100755 diff --git a/scripts/mkmakefile b/scripts/mkmakefile old mode 100644 new mode 100755 diff --git a/scripts/mksysmap b/scripts/mksysmap old mode 100644 new mode 100755 diff --git a/scripts/package/builddeb b/scripts/package/builddeb old mode 100644 new mode 100755 diff --git a/scripts/package/buildtar b/scripts/package/buildtar old mode 100644 new mode 100755 diff --git a/scripts/profile2linkerlist.pl b/scripts/profile2linkerlist.pl old mode 100644 new mode 100755 diff --git a/scripts/rt-tester/rt-tester.py b/scripts/rt-tester/rt-tester.py old mode 100644 new mode 100755 diff --git a/scripts/selinux/install_policy.sh b/scripts/selinux/install_policy.sh old mode 100644 new mode 100755 diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py old mode 100644 new mode 100755 diff --git a/scripts/xz_wrap.sh b/scripts/xz_wrap.sh old mode 100644 new mode 100755 From c40724d3f38122b8ae06367a425a63c24988c10f Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 4 Jun 2014 00:52:30 -0700 Subject: [PATCH 06/17] kconfig: lxdialog: fix spelling Signed-off-by: Brian Norris Cc: "Yann E. MORIN" Signed-off-by: Michal Marek --- scripts/kconfig/lxdialog/dialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h index b4343d384926..fcffd5b41fb0 100644 --- a/scripts/kconfig/lxdialog/dialog.h +++ b/scripts/kconfig/lxdialog/dialog.h @@ -170,7 +170,7 @@ char item_tag(void); /* item list manipulation for lxdialog use */ #define MAXITEMSTR 200 struct dialog_item { - char str[MAXITEMSTR]; /* promtp displayed */ + char str[MAXITEMSTR]; /* prompt displayed */ char tag; void *data; /* pointer to menu item - used by menubox+checklist */ int selected; /* Set to 1 by dialog_*() function if selected. */ From 7285996aa0006d671bb01f0d35991d254b2b2b01 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 4 Jun 2014 00:52:31 -0700 Subject: [PATCH 07/17] kconfig: nconfig: fix multi-byte UTF handling Currently, Kconfig descriptions that use multi-byte UTF-8 characters (such as MTD_NAND_CAFE) will have their menu entries dropped from the 'make nconfig' ncurses menu, and all subsequent entries in the same window will be omitted. This seems to be due to the ncurses 'menu' library, which does not traditionally handle UTF-8 >8-bit characters properly. The ncursesw library ('w' is for "wide") is written to handle these UTF-8 characters, and is practically a drop-in replacement at the source level. Use it by default, if available. Link: https://bugzilla.kernel.org/show_bug.cgi?id=43067 Signed-off-by: Brian Norris Cc: "Yann E. MORIN" Cc: Martin Walch Acked-by: Sam Ravnborg Signed-off-by: Michal Marek --- scripts/kconfig/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index e7bf38e92007..c05938555225 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -191,7 +191,8 @@ HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) HOSTLOADLIBES_nconf = $(shell \ - pkg-config --libs menu panel ncurses 2>/dev/null \ + pkg-config --libs menuw panelw ncursesw 2>/dev/null \ + || pkg-config --libs menu panel ncurses 2>/dev/null \ || echo "-lmenu -lpanel -lncurses" ) $(obj)/qconf.o: $(obj)/.tmp_qtcheck From be8af2d54a66911693eddc556e4f7a866670082b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 14 Sep 2014 12:57:50 +0200 Subject: [PATCH 08/17] kconfig/lxdialog: get ncurses CFLAGS with pkg-config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes "make menuconfig" also work on systems where ncurses is not installed in a standard location (such as on NixOS). This patch changes ccflags() so that it tries pkg-config first, and only if pkg-config fails does it go back to the fallback/manual checks. This is the same algorithm that ldflags() already uses. Signed-off-by: Bjørn Forsman Signed-off-by: Michal Marek --- scripts/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 9d2a4c585ee1..5075ebf2d3b9 100755 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -21,7 +21,11 @@ ldflags() # Where is ncurses.h? ccflags() { - if [ -f /usr/include/ncursesw/curses.h ]; then + if pkg-config --cflags ncursesw 2>/dev/null; then + echo '-DCURSES_LOC="" -DNCURSES_WIDECHAR=1' + elif pkg-config --cflags ncurses 2>/dev/null; then + echo '-DCURSES_LOC=""' + elif [ -f /usr/include/ncursesw/curses.h ]; then echo '-I/usr/include/ncursesw -DCURSES_LOC=""' echo ' -DNCURSES_WIDECHAR=1' elif [ -f /usr/include/ncurses/ncurses.h ]; then From 7ff525712acf9325e9acdb27bbc93049ea2e850c Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 Sep 2014 20:02:22 +0900 Subject: [PATCH 09/17] kbuild: fake the "Entering directory ..." message more simply Commit c2e28dc975ea87feed84415006ae143424912ac7 (kbuild: Print the name of the build directory) added a gimmick to show the "Entering directory ...". Instead of echoing the hard-coded message (that is, we need to know the exact message), moving --no-print-directory would be easier. Signed-off-by: Masahiro Yamada Acked-by: Peter Foley Signed-off-by: Michal Marek --- Makefile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index e43244263306..9eea3c0424db 100644 --- a/Makefile +++ b/Makefile @@ -10,11 +10,9 @@ NAME = Shuffling Zombie Juror # Comments in this file are targeted only to the developer, do not # expect to learn how to build the kernel reading this file. -# Do not: -# o use make's built-in rules and variables -# (this increases performance and avoids hard-to-debug behaviour); -# o print "Entering directory ..."; -MAKEFLAGS += -rR --no-print-directory +# Do not use make's built-in rules and variables +# (this increases performance and avoids hard-to-debug behaviour); +MAKEFLAGS += -rR # Avoid funny character set dependencies unexport LC_ALL @@ -172,13 +170,7 @@ PHONY += $(MAKECMDGOALS) sub-make $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make @: -# Fake the "Entering directory" message once, so that IDEs/editors are -# able to understand relative filenames. - echodir := @echo - quiet_echodir := @echo -silent_echodir := @: sub-make: FORCE - $($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'" $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ KBUILD_SRC=$(CURDIR) \ KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ @@ -192,6 +184,11 @@ endif # ifeq ($(KBUILD_SRC),) # We process the rest of the Makefile if this is the final invocation of make ifeq ($(skip-makefile),) +# Do not print "Entering directory ...", +# but we want to display it when entering to the output directory +# so that IDEs/editors are able to understand relative filenames. +MAKEFLAGS += --no-print-directory + # If building an external module we do not care about the all: rule # but instead _all depend on modules PHONY += all From 745a254322c898dadf019342cd7140f7867d2d0f Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 Sep 2014 20:02:23 +0900 Subject: [PATCH 10/17] kbuild: use $(Q) for sub-make target Since commit 066b7ed9558087a7957a1128f27d7a3462ff117f (kbuild: Do not print the build directory with make -s), "Q" is defined above the sub-make target. This commit takes advantage of that and replaces "$(if $(KBUILD_VERBOSE:1=),@)" with "$(Q)". Signed-off-by: Masahiro Yamada Acked-by: Peter Foley Signed-off-by: Michal Marek --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9eea3c0424db..edc1269ee24c 100644 --- a/Makefile +++ b/Makefile @@ -171,8 +171,7 @@ $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make @: sub-make: FORCE - $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ - KBUILD_SRC=$(CURDIR) \ + $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ $(filter-out _all sub-make,$(MAKECMDGOALS)) From aa55c8e2f7a395dfc9e67fc6637321e19ce9bfe1 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 Sep 2014 20:02:24 +0900 Subject: [PATCH 11/17] kbuild: handle C=... and M=... after entering into build directory This commit avoids processing C=... and M=... twice when O=... is also given. Besides, we can also remove KBUILD_EXTMOD="$(KBUILD_EXTMOD)" in the sub-make target. Signed-off-by: Masahiro Yamada Acked-by: Peter Foley Signed-off-by: Michal Marek --- Makefile | 60 +++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index edc1269ee24c..367239053684 100644 --- a/Makefile +++ b/Makefile @@ -95,34 +95,6 @@ endif export quiet Q KBUILD_VERBOSE -# Call a source code checker (by default, "sparse") as part of the -# C compilation. -# -# Use 'make C=1' to enable checking of only re-compiled files. -# Use 'make C=2' to enable checking of *all* source files, regardless -# of whether they are re-compiled or not. -# -# See the file "Documentation/sparse.txt" for more details, including -# where to get the "sparse" utility. - -ifeq ("$(origin C)", "command line") - KBUILD_CHECKSRC = $(C) -endif -ifndef KBUILD_CHECKSRC - KBUILD_CHECKSRC = 0 -endif - -# Use make M=dir to specify directory of external module to build -# Old syntax make ... SUBDIRS=$PWD is still supported -# Setting the environment variable KBUILD_EXTMOD take precedence -ifdef SUBDIRS - KBUILD_EXTMOD ?= $(SUBDIRS) -endif - -ifeq ("$(origin M)", "command line") - KBUILD_EXTMOD := $(M) -endif - # kbuild supports saving output files in a separate directory. # To locate output files in a separate directory two syntaxes are supported. # In both cases the working directory must be the root of the kernel src. @@ -138,7 +110,6 @@ endif # The O= assignment takes precedence over the KBUILD_OUTPUT environment # variable. - # KBUILD_SRC is set on invocation of make in OBJ directory # KBUILD_SRC is not intended to be used by the regular user (for now) ifeq ($(KBUILD_SRC),) @@ -172,8 +143,7 @@ $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make sub-make: FORCE $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ - KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ - $(filter-out _all sub-make,$(MAKECMDGOALS)) + -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) # Leave processing to above invocation of make skip-makefile := 1 @@ -188,6 +158,34 @@ ifeq ($(skip-makefile),) # so that IDEs/editors are able to understand relative filenames. MAKEFLAGS += --no-print-directory +# Call a source code checker (by default, "sparse") as part of the +# C compilation. +# +# Use 'make C=1' to enable checking of only re-compiled files. +# Use 'make C=2' to enable checking of *all* source files, regardless +# of whether they are re-compiled or not. +# +# See the file "Documentation/sparse.txt" for more details, including +# where to get the "sparse" utility. + +ifeq ("$(origin C)", "command line") + KBUILD_CHECKSRC = $(C) +endif +ifndef KBUILD_CHECKSRC + KBUILD_CHECKSRC = 0 +endif + +# Use make M=dir to specify directory of external module to build +# Old syntax make ... SUBDIRS=$PWD is still supported +# Setting the environment variable KBUILD_EXTMOD take precedence +ifdef SUBDIRS + KBUILD_EXTMOD ?= $(SUBDIRS) +endif + +ifeq ("$(origin M)", "command line") + KBUILD_EXTMOD := $(M) +endif + # If building an external module we do not care about the all: rule # but instead _all depend on modules PHONY += all From 895ed4e895756ca5e0a0bf43f45b7eed7b9c604a Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 Sep 2014 19:26:19 +0900 Subject: [PATCH 12/17] kbuild: remove unnecessary "obj- := dummy.o" trick In these Makefiles, at least one of "obj-y" and "obj-" is non-empty, hence built-in.o is always created without such a trick. Signed-off-by: Masahiro Yamada Acked-by: Peter Foley Acked-by: Mike Turquette Acked-by: Simon Horman [shmobile] Acked-by: David S. Miller [networking] Signed-off-by: Michal Marek --- arch/arm/plat-samsung/Makefile | 1 - drivers/clk/shmobile/Makefile | 2 -- drivers/net/wimax/Makefile | 4 ---- 3 files changed, 7 deletions(-) diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 5fe175017f07..a402262bb37f 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -8,7 +8,6 @@ ccflags-$(CONFIG_ARCH_MULTI_V7) += -I$(srctree)/$(src)/include obj-y := obj-m := -obj-n := dummy.o obj- := # Objects we always build independent of SoC choice diff --git a/drivers/clk/shmobile/Makefile b/drivers/clk/shmobile/Makefile index e0029237827a..9aab51c8d159 100644 --- a/drivers/clk/shmobile/Makefile +++ b/drivers/clk/shmobile/Makefile @@ -6,5 +6,3 @@ obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-mstp.o -# for emply built-in.o -obj-n := dummy diff --git a/drivers/net/wimax/Makefile b/drivers/net/wimax/Makefile index 992bc02bc016..692184dd674a 100644 --- a/drivers/net/wimax/Makefile +++ b/drivers/net/wimax/Makefile @@ -1,5 +1 @@ - obj-$(CONFIG_WIMAX_I2400M) += i2400m/ - -# (from Sam Ravnborg) force kbuild to create built-in.o -obj- := dummy.o From ac84eb47cc199d9df7eeb7b32630fc09295a030b Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 Sep 2014 19:26:20 +0900 Subject: [PATCH 13/17] kbuild: remove unnecessary variable initializaions Clearing obj-y, obj-m, obj-n, obj- in each Makefile is a useless habit. They are non-exported variables; therefore they are always empty whenever descending into each subdirectory. (Moreorver, obj-y and obj-m are also set to empty at the beginning of scripts/Makefile.build) Signed-off-by: Masahiro Yamada Acked-by: Nicolas Ferre Acked-by: Peter Foley Acked-by: Linus Walleij Signed-off-by: Michal Marek --- arch/arm/mach-at91/Makefile | 3 --- arch/arm/mach-ebsa110/Makefile | 3 --- arch/arm/mach-ep93xx/Makefile | 3 --- arch/arm/mach-exynos/Makefile | 5 ----- arch/arm/mach-footbridge/Makefile | 3 --- arch/arm/mach-iop13xx/Makefile | 5 ----- arch/arm/mach-iop32x/Makefile | 3 --- arch/arm/mach-iop33x/Makefile | 3 --- arch/arm/mach-ks8695/Makefile | 3 --- arch/arm/mach-rpc/Makefile | 4 ---- arch/arm/mach-s3c24xx/Makefile | 5 ----- arch/arm/mach-s3c64xx/Makefile | 5 ----- arch/arm/mach-s5pv210/Makefile | 5 ----- arch/arm/mach-sa1100/Makefile | 3 --- arch/arm/mach-u300/Makefile | 3 --- arch/arm/plat-iop/Makefile | 6 ------ arch/arm/plat-omap/Makefile | 3 --- arch/arm/plat-samsung/Makefile | 4 ---- 18 files changed, 69 deletions(-) diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 78e9cec282f4..75033839fc08 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile @@ -3,9 +3,6 @@ # obj-y := irq.o gpio.o setup.o sysirq_mask.o -obj-m := -obj-n := -obj- := obj-$(CONFIG_OLD_CLK_AT91) += clock.o obj-$(CONFIG_AT91_SAM9_ALT_RESET) += at91sam9_alt_reset.o diff --git a/arch/arm/mach-ebsa110/Makefile b/arch/arm/mach-ebsa110/Makefile index 935e4af01a27..a7d68c13c1d1 100644 --- a/arch/arm/mach-ebsa110/Makefile +++ b/arch/arm/mach-ebsa110/Makefile @@ -5,6 +5,3 @@ # Object file lists. obj-y := core.o io.o leds.o -obj-m := -obj-n := -obj- := diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile index 0dc51f9462de..78d427b34b1f 100644 --- a/arch/arm/mach-ep93xx/Makefile +++ b/arch/arm/mach-ep93xx/Makefile @@ -2,9 +2,6 @@ # Makefile for the linux kernel. # obj-y := core.o clock.o -obj-m := -obj-n := -obj- := obj-$(CONFIG_EP93XX_DMA) += dma.o diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index 788f26d21141..27ae6144679c 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile @@ -7,11 +7,6 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include -obj-y := -obj-m := -obj-n := -obj- := - # Core obj-$(CONFIG_ARCH_EXYNOS) += exynos.o pmu.o exynos-smc.o firmware.o diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile index c3faa3bc84dd..e83d5c8396ff 100644 --- a/arch/arm/mach-footbridge/Makefile +++ b/arch/arm/mach-footbridge/Makefile @@ -5,9 +5,6 @@ # Object file lists. obj-y := common.o dma.o isa-irq.o -obj-m := -obj-n := -obj- := pci-y += dc21285.o pci-$(CONFIG_ARCH_CATS) += cats-pci.o diff --git a/arch/arm/mach-iop13xx/Makefile b/arch/arm/mach-iop13xx/Makefile index cad015fee12f..a3d9260e335f 100644 --- a/arch/arm/mach-iop13xx/Makefile +++ b/arch/arm/mach-iop13xx/Makefile @@ -1,8 +1,3 @@ -obj-y := -obj-m := -obj-n := -obj- := - obj-$(CONFIG_ARCH_IOP13XX) += setup.o obj-$(CONFIG_ARCH_IOP13XX) += irq.o obj-$(CONFIG_ARCH_IOP13XX) += pci.o diff --git a/arch/arm/mach-iop32x/Makefile b/arch/arm/mach-iop32x/Makefile index cfdf8a137c2b..2d4010abb82f 100644 --- a/arch/arm/mach-iop32x/Makefile +++ b/arch/arm/mach-iop32x/Makefile @@ -3,9 +3,6 @@ # obj-y := irq.o -obj-m := -obj-n := -obj- := obj-$(CONFIG_MACH_GLANTANK) += glantank.o obj-$(CONFIG_ARCH_IQ80321) += iq80321.o diff --git a/arch/arm/mach-iop33x/Makefile b/arch/arm/mach-iop33x/Makefile index 90081d8c9d16..e95db30d81d5 100644 --- a/arch/arm/mach-iop33x/Makefile +++ b/arch/arm/mach-iop33x/Makefile @@ -3,9 +3,6 @@ # obj-y := irq.o uart.o -obj-m := -obj-n := -obj- := obj-$(CONFIG_ARCH_IQ80331) += iq80331.o obj-$(CONFIG_MACH_IQ80332) += iq80332.o diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile index e370caf0c91b..8ecb7973ae54 100644 --- a/arch/arm/mach-ks8695/Makefile +++ b/arch/arm/mach-ks8695/Makefile @@ -4,9 +4,6 @@ # obj-y := cpu.o irq.o time.o devices.o -obj-m := -obj-n := -obj- := # PCI support is optional obj-$(CONFIG_PCI) += pci.o diff --git a/arch/arm/mach-rpc/Makefile b/arch/arm/mach-rpc/Makefile index 992e28b4ae9a..2ebc6875aeb8 100644 --- a/arch/arm/mach-rpc/Makefile +++ b/arch/arm/mach-rpc/Makefile @@ -5,7 +5,3 @@ # Object file lists. obj-y := dma.o ecard.o fiq.o irq.o riscpc.o time.o -obj-m := -obj-n := -obj- := - diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile index 2235d0d3b38d..b92071638733 100644 --- a/arch/arm/mach-s3c24xx/Makefile +++ b/arch/arm/mach-s3c24xx/Makefile @@ -7,11 +7,6 @@ # # Licensed under GPLv2 -obj-y := -obj-m := -obj-n := -obj- := - # core obj-y += common.o diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index 58069a702a43..12f67b61ca5f 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile @@ -5,11 +5,6 @@ # # Licensed under GPLv2 -obj-y := -obj-m := -obj-n := -obj- := - # Core obj-y += common.o diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index 7dc2d0e25a83..72b9e9671507 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile @@ -7,11 +7,6 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include -obj-y := -obj-m := -obj-n := -obj- := - # Core obj-$(CONFIG_PM_SLEEP) += pm.o sleep.o diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile index 2732eef48966..f1114d11fe13 100644 --- a/arch/arm/mach-sa1100/Makefile +++ b/arch/arm/mach-sa1100/Makefile @@ -4,9 +4,6 @@ # Common support obj-y := clock.o generic.o irq.o time.o #nmi-oopser.o -obj-m := -obj-n := -obj- := # Specific board support obj-$(CONFIG_SA1100_ASSABET) += assabet.o diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile index 3ec74ac95bc1..87d37de054b6 100644 --- a/arch/arm/mach-u300/Makefile +++ b/arch/arm/mach-u300/Makefile @@ -3,9 +3,6 @@ # obj-y := core.o -obj-m := -obj-n := -obj- := obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o obj-$(CONFIG_REGULATOR_AB3100) += regulator.o diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile index 224e56c6049b..f2af203d601f 100644 --- a/arch/arm/plat-iop/Makefile +++ b/arch/arm/plat-iop/Makefile @@ -2,8 +2,6 @@ # Makefile for the linux kernel. # -obj-y := - # IOP32X obj-$(CONFIG_ARCH_IOP32X) += i2c.o obj-$(CONFIG_ARCH_IOP32X) += pci.o @@ -27,7 +25,3 @@ obj-$(CONFIG_ARCH_IOP33X) += restart.o # IOP13XX obj-$(CONFIG_ARCH_IOP13XX) += cp6.o obj-$(CONFIG_ARCH_IOP13XX) += time.o - -obj-m := -obj-n := -obj- := diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 0b01b68fd033..97a50e8883f9 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -6,9 +6,6 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include # Common support obj-y := sram.o dma.o counter_32k.o -obj-m := -obj-n := -obj- := # omap_device support (OMAP2+ only at the moment) diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index a402262bb37f..f0a008496993 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -6,10 +6,6 @@ ccflags-$(CONFIG_ARCH_MULTI_V7) += -I$(srctree)/$(src)/include -obj-y := -obj-m := -obj- := - # Objects we always build independent of SoC choice obj-y += init.o cpu.o From a4954fd7724c0f55361eb56005856b0da0c99b00 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 Sep 2014 19:26:21 +0900 Subject: [PATCH 14/17] kbuild: remove obj-n and lib-n handling Kconfig never defines CONFIG_* as 'n'. Now obj-n is only used in firmware/Makefile and it can be replaced with obj-. No makefile uses lib-n. Let's rip off obj-n and lib-n. Signed-off-by: Masahiro Yamada Acked-by: Peter Foley Signed-off-by: Michal Marek --- firmware/Makefile | 2 +- scripts/Makefile.build | 4 ++-- scripts/Makefile.clean | 4 +--- scripts/Makefile.fwinst | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index 0862d34cf7d1..e297e1b52636 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -232,6 +232,6 @@ targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \ # Without this, built-in.o won't be created when it's empty, and the # final vmlinux link will fail. -obj-n := dummy +obj- := dummy hostprogs-y := ihex2fw diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5b09d3637855..649ce6844033 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -79,11 +79,11 @@ endif # =========================================================================== -ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),) +ifneq ($(strip $(lib-y) $(lib-m) $(lib-)),) lib-target := $(obj)/lib.a endif -ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(subdir-m) $(lib-target)),) +ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),) builtin-target := $(obj)/built-in.o endif diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index a651cee84f2a..c630ab52fa42 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -23,15 +23,13 @@ __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) subdir-y += $(__subdir-y) __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) subdir-m += $(__subdir-m) -__subdir-n := $(patsubst %/,%,$(filter %/, $(obj-n))) -subdir-n += $(__subdir-n) __subdir- := $(patsubst %/,%,$(filter %/, $(obj-))) subdir- += $(__subdir-) # Subdirectories we need to descend into subdir-ym := $(sort $(subdir-y) $(subdir-m)) -subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) +subdir-ymn := $(sort $(subdir-ym) $(subdir-)) # Add subdir path diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst index d8e335eed226..5b698add4f31 100644 --- a/scripts/Makefile.fwinst +++ b/scripts/Makefile.fwinst @@ -2,7 +2,7 @@ # Installing firmware # # We don't include the .config, so all firmware files are in $(fw-shipped-) -# rather than in $(fw-shipped-y) or $(fw-shipped-n). +# rather than in $(fw-shipped-y) or $(fw-shipped-m). # ========================================================================== INSTALL := install From 226422d08c33cf0b68f6ea55a3b0e5f9c8212bf8 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 22 Aug 2014 19:52:17 +0900 Subject: [PATCH 15/17] kbuild: arm: Do not define "comma" twice The definition of "comma" exists in scripts/Kbuild.include. We should not double it. Signed-off-by: Masahiro Yamada Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Michal Marek --- arch/arm/Makefile | 2 -- arch/arm64/Makefile | 2 -- 2 files changed, 4 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 0ce9d0f71f2a..8568b6fb9b3f 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -50,8 +50,6 @@ AS += -EL LD += -EL endif -comma = , - # This selects which instruction set is used. # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 57833546bf00..ebd06592d7a6 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -30,8 +30,6 @@ AS += -EL LD += -EL endif -comma = , - CHECKFLAGS += -D__aarch64__ # Default value From 5b2389b45d1a9c12b9f4b976e38c36264bfc42f5 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 9 Sep 2014 20:03:58 +0900 Subject: [PATCH 16/17] kbuild: simplify build, clean, modbuiltin shorthands $(if $(KBUILD_SRC),$(srctree)/) was a useful strategy to omit a long absolute path for in-source-tree build prior to commit 890676c65d699db3ad82e7dddd0cf8fb449031af (kbuild: Use relative path when building in the source tree). Now $(srctree) is "." when building in the source tree. It would not be annoying to add "$(srctree)/" all the time. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Marek --- Makefile | 2 +- scripts/Kbuild.include | 4 ++-- scripts/Makefile.clean | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 367239053684..efbd2cbd89ae 100644 --- a/Makefile +++ b/Makefile @@ -1568,7 +1568,7 @@ endif # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir # Usage: # $(Q)$(MAKE) $(clean)=dir -clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj +clean := -f $(srctree)/scripts/Makefile.clean obj endif # skip-makefile diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 8a9a4e1c7eab..65e7b08bb2cc 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -171,13 +171,13 @@ ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3)) # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= # Usage: # $(Q)$(MAKE) $(build)=dir -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj +build := -f $(srctree)/scripts/Makefile.build obj ### # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj= # Usage: # $(Q)$(MAKE) $(modbuiltin)=dir -modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj +modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj # Prefix -I with $(srctree) if it is not an absolute path. # skip if -I has no parameter diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index c630ab52fa42..b1c668dc6815 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -10,7 +10,7 @@ __clean: # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir # Usage: # $(Q)$(MAKE) $(clean)=dir -clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj +clean := -f $(srctree)/scripts/Makefile.clean obj # The filename Kbuild has precedence over Makefile kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) From 30142230a730263e9989e0174b74c2429e041c8c Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Thu, 2 Oct 2014 15:27:07 +0200 Subject: [PATCH 17/17] kbuild: Do not reference *-n variables in the Makefile Kconfig options are either 'y', 'm', or undefined. Signed-off-by: Michal Marek --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index efbd2cbd89ae..106f30012815 100644 --- a/Makefile +++ b/Makefile @@ -868,9 +868,7 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(net-y) $(net-m) $(libs-y) $(libs-m))) vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ - $(init-n) $(init-) \ - $(core-n) $(core-) $(drivers-n) $(drivers-) \ - $(net-n) $(net-) $(libs-n) $(libs-)))) + $(init-) $(core-) $(drivers-) $(net-) $(libs-)))) init-y := $(patsubst %/, %/built-in.o, $(init-y)) core-y := $(patsubst %/, %/built-in.o, $(core-y))