Skip to content

Commit

Permalink
kbuild: add generic mergeconfig target, %.config
Browse files Browse the repository at this point in the history
"scripts/kconfig/merge_config.sh && make oldconfig" works well
enough for merging local config fragments, but Kbuild currently has
the entry points only for "kvmconfig" and "tinyconfig".

This commit provides the generic target for mergeconfig, so we can
manage our own config fragments easily:
put "foo.config" in arch/$(SRCARCH)/configs/ or kernel/configs/,
and then run "make foo.config".

Now "make kvmconfig" is just a shorthand of "make kvm_guest.config".
Likewise, "make tinyconfig" is equivalent to
"make allnoconfig tiny.config".

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Reviewed-by: Darren Hart <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
masahir0y authored and michal42 committed Mar 24, 2015
1 parent bc8f8f5 commit 63a9103
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,20 @@ endif
%_defconfig: $(obj)/conf
$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)

configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)

define mergeconfig
$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(call configfiles,$(1))
+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
endef
%.config: $(obj)/conf
$(if $(call configfiles),, $(error No configuration exists for this target on this architecture))
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles)
+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig

PHONY += kvmconfig
kvmconfig:
$(call mergeconfig,kvm_guest)
kvmconfig: kvm_guest.config
@:

PHONY += tinyconfig
tinyconfig: allnoconfig
$(call mergeconfig,tiny)
tinyconfig:
$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config

# Help text used by make help
help:
Expand Down

0 comments on commit 63a9103

Please sign in to comment.