Skip to content

Commit f91e46b

Browse files
committed
kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig
Unify the similar build rules. This supports 'make build_config', which builds scripts/kconfig/conf but does not invoke it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent ae8da72 commit f91e46b

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

scripts/kconfig/Makefile

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
# Kernel configuration targets
44
# These targets are used from top-level makefile
55

6-
PHONY += xconfig gconfig menuconfig config localmodconfig localyesconfig \
7-
build_menuconfig build_nconfig build_gconfig build_xconfig
8-
96
ifdef KBUILD_KCONFIG
107
Kconfig := $(KBUILD_KCONFIG)
118
else
@@ -19,29 +16,24 @@ endif
1916
# We need this, in case the user has it in its environment
2017
unexport CONFIG_
2118

22-
xconfig: $(obj)/qconf
23-
$(Q)$< $(silent) $(Kconfig)
24-
25-
gconfig: $(obj)/gconf
26-
$(Q)$< $(silent) $(Kconfig)
27-
28-
menuconfig: $(obj)/mconf
29-
$(Q)$< $(silent) $(Kconfig)
30-
31-
config: $(obj)/conf
32-
$(Q)$< $(silent) $(Kconfig)
33-
34-
nconfig: $(obj)/nconf
35-
$(Q)$< $(silent) $(Kconfig)
36-
37-
build_menuconfig: $(obj)/mconf
19+
config-prog := conf
20+
menuconfig-prog := mconf
21+
nconfig-prog := nconf
22+
gconfig-prog := gconf
23+
xconfig-prog := qconf
3824

39-
build_nconfig: $(obj)/nconf
25+
define config_rule
26+
PHONY += $(1)
27+
$(1): $(obj)/$($(1)-prog)
28+
$(Q)$$< $(silent) $(Kconfig)
4029

41-
build_gconfig: $(obj)/gconf
30+
PHONY += build_$(1)
31+
build_$(1): $(obj)/$($(1)-prog)
32+
endef
4233

43-
build_xconfig: $(obj)/qconf
34+
$(foreach c, config menuconfig nconfig gconfig xconfig, $(eval $(call config_rule,$(c))))
4435

36+
PHONY += localmodconfig localyesconfig
4537
localyesconfig localmodconfig: $(obj)/conf
4638
$(Q)$(PERL) $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config
4739
$(Q)if [ -f .config ]; then \

0 commit comments

Comments
 (0)