Makefile (754451342fc5954061ede74b0a8485ec4a4c6eaa) Makefile (0b669a5076fd8c4b0dc6f21e41f93b1102c52925)
1# SPDX-License-Identifier: GPL-2.0
2# ===========================================================================
3# Kernel configuration targets
4# These targets are used from top-level makefile
5
6PHONY += xconfig gconfig menuconfig config syncconfig update-po-config \
7 localmodconfig localyesconfig
8

--- 174 unchanged lines hidden (view full) ---

183
184# ===========================================================================
185# Shared Makefile for the various kconfig executables:
186# conf: Used for defconfig, oldconfig and related targets
187# nconf: Used for the nconfig target.
188# Utilizes ncurses
189# mconf: Used for the menuconfig target
190# Utilizes the lxdialog package
1# SPDX-License-Identifier: GPL-2.0
2# ===========================================================================
3# Kernel configuration targets
4# These targets are used from top-level makefile
5
6PHONY += xconfig gconfig menuconfig config syncconfig update-po-config \
7 localmodconfig localyesconfig
8

--- 174 unchanged lines hidden (view full) ---

183
184# ===========================================================================
185# Shared Makefile for the various kconfig executables:
186# conf: Used for defconfig, oldconfig and related targets
187# nconf: Used for the nconfig target.
188# Utilizes ncurses
189# mconf: Used for the menuconfig target
190# Utilizes the lxdialog package
191# qconf: Used for the xconfig target
192# Based on Qt which needs to be installed to compile it
193# gconf: Used for the gconfig target
194# Based on GTK+ which needs to be installed to compile it
195# object files used by all kconfig flavours
196
197lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
198lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
199
200conf-objs := conf.o zconf.tab.o
201mconf-objs := mconf.o zconf.tab.o $(lxdialog)
202nconf-objs := nconf.o zconf.tab.o nconf.gui.o
203kxgettext-objs := kxgettext.o zconf.tab.o
191# gconf: Used for the gconfig target
192# Based on GTK+ which needs to be installed to compile it
193# object files used by all kconfig flavours
194
195lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
196lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
197
198conf-objs := conf.o zconf.tab.o
199mconf-objs := mconf.o zconf.tab.o $(lxdialog)
200nconf-objs := nconf.o zconf.tab.o nconf.gui.o
201kxgettext-objs := kxgettext.o zconf.tab.o
204qconf-cxxobjs := qconf.o
205qconf-objs := zconf.tab.o
206gconf-objs := gconf.o zconf.tab.o
207
202gconf-objs := gconf.o zconf.tab.o
203
208hostprogs-y := conf nconf mconf kxgettext qconf gconf
204hostprogs-y := conf nconf mconf kxgettext gconf
209
210targets += zconf.lex.c
205
206targets += zconf.lex.c
211clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck
207clean-files := .tmp_gtkcheck
212clean-files += gconf.glade.h
213clean-files += config.pot linux.pot
214
215# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
216PHONY += $(obj)/dochecklxdialog
217$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/dochecklxdialog
218$(obj)/dochecklxdialog:
219 $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
220
221always := dochecklxdialog
222
223# Add environment specific flags
224HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
225HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS))
226
227# generated files seem to need this to find local include files
228HOSTCFLAGS_zconf.lex.o := -I$(src)
229HOSTCFLAGS_zconf.tab.o := -I$(src)
230
208clean-files += gconf.glade.h
209clean-files += config.pot linux.pot
210
211# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
212PHONY += $(obj)/dochecklxdialog
213$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/dochecklxdialog
214$(obj)/dochecklxdialog:
215 $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
216
217always := dochecklxdialog
218
219# Add environment specific flags
220HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
221HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS))
222
223# generated files seem to need this to find local include files
224HOSTCFLAGS_zconf.lex.o := -I$(src)
225HOSTCFLAGS_zconf.tab.o := -I$(src)
226
231HOSTLOADLIBES_qconf = $(KC_QT_LIBS)
232HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS)
233
234HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
235HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
236 -Wno-missing-prototypes
237
238HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
239
240HOSTLOADLIBES_nconf = $(shell \
241 pkg-config --libs menuw panelw ncursesw 2>/dev/null \
242 || pkg-config --libs menu panel ncurses 2>/dev/null \
243 || echo "-lmenu -lpanel -lncurses" )
227HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
228HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
229 -Wno-missing-prototypes
230
231HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
232
233HOSTLOADLIBES_nconf = $(shell \
234 pkg-config --libs menuw panelw ncursesw 2>/dev/null \
235 || pkg-config --libs menu panel ncurses 2>/dev/null \
236 || echo "-lmenu -lpanel -lncurses" )
244$(obj)/qconf.o: $(obj)/.tmp_qtcheck
245
237
246ifeq ($(MAKECMDGOALS),xconfig)
247$(obj)/.tmp_qtcheck: $(src)/Makefile
248-include $(obj)/.tmp_qtcheck
238# qconf: Used for the xconfig target based on Qt
239hostprogs-y += qconf
240qconf-cxxobjs := qconf.o
241qconf-objs := zconf.tab.o
249
242
250# Qt needs some extra effort...
251$(obj)/.tmp_qtcheck:
252 @set -e; $(kecho) " CHECK qt"; \
253 if pkg-config --exists Qt5Core; then \
254 cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \
255 libs=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \
256 moc=`pkg-config --variable=host_bins Qt5Core`/moc; \
257 elif pkg-config --exists QtCore; then \
258 cflags=`pkg-config --cflags QtCore QtGui`; \
259 libs=`pkg-config --libs QtCore QtGui`; \
260 moc=`pkg-config --variable=moc_location QtCore`; \
261 else \
262 echo >&2 "*"; \
263 echo >&2 "* Could not find Qt via pkg-config."; \
264 echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \
265 echo >&2 "*"; \
266 exit 1; \
267 fi; \
268 echo "KC_QT_CFLAGS=$$cflags" > $@; \
269 echo "KC_QT_LIBS=$$libs" >> $@; \
270 echo "KC_QT_MOC=$$moc" >> $@
271endif
243HOSTLOADLIBES_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs)
244HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags)
272
245
246$(obj)/qconf.o: $(obj)/.qconf-cfg $(obj)/qconf.moc
247
248quiet_cmd_moc = MOC $@
249 cmd_moc = $(shell . $(obj)/.qconf-cfg && echo $$moc) -i $< -o $@
250
251$(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg
252 $(call cmd,moc)
253
273$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
274
275ifeq ($(MAKECMDGOALS),gconfig)
276-include $(obj)/.tmp_gtkcheck
277
278# GTK+ needs some extra effort, too...
279$(obj)/.tmp_gtkcheck:
280 @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \

--- 12 unchanged lines hidden (view full) ---

293 echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
294 echo >&2 "*"; \
295 false; \
296 fi
297endif
298
299$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
300
254$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
255
256ifeq ($(MAKECMDGOALS),gconfig)
257-include $(obj)/.tmp_gtkcheck
258
259# GTK+ needs some extra effort, too...
260$(obj)/.tmp_gtkcheck:
261 @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \

--- 12 unchanged lines hidden (view full) ---

274 echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
275 echo >&2 "*"; \
276 false; \
277 fi
278endif
279
280$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
281
301$(obj)/qconf.o: $(obj)/qconf.moc
302
303quiet_cmd_moc = MOC $@
304 cmd_moc = $(KC_QT_MOC) -i $< -o $@
305
306$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
307 $(call cmd,moc)
308
309# Extract gconf menu items for i18n support
310$(obj)/gconf.glade.h: $(obj)/gconf.glade
311 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
312 $(obj)/gconf.glade
282# Extract gconf menu items for i18n support
283$(obj)/gconf.glade.h: $(obj)/gconf.glade
284 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
285 $(obj)/gconf.glade
286
287# check if necessary packages are available, and configure build flags
288define filechk_conf_cfg
289 $(CONFIG_SHELL) $<
290endef
291
292$(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE
293 $(call filechk,conf_cfg)
294
295clean-files += .*conf-cfg