xref: /openbmc/u-boot/scripts/kconfig/Makefile (revision 3eceff64)
183d290c5STom Rini# SPDX-License-Identifier: GPL-2.0
20a9064fbSMasahiro Yamada# ===========================================================================
30a9064fbSMasahiro Yamada# Kernel configuration targets
40a9064fbSMasahiro Yamada# These targets are used from top-level makefile
50a9064fbSMasahiro Yamada
6*e91610daSEugeniu RoscaPHONY += xconfig gconfig menuconfig config syncconfig update-po-config \
70a9064fbSMasahiro Yamada	localmodconfig localyesconfig
80a9064fbSMasahiro Yamada
95f9eb220SMasahiro Yamada# Added for U-Boot
105f9eb220SMasahiro Yamada#  Linux has defconfig files in arch/$(SRCARCH)/configs/,
115f9eb220SMasahiro Yamada#  on the other hand, U-Boot does in configs/.
125f9eb220SMasahiro Yamada#  Set SRCARCH to .. fake this Makefile.
135f9eb220SMasahiro YamadaSRCARCH := ..
145f9eb220SMasahiro Yamada
150a9064fbSMasahiro Yamadaifdef KBUILD_KCONFIG
160a9064fbSMasahiro YamadaKconfig := $(KBUILD_KCONFIG)
170a9064fbSMasahiro Yamadaelse
180a9064fbSMasahiro YamadaKconfig := Kconfig
190a9064fbSMasahiro Yamadaendif
200a9064fbSMasahiro Yamada
219b5f0b1dSMasahiro Yamadaifeq ($(quiet),silent_)
229b5f0b1dSMasahiro Yamadasilent := -s
239b5f0b1dSMasahiro Yamadaendif
249b5f0b1dSMasahiro Yamada
250a9064fbSMasahiro Yamada# We need this, in case the user has it in its environment
260a9064fbSMasahiro Yamadaunexport CONFIG_
270a9064fbSMasahiro Yamada
280a9064fbSMasahiro Yamadaxconfig: $(obj)/qconf
299b5f0b1dSMasahiro Yamada	$< $(silent) $(Kconfig)
300a9064fbSMasahiro Yamada
310a9064fbSMasahiro Yamadagconfig: $(obj)/gconf
329b5f0b1dSMasahiro Yamada	$< $(silent) $(Kconfig)
330a9064fbSMasahiro Yamada
340a9064fbSMasahiro Yamadamenuconfig: $(obj)/mconf
359b5f0b1dSMasahiro Yamada	$< $(silent) $(Kconfig)
360a9064fbSMasahiro Yamada
370a9064fbSMasahiro Yamadaconfig: $(obj)/conf
389b5f0b1dSMasahiro Yamada	$< $(silent) --oldaskconfig $(Kconfig)
390a9064fbSMasahiro Yamada
400a9064fbSMasahiro Yamadanconfig: $(obj)/nconf
419b5f0b1dSMasahiro Yamada	$< $(silent) $(Kconfig)
420a9064fbSMasahiro Yamada
43*e91610daSEugeniu Rosca# This has become an internal implementation detail and is now deprecated
44*e91610daSEugeniu Rosca# for external use.
45*e91610daSEugeniu Roscasyncconfig: $(obj)/conf
460a9064fbSMasahiro Yamada	$(Q)mkdir -p include/config include/generated
479b5f0b1dSMasahiro Yamada	$< $(silent) --$@ $(Kconfig)
480a9064fbSMasahiro Yamada
49*e91610daSEugeniu Roscalocalyesconfig localmodconfig: $(obj)/conf
500a9064fbSMasahiro Yamada	$(Q)mkdir -p include/config include/generated
51*e91610daSEugeniu Rosca	$(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config
520a9064fbSMasahiro Yamada	$(Q)if [ -f .config ]; then 					\
530a9064fbSMasahiro Yamada			cmp -s .tmp.config .config ||			\
540a9064fbSMasahiro Yamada			(mv -f .config .config.old.1;			\
550a9064fbSMasahiro Yamada			 mv -f .tmp.config .config;			\
56*e91610daSEugeniu Rosca			 $< $(silent) --oldconfig $(Kconfig);		\
570a9064fbSMasahiro Yamada			 mv -f .config.old.1 .config.old)		\
580a9064fbSMasahiro Yamada	else								\
590a9064fbSMasahiro Yamada			mv -f .tmp.config .config;			\
60*e91610daSEugeniu Rosca			$< $(silent) --oldconfig $(Kconfig);		\
610a9064fbSMasahiro Yamada	fi
620a9064fbSMasahiro Yamada	$(Q)rm -f .tmp.config
630a9064fbSMasahiro Yamada
640a9064fbSMasahiro Yamada# Create new linux.pot file
650a9064fbSMasahiro Yamada# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
660a9064fbSMasahiro Yamadaupdate-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
679b5f0b1dSMasahiro Yamada	$(Q)$(kecho) "  GEN     config.pot"
680a9064fbSMasahiro Yamada	$(Q)xgettext --default-domain=linux                         \
690a9064fbSMasahiro Yamada	    --add-comments --keyword=_ --keyword=N_                 \
700a9064fbSMasahiro Yamada	    --from-code=UTF-8                                       \
710a9064fbSMasahiro Yamada	    --files-from=$(srctree)/scripts/kconfig/POTFILES.in     \
720a9064fbSMasahiro Yamada	    --directory=$(srctree) --directory=$(objtree)           \
730a9064fbSMasahiro Yamada	    --output $(obj)/config.pot
740a9064fbSMasahiro Yamada	$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
750a9064fbSMasahiro Yamada	$(Q)(for i in `ls $(srctree)/arch/*/Kconfig      \
760a9064fbSMasahiro Yamada	    $(srctree)/arch/*/um/Kconfig`;               \
770a9064fbSMasahiro Yamada	    do                                           \
789b5f0b1dSMasahiro Yamada		$(kecho) "  GEN     $$i";                    \
790a9064fbSMasahiro Yamada		$(obj)/kxgettext $$i                     \
800a9064fbSMasahiro Yamada		     >> $(obj)/config.pot;               \
810a9064fbSMasahiro Yamada	    done )
829b5f0b1dSMasahiro Yamada	$(Q)$(kecho) "  GEN     linux.pot"
830a9064fbSMasahiro Yamada	$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
840a9064fbSMasahiro Yamada	    --output $(obj)/linux.pot
850a9064fbSMasahiro Yamada	$(Q)rm -f $(obj)/config.pot
860a9064fbSMasahiro Yamada
879b5f0b1dSMasahiro Yamada# These targets map 1:1 to the commandline options of 'conf'
889b5f0b1dSMasahiro Yamadasimple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
899b5f0b1dSMasahiro Yamada	alldefconfig randconfig listnewconfig olddefconfig
909b5f0b1dSMasahiro YamadaPHONY += $(simple-targets)
910a9064fbSMasahiro Yamada
929b5f0b1dSMasahiro Yamada$(simple-targets): $(obj)/conf
939b5f0b1dSMasahiro Yamada	$< $(silent) --$@ $(Kconfig)
940a9064fbSMasahiro Yamada
95*e91610daSEugeniu RoscaPHONY += oldnoconfig silentoldconfig savedefconfig defconfig
960a9064fbSMasahiro Yamada
970a9064fbSMasahiro Yamada# oldnoconfig is an alias of olddefconfig, because people already are dependent
980a9064fbSMasahiro Yamada# on its behavior (sets new symbols to their default value but not 'n') with the
990a9064fbSMasahiro Yamada# counter-intuitive name.
1009b5f0b1dSMasahiro Yamadaoldnoconfig: olddefconfig
101*e91610daSEugeniu Rosca	@echo "  WARNING: \"oldnoconfig\" target will be removed after Linux 4.19"
102*e91610daSEugeniu Rosca	@echo "            Please use \"olddefconfig\" instead, which is an alias."
103*e91610daSEugeniu Rosca
104*e91610daSEugeniu Rosca# We do not expect manual invokcation of "silentoldcofig" (or "syncconfig").
105*e91610daSEugeniu Roscasilentoldconfig: syncconfig
106*e91610daSEugeniu Rosca	@echo "  WARNING: \"silentoldconfig\" has been renamed to \"syncconfig\""
107*e91610daSEugeniu Rosca	@echo "            and is now an internal implementation detail."
108*e91610daSEugeniu Rosca	@echo "            What you want is probably \"oldconfig\"."
109*e91610daSEugeniu Rosca	@echo "            \"silentoldconfig\" will be removed after Linux 4.19"
1100a9064fbSMasahiro Yamada
1110a9064fbSMasahiro Yamadasavedefconfig: $(obj)/conf
1129b5f0b1dSMasahiro Yamada	$< $(silent) --$@=defconfig $(Kconfig)
1130a9064fbSMasahiro Yamada
1140a9064fbSMasahiro Yamadadefconfig: $(obj)/conf
1150a9064fbSMasahiro Yamadaifeq ($(KBUILD_DEFCONFIG),)
1169b5f0b1dSMasahiro Yamada	$< $(silent) --defconfig $(Kconfig)
1170a9064fbSMasahiro Yamadaelse
118bf7ab1e7SMasahiro Yamadaifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),)
1199b5f0b1dSMasahiro Yamada	@$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
1209b5f0b1dSMasahiro Yamada	$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
121bf7ab1e7SMasahiro Yamadaelse
122bf7ab1e7SMasahiro Yamada	@$(kecho) "*** Default configuration is based on target '$(KBUILD_DEFCONFIG)'"
123bf7ab1e7SMasahiro Yamada	$(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG)
124bf7ab1e7SMasahiro Yamadaendif
1250a9064fbSMasahiro Yamadaendif
1260a9064fbSMasahiro Yamada
1270a9064fbSMasahiro Yamada%_defconfig: $(obj)/conf
1289b5f0b1dSMasahiro Yamada	$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
1290a9064fbSMasahiro Yamada
1305f9eb220SMasahiro Yamada# Added for U-Boot (backward compatibility)
1315f9eb220SMasahiro Yamada%_config: %_defconfig
1325f9eb220SMasahiro Yamada	@:
1335f9eb220SMasahiro Yamada
1349b5f0b1dSMasahiro Yamadaconfigfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)
135ad618992SMasahiro Yamada
1369b5f0b1dSMasahiro Yamada%.config: $(obj)/conf
1379b5f0b1dSMasahiro Yamada	$(if $(call configfiles),, $(error No configuration exists for this target on this architecture))
1389b5f0b1dSMasahiro Yamada	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles)
1399b5f0b1dSMasahiro Yamada	+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
140ad618992SMasahiro Yamada
141ad618992SMasahiro YamadaPHONY += kvmconfig
1429b5f0b1dSMasahiro Yamadakvmconfig: kvm_guest.config
1439b5f0b1dSMasahiro Yamada	@:
144ad618992SMasahiro Yamada
145bf7ab1e7SMasahiro YamadaPHONY += xenconfig
146bf7ab1e7SMasahiro Yamadaxenconfig: xen.config
147bf7ab1e7SMasahiro Yamada	@:
148bf7ab1e7SMasahiro Yamada
149ad618992SMasahiro YamadaPHONY += tinyconfig
1509b5f0b1dSMasahiro Yamadatinyconfig:
1519b5f0b1dSMasahiro Yamada	$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
152ad618992SMasahiro Yamada
153*e91610daSEugeniu Rosca# CHECK: -o cache_dir=<path> working?
154*e91610daSEugeniu RoscaPHONY += testconfig
155*e91610daSEugeniu Roscatestconfig: $(obj)/conf
156*e91610daSEugeniu Rosca	$(PYTHON3) -B -m pytest $(srctree)/$(src)/tests \
157*e91610daSEugeniu Rosca	-o cache_dir=$(abspath $(obj)/tests/.cache) \
158*e91610daSEugeniu Rosca	$(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)
159*e91610daSEugeniu Roscaclean-dirs += tests/.cache
160*e91610daSEugeniu Rosca
1610a9064fbSMasahiro Yamada# Help text used by make help
1620a9064fbSMasahiro Yamadahelp:
1630a9064fbSMasahiro Yamada	@echo  '  config	  - Update current config utilising a line-oriented program'
164bf7ab1e7SMasahiro Yamada	@echo  '  nconfig         - Update current config utilising a ncurses menu based'
165bf7ab1e7SMasahiro Yamada	@echo  '                    program'
1660a9064fbSMasahiro Yamada	@echo  '  menuconfig	  - Update current config utilising a menu based program'
167bf7ab1e7SMasahiro Yamada	@echo  '  xconfig	  - Update current config utilising a Qt based front-end'
168bf7ab1e7SMasahiro Yamada	@echo  '  gconfig	  - Update current config utilising a GTK+ based front-end'
1690a9064fbSMasahiro Yamada	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
1700a9064fbSMasahiro Yamada	@echo  '  localmodconfig  - Update current config disabling modules not loaded'
1710a9064fbSMasahiro Yamada	@echo  '  localyesconfig  - Update current config converting local mods to core'
1720a9064fbSMasahiro Yamada	@echo  '  defconfig	  - New config with default from ARCH supplied defconfig'
1730a9064fbSMasahiro Yamada	@echo  '  savedefconfig   - Save current config as ./defconfig (minimal config)'
1740a9064fbSMasahiro Yamada	@echo  '  allnoconfig	  - New config where all options are answered with no'
1750a9064fbSMasahiro Yamada	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
1760a9064fbSMasahiro Yamada	@echo  '  allmodconfig	  - New config selecting modules when possible'
1770a9064fbSMasahiro Yamada	@echo  '  alldefconfig    - New config with all symbols set to default'
1780a9064fbSMasahiro Yamada	@echo  '  randconfig	  - New config with random answer to all options'
1790a9064fbSMasahiro Yamada	@echo  '  listnewconfig   - List new options'
180*e91610daSEugeniu Rosca	@echo  '  olddefconfig	  - Same as oldconfig but sets new symbols to their'
181*e91610daSEugeniu Rosca	@echo  '                    default value without prompting'
182bf7ab1e7SMasahiro Yamada#	@echo  '  kvmconfig	  - Enable additional options for kvm guest kernel support'
183bf7ab1e7SMasahiro Yamada#	@echo  '  xenconfig       - Enable additional options for xen dom0 and guest kernel support'
184ad618992SMasahiro Yamada#	@echo  '  tinyconfig	  - Configure the tiniest possible kernel'
1850a9064fbSMasahiro Yamada
1860a9064fbSMasahiro Yamada# lxdialog stuff
1870a9064fbSMasahiro Yamadacheck-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
1880a9064fbSMasahiro Yamada
1890a9064fbSMasahiro Yamada# Use recursively expanded variables so we do not call gcc unless
1900a9064fbSMasahiro Yamada# we really need to do so. (Do not call gcc as part of make mrproper)
1910a9064fbSMasahiro YamadaHOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \
1920a9064fbSMasahiro Yamada                    -DLOCALE
1930a9064fbSMasahiro Yamada
1940a9064fbSMasahiro Yamada# ===========================================================================
1950a9064fbSMasahiro Yamada# Shared Makefile for the various kconfig executables:
1960a9064fbSMasahiro Yamada# conf:	  Used for defconfig, oldconfig and related targets
1970a9064fbSMasahiro Yamada# nconf:  Used for the nconfig target.
1980a9064fbSMasahiro Yamada#         Utilizes ncurses
1990a9064fbSMasahiro Yamada# mconf:  Used for the menuconfig target
2000a9064fbSMasahiro Yamada#         Utilizes the lxdialog package
2010a9064fbSMasahiro Yamada# qconf:  Used for the xconfig target
202bf7ab1e7SMasahiro Yamada#         Based on Qt which needs to be installed to compile it
2030a9064fbSMasahiro Yamada# gconf:  Used for the gconfig target
204bf7ab1e7SMasahiro Yamada#         Based on GTK+ which needs to be installed to compile it
2050a9064fbSMasahiro Yamada# object files used by all kconfig flavours
2060a9064fbSMasahiro Yamada
2070a9064fbSMasahiro Yamadalxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
2080a9064fbSMasahiro Yamadalxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
2090a9064fbSMasahiro Yamada
2100a9064fbSMasahiro Yamadaconf-objs	:= conf.o  zconf.tab.o
2110a9064fbSMasahiro Yamadamconf-objs     := mconf.o zconf.tab.o $(lxdialog)
2120a9064fbSMasahiro Yamadanconf-objs     := nconf.o zconf.tab.o nconf.gui.o
2130a9064fbSMasahiro Yamadakxgettext-objs	:= kxgettext.o zconf.tab.o
2140a9064fbSMasahiro Yamadaqconf-cxxobjs	:= qconf.o
2150a9064fbSMasahiro Yamadaqconf-objs	:= zconf.tab.o
2160a9064fbSMasahiro Yamadagconf-objs	:= gconf.o zconf.tab.o
2170a9064fbSMasahiro Yamada
218cb6e7b0dSMasahiro Yamadahostprogs-y := conf nconf mconf kxgettext qconf gconf
2190a9064fbSMasahiro Yamada
220*e91610daSEugeniu Roscatargets		+= zconf.lex.c
2210a9064fbSMasahiro Yamadaclean-files	:= qconf.moc .tmp_qtcheck .tmp_gtkcheck
222*e91610daSEugeniu Roscaclean-files	+= gconf.glade.h
2230a9064fbSMasahiro Yamadaclean-files     += config.pot linux.pot
2240a9064fbSMasahiro Yamada
2250a9064fbSMasahiro Yamada# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
2260a9064fbSMasahiro YamadaPHONY += $(obj)/dochecklxdialog
227*e91610daSEugeniu Rosca$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/dochecklxdialog
2280a9064fbSMasahiro Yamada$(obj)/dochecklxdialog:
2290a9064fbSMasahiro Yamada	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
2300a9064fbSMasahiro Yamada
2310a9064fbSMasahiro Yamadaalways := dochecklxdialog
2320a9064fbSMasahiro Yamada
2330a9064fbSMasahiro Yamada# Add environment specific flags
2340a9064fbSMasahiro YamadaHOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
235*e91610daSEugeniu RoscaHOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS))
2360a9064fbSMasahiro Yamada
2370a9064fbSMasahiro Yamada# generated files seem to need this to find local include files
2380a9064fbSMasahiro YamadaHOSTCFLAGS_zconf.lex.o	:= -I$(src)
2390a9064fbSMasahiro YamadaHOSTCFLAGS_zconf.tab.o	:= -I$(src)
2400a9064fbSMasahiro Yamada
2410a9064fbSMasahiro YamadaHOSTLOADLIBES_qconf	= $(KC_QT_LIBS)
2420a9064fbSMasahiro YamadaHOSTCXXFLAGS_qconf.o	= $(KC_QT_CFLAGS)
2430a9064fbSMasahiro Yamada
2440a9064fbSMasahiro YamadaHOSTLOADLIBES_gconf	= `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
2450a9064fbSMasahiro YamadaHOSTCFLAGS_gconf.o	= `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
2460a9064fbSMasahiro Yamada                          -Wno-missing-prototypes
2470a9064fbSMasahiro Yamada
2480a9064fbSMasahiro YamadaHOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
2490a9064fbSMasahiro Yamada
2500a9064fbSMasahiro YamadaHOSTLOADLIBES_nconf	= $(shell \
251ad618992SMasahiro Yamada				pkg-config --libs menuw panelw ncursesw 2>/dev/null \
252ad618992SMasahiro Yamada				|| pkg-config --libs menu panel ncurses 2>/dev/null \
2530a9064fbSMasahiro Yamada				|| echo "-lmenu -lpanel -lncurses"  )
2540a9064fbSMasahiro Yamada$(obj)/qconf.o: $(obj)/.tmp_qtcheck
2550a9064fbSMasahiro Yamada
256cb6e7b0dSMasahiro Yamadaifeq ($(MAKECMDGOALS),xconfig)
2570a9064fbSMasahiro Yamada$(obj)/.tmp_qtcheck: $(src)/Makefile
2580a9064fbSMasahiro Yamada-include $(obj)/.tmp_qtcheck
2590a9064fbSMasahiro Yamada
260bf7ab1e7SMasahiro Yamada# Qt needs some extra effort...
2610a9064fbSMasahiro Yamada$(obj)/.tmp_qtcheck:
262bf7ab1e7SMasahiro Yamada	@set -e; $(kecho) "  CHECK   qt"; \
263bf7ab1e7SMasahiro Yamada	if pkg-config --exists Qt5Core; then \
264bf7ab1e7SMasahiro Yamada	    cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \
265bf7ab1e7SMasahiro Yamada	    libs=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \
266bf7ab1e7SMasahiro Yamada	    moc=`pkg-config --variable=host_bins Qt5Core`/moc; \
267bf7ab1e7SMasahiro Yamada	elif pkg-config --exists QtCore; then \
268bf7ab1e7SMasahiro Yamada	    cflags=`pkg-config --cflags QtCore QtGui`; \
269bf7ab1e7SMasahiro Yamada	    libs=`pkg-config --libs QtCore QtGui`; \
270bf7ab1e7SMasahiro Yamada	    moc=`pkg-config --variable=moc_location QtCore`; \
2710a9064fbSMasahiro Yamada	else \
2720a9064fbSMasahiro Yamada	    echo >&2 "*"; \
273bf7ab1e7SMasahiro Yamada	    echo >&2 "* Could not find Qt via pkg-config."; \
274bf7ab1e7SMasahiro Yamada	    echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \
2750a9064fbSMasahiro Yamada	    echo >&2 "*"; \
276bf7ab1e7SMasahiro Yamada	    exit 1; \
2770a9064fbSMasahiro Yamada	fi; \
2780a9064fbSMasahiro Yamada	echo "KC_QT_CFLAGS=$$cflags" > $@; \
2790a9064fbSMasahiro Yamada	echo "KC_QT_LIBS=$$libs" >> $@; \
2800a9064fbSMasahiro Yamada	echo "KC_QT_MOC=$$moc" >> $@
2810a9064fbSMasahiro Yamadaendif
2820a9064fbSMasahiro Yamada
2830a9064fbSMasahiro Yamada$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
2840a9064fbSMasahiro Yamada
285cb6e7b0dSMasahiro Yamadaifeq ($(MAKECMDGOALS),gconfig)
2860a9064fbSMasahiro Yamada-include $(obj)/.tmp_gtkcheck
2870a9064fbSMasahiro Yamada
288bf7ab1e7SMasahiro Yamada# GTK+ needs some extra effort, too...
2890a9064fbSMasahiro Yamada$(obj)/.tmp_gtkcheck:
2900a9064fbSMasahiro Yamada	@if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then		\
2910a9064fbSMasahiro Yamada		if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then			\
2920a9064fbSMasahiro Yamada			touch $@;								\
2930a9064fbSMasahiro Yamada		else									\
2940a9064fbSMasahiro Yamada			echo >&2 "*"; 							\
2950a9064fbSMasahiro Yamada			echo >&2 "* GTK+ is present but version >= 2.0.0 is required.";	\
2960a9064fbSMasahiro Yamada			echo >&2 "*";							\
2970a9064fbSMasahiro Yamada			false;								\
2980a9064fbSMasahiro Yamada		fi									\
2990a9064fbSMasahiro Yamada	else										\
3000a9064fbSMasahiro Yamada		echo >&2 "*"; 								\
3010a9064fbSMasahiro Yamada		echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; 	\
3020a9064fbSMasahiro Yamada		echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; 	\
3030a9064fbSMasahiro Yamada		echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; 		\
3040a9064fbSMasahiro Yamada		echo >&2 "*"; 								\
3050a9064fbSMasahiro Yamada		false;									\
3060a9064fbSMasahiro Yamada	fi
3070a9064fbSMasahiro Yamadaendif
3080a9064fbSMasahiro Yamada
309*e91610daSEugeniu Rosca$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
3100a9064fbSMasahiro Yamada
3110a9064fbSMasahiro Yamada$(obj)/qconf.o: $(obj)/qconf.moc
3120a9064fbSMasahiro Yamada
3130a9064fbSMasahiro Yamadaquiet_cmd_moc = MOC     $@
3140a9064fbSMasahiro Yamada      cmd_moc = $(KC_QT_MOC) -i $< -o $@
3150a9064fbSMasahiro Yamada
3160a9064fbSMasahiro Yamada$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
3170a9064fbSMasahiro Yamada	$(call cmd,moc)
3180a9064fbSMasahiro Yamada
319bf7ab1e7SMasahiro Yamada# Extract gconf menu items for i18n support
3200a9064fbSMasahiro Yamada$(obj)/gconf.glade.h: $(obj)/gconf.glade
3210a9064fbSMasahiro Yamada	$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
3220a9064fbSMasahiro Yamada	$(obj)/gconf.glade
323