xref: /linux/scripts/Makefile.defconf (revision b8e85e6f3a09fc56b0ff574887798962ef8a8f80)
1# SPDX-License-Identifier: GPL-2.0
2# Configuration heplers
3
4# Creates 'merged defconfigs'
5# ---------------------------------------------------------------------------
6# Usage:
7#   $(call merge_into_defconfig,base_config,config_fragment1 config_fragment2 ...)
8#
9# Input config fragments without '.config' suffix
10define merge_into_defconfig
11	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
12		-m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
13		$(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
14	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
15endef
16
17
18# Creates 'merged defconfigs without warning about overrides'
19# ---------------------------------------------------------------------------
20# Usage:
21#   $(call merge_into_defconfig_override,base_config,config_fragment1 config_fragment2 ...)
22#
23# Input config fragments without '.config' suffix
24define merge_into_defconfig_override
25	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
26		-Q -m -O $(objtree) $(srctree)/arch/$(SRCARCH)/configs/$(1) \
27		$(foreach config,$(2),$(srctree)/arch/$(SRCARCH)/configs/$(config).config)
28	+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
29endef
30