Skip to content

Commit

Permalink
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/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
  • Loading branch information
torvalds committed Dec 20, 2014
2 parents ecb5ec0 + 1846dfb commit d08372c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,10 @@ asm-generic:
# of make so .config is not included in this case either (for *config).

version_h := include/generated/uapi/linux/version.h
old_version_h := include/linux/version.h

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

Expand Down Expand Up @@ -1005,6 +1006,7 @@ endef

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

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

hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj

# If we do an all arch process set dst to asm-$(hdr-arch)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)

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

# clean - Delete most, but leave enough to build external modules
#
Expand Down Expand Up @@ -1235,7 +1235,7 @@ rpm: include/config/kernel.release FORCE
# ---------------------------------------------------------------------------

boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
boards := $(notdir $(boards))
boards := $(sort $(notdir $(boards)))
board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
board-dirs := $(sort $(notdir $(board-dirs:/=)))

Expand Down Expand Up @@ -1326,7 +1326,7 @@ help-board-dirs := $(addprefix help-,$(board-dirs))

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

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

$(help-board-dirs): help-%:
@echo 'Architecture specific targets ($(SRCARCH) $*):'
Expand Down Expand Up @@ -1581,11 +1581,6 @@ ifneq ($(cmd_files),)
include $(cmd_files)
endif

# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(srctree)/scripts/Makefile.clean obj

endif # skip-makefile

PHONY += FORCE
Expand Down
12 changes: 12 additions & 0 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
# $(Q)$(MAKE) $(dtbinst)=dir
dtbinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.dtbinst obj

###
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(srctree)/scripts/Makefile.clean obj

###
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.headersinst obj=
# Usage:
# $(Q)$(MAKE) $(hdr-inst)=dir
hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj

# Prefix -I with $(srctree) if it is not an absolute path.
# skip if -I has no parameter
addtree = $(if $(patsubst -I%,%,$(1)), \
Expand Down
10 changes: 1 addition & 9 deletions scripts/Makefile.clean
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ src := $(obj)
PHONY := __clean
__clean:

# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(srctree)/scripts/Makefile.clean obj
include scripts/Kbuild.include

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

# If quiet is set, only print short version of command

cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))


# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.

Expand Down
1 change: 0 additions & 1 deletion scripts/Makefile.headersinst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ $(check-file): scripts/headers_check.pl $(output-files) FORCE
endif

# Recursion
hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
.PHONY: $(subdirs)
$(subdirs):
$(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
{
int i, j;
struct menu *submenu[8], *menu, *location = NULL;
struct jump_key *jump;
struct jump_key *jump = NULL;

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

0 comments on commit d08372c

Please sign in to comment.