@@ -142,23 +142,22 @@ help:
142142 @echo ' testconfig - Run Kconfig unit tests (requires python3 and pytest)'
143143
144144# ===========================================================================
145- # Shared Makefile for the various kconfig executables:
146- # conf: Used for defconfig, oldconfig and related targets
147145# object files used by all kconfig flavours
148-
149- conf-objs := conf.o zconf.tab.o
150-
151- hostprogs-y := conf
146+ common-objs := confdata.o expr.o symbol.o preprocess.o zconf.tab.o
152147
153148targets += zconf.lex.c
154149
155150# generated files seem to need this to find local include files
156151HOSTCFLAGS_zconf.lex.o := -I$(src )
157152HOSTCFLAGS_zconf.tab.o := -I$(src )
158153
154+ # conf: Used for defconfig, oldconfig and related targets
155+ hostprogs-y += conf
156+ conf-objs := conf.o $(common-objs )
157+
159158# nconf: Used for the nconfig target based on ncurses
160159hostprogs-y += nconf
161- nconf-objs := nconf.o zconf.tab.o nconf.gui.o
160+ nconf-objs := nconf.o nconf.gui.o $( common-objs )
162161
163162HOSTLDLIBS_nconf = $(shell . $(obj ) /.nconf-cfg && echo $$libs)
164163HOSTCFLAGS_nconf.o = $(shell . $(obj ) /.nconf-cfg && echo $$cflags)
@@ -169,7 +168,7 @@ $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg
169168# mconf: Used for the menuconfig target based on lxdialog
170169hostprogs-y += mconf
171170lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o
172- mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog ) )
171+ mconf-objs := mconf.o $(addprefix lxdialog/, $(lxdialog ) ) $( common-objs )
173172
174173HOSTLDLIBS_mconf = $(shell . $(obj ) /.mconf-cfg && echo $$libs)
175174$(foreach f, mconf.o $(lxdialog), \
@@ -181,7 +180,7 @@ $(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg
181180# qconf: Used for the xconfig target based on Qt
182181hostprogs-y += qconf
183182qconf-cxxobjs := qconf.o
184- qconf-objs := zconf.tab.o
183+ qconf-objs := $( common-objs )
185184
186185HOSTLDLIBS_qconf = $(shell . $(obj ) /.qconf-cfg && echo $$libs)
187186HOSTCXXFLAGS_qconf.o = $(shell . $(obj ) /.qconf-cfg && echo $$cflags)
@@ -196,7 +195,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg
196195
197196# gconf: Used for the gconfig target based on GTK+
198197hostprogs-y += gconf
199- gconf-objs := gconf.o zconf.tab.o
198+ gconf-objs := gconf.o $( common-objs )
200199
201200HOSTLDLIBS_gconf = $(shell . $(obj ) /.gconf-cfg && echo $$libs)
202201HOSTCFLAGS_gconf.o = $(shell . $(obj ) /.gconf-cfg && echo $$cflags)
0 commit comments