Skip to content

Commit d08372c

Browse files
committed
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek: "Here are the kbuild changes for v3.19-rc1: - Cleanups and deduplication in the main Makefile and scripts/Makefile.* - Sort the output of *config targets in make help - Old <linux/version.h> is always removed to avoid a surprise during bisecting - Warning fix in kconfig" * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kbuild: remove redundant -rR flag of hdr-inst kbuild: Fix make help-<board series> on powerpc kbuild: Automatically remove stale <linux/version.h> file kconfig: Fix warning "‘jump’ may be used uninitialized" Makefile: sort list of defconfig targets in make help output kbuild: Remove duplicate $(cmd) definition in Makefile.clean kbuild: collect shorthands into scripts/Kbuild.include
2 parents ecb5ec0 + 1846dfb commit d08372c

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

Makefile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,10 @@ asm-generic:
481481
# of make so .config is not included in this case either (for *config).
482482

483483
version_h := include/generated/uapi/linux/version.h
484+
old_version_h := include/linux/version.h
484485

485486
no-dot-config-targets := clean mrproper distclean \
486-
cscope gtags TAGS tags help %docs check% coccicheck \
487+
cscope gtags TAGS tags help% %docs check% coccicheck \
487488
$(version_h) headers_% archheaders archscripts \
488489
kernelversion %src-pkg
489490

@@ -1005,6 +1006,7 @@ endef
10051006

10061007
$(version_h): $(srctree)/Makefile FORCE
10071008
$(call filechk,version.h)
1009+
$(Q)rm -f $(old_version_h)
10081010

10091011
include/generated/utsrelease.h: include/config/kernel.release FORCE
10101012
$(call filechk,utsrelease.h)
@@ -1036,8 +1038,6 @@ firmware_install: FORCE
10361038
#Default location for installed headers
10371039
export INSTALL_HDR_PATH = $(objtree)/usr
10381040

1039-
hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
1040-
10411041
# If we do an all arch process set dst to asm-$(hdr-arch)
10421042
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
10431043

@@ -1175,7 +1175,7 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
11751175
Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
11761176
signing_key.priv signing_key.x509 x509.genkey \
11771177
extra_certificates signing_key.x509.keyid \
1178-
signing_key.x509.signer include/linux/version.h
1178+
signing_key.x509.signer
11791179

11801180
# clean - Delete most, but leave enough to build external modules
11811181
#
@@ -1235,7 +1235,7 @@ rpm: include/config/kernel.release FORCE
12351235
# ---------------------------------------------------------------------------
12361236

12371237
boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
1238-
boards := $(notdir $(boards))
1238+
boards := $(sort $(notdir $(boards)))
12391239
board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
12401240
board-dirs := $(sort $(notdir $(board-dirs:/=)))
12411241

@@ -1326,7 +1326,7 @@ help-board-dirs := $(addprefix help-,$(board-dirs))
13261326

13271327
help-boards: $(help-board-dirs)
13281328

1329-
boards-per-dir = $(notdir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/$*/*_defconfig))
1329+
boards-per-dir = $(sort $(notdir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/$*/*_defconfig)))
13301330

13311331
$(help-board-dirs): help-%:
13321332
@echo 'Architecture specific targets ($(SRCARCH) $*):'
@@ -1581,11 +1581,6 @@ ifneq ($(cmd_files),)
15811581
include $(cmd_files)
15821582
endif
15831583

1584-
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
1585-
# Usage:
1586-
# $(Q)$(MAKE) $(clean)=dir
1587-
clean := -f $(srctree)/scripts/Makefile.clean obj
1588-
15891584
endif # skip-makefile
15901585

15911586
PHONY += FORCE

scripts/Kbuild.include

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,18 @@ modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
185185
# $(Q)$(MAKE) $(dtbinst)=dir
186186
dtbinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.dtbinst obj
187187

188+
###
189+
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=
190+
# Usage:
191+
# $(Q)$(MAKE) $(clean)=dir
192+
clean := -f $(srctree)/scripts/Makefile.clean obj
193+
194+
###
195+
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.headersinst obj=
196+
# Usage:
197+
# $(Q)$(MAKE) $(hdr-inst)=dir
198+
hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
199+
188200
# Prefix -I with $(srctree) if it is not an absolute path.
189201
# skip if -I has no parameter
190202
addtree = $(if $(patsubst -I%,%,$(1)), \

scripts/Makefile.clean

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ src := $(obj)
77
PHONY := __clean
88
__clean:
99

10-
# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
11-
# Usage:
12-
# $(Q)$(MAKE) $(clean)=dir
13-
clean := -f $(srctree)/scripts/Makefile.clean obj
10+
include scripts/Kbuild.include
1411

1512
# The filename Kbuild has precedence over Makefile
1613
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
@@ -91,11 +88,6 @@ PHONY += $(subdir-ymn)
9188
$(subdir-ymn):
9289
$(Q)$(MAKE) $(clean)=$@
9390

94-
# If quiet is set, only print short version of command
95-
96-
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
97-
98-
9991
# Declare the contents of the .PHONY variable as phony. We keep that
10092
# information in a variable se we can use it in if_changed and friends.
10193

scripts/Makefile.headersinst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ $(check-file): scripts/headers_check.pl $(output-files) FORCE
122122
endif
123123

124124
# Recursion
125-
hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
126125
.PHONY: $(subdirs)
127126
$(subdirs):
128127
$(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@

scripts/kconfig/menu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
548548
{
549549
int i, j;
550550
struct menu *submenu[8], *menu, *location = NULL;
551-
struct jump_key *jump;
551+
struct jump_key *jump = NULL;
552552

553553
str_printf(r, _("Prompt: %s\n"), _(prop->text));
554554
menu = prop->menu->parent;
@@ -586,7 +586,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
586586
str_printf(r, _(" Location:\n"));
587587
for (j = 4; --i >= 0; j += 2) {
588588
menu = submenu[i];
589-
if (head && location && menu == location)
589+
if (jump && menu == location)
590590
jump->offset = strlen(r->s);
591591
str_printf(r, "%*c-> %s", j, ' ',
592592
_(menu_get_prompt(menu)));

0 commit comments

Comments
 (0)