xref: /linux/scripts/kconfig/Makefile (revision 0da1d4a0b9516adb2acc4841e9f6da6618f47f4e)
11da177e4SLinus Torvalds# ===========================================================================
21da177e4SLinus Torvalds# Kernel configuration targets
31da177e4SLinus Torvalds# These targets are used from top-level makefile
41da177e4SLinus Torvalds
503fa25daSSteven RostedtPHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \
6281c9dadSSteven Rostedt	localmodconfig localyesconfig
71da177e4SLinus Torvalds
861bee204SAl Viroifdef KBUILD_KCONFIG
961bee204SAl ViroKconfig := $(KBUILD_KCONFIG)
1061bee204SAl Viroelse
11838a2e55SArnaud LacombeKconfig := Kconfig
1261bee204SAl Viroendif
13e703f75dSSam Ravnborg
14c2838e6eSYann E. MORIN# We need this, in case the user has it in its environment
15c2838e6eSYann E. MORINunexport CONFIG_
16c2838e6eSYann E. MORIN
171da177e4SLinus Torvaldsxconfig: $(obj)/qconf
18e703f75dSSam Ravnborg	$< $(Kconfig)
191da177e4SLinus Torvalds
201da177e4SLinus Torvaldsgconfig: $(obj)/gconf
21e703f75dSSam Ravnborg	$< $(Kconfig)
221da177e4SLinus Torvalds
231da177e4SLinus Torvaldsmenuconfig: $(obj)/mconf
24e703f75dSSam Ravnborg	$< $(Kconfig)
251da177e4SLinus Torvalds
261da177e4SLinus Torvaldsconfig: $(obj)/conf
274062f1a4SSam Ravnborg	$< --oldaskconfig $(Kconfig)
281da177e4SLinus Torvalds
29692d97c3Snir.tzachar@gmail.comnconfig: $(obj)/nconf
30692d97c3Snir.tzachar@gmail.com	$< $(Kconfig)
31692d97c3Snir.tzachar@gmail.com
321da177e4SLinus Torvaldsoldconfig: $(obj)/conf
334062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
341da177e4SLinus Torvalds
351da177e4SLinus Torvaldssilentoldconfig: $(obj)/conf
369815594aSMasahiro Yamada	$(Q)mkdir -p include/config include/generated
374062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
381da177e4SLinus Torvalds
3950bce3e8SArnaud Lacombelocalyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
409815594aSMasahiro Yamada	$(Q)mkdir -p include/config include/generated
4122d550aeSArnaud Lacombe	$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
42a7c02602SSteven Rostedt	$(Q)if [ -f .config ]; then 					\
43a7c02602SSteven Rostedt			cmp -s .tmp.config .config ||			\
4403fa25daSSteven Rostedt			(mv -f .config .config.old.1;			\
4503fa25daSSteven Rostedt			 mv -f .tmp.config .config;			\
464062f1a4SSam Ravnborg			 $(obj)/conf --silentoldconfig $(Kconfig);	\
47a7c02602SSteven Rostedt			 mv -f .config.old.1 .config.old)		\
48a7c02602SSteven Rostedt	else								\
49a7c02602SSteven Rostedt			mv -f .tmp.config .config;			\
504062f1a4SSam Ravnborg			$(obj)/conf --silentoldconfig $(Kconfig);	\
51a7c02602SSteven Rostedt	fi
5203fa25daSSteven Rostedt	$(Q)rm -f .tmp.config
5303fa25daSSteven Rostedt
541020026fSEGRY Gabor# Create new linux.pot file
55b70e325cSSam Ravnborg# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
5646d26319SEGRY Gaborupdate-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
57e2aef4d3SPeter Foley	$(Q)echo "  GEN     config.pot"
581020026fSEGRY Gabor	$(Q)xgettext --default-domain=linux                         \
593b9fa093SArnaldo Carvalho de Melo	    --add-comments --keyword=_ --keyword=N_                 \
60b70e325cSSam Ravnborg	    --from-code=UTF-8                                       \
61a24a1b8eSPeter Foley	    --files-from=$(srctree)/scripts/kconfig/POTFILES.in     \
62a24a1b8eSPeter Foley	    --directory=$(srctree) --directory=$(objtree)           \
63b70e325cSSam Ravnborg	    --output $(obj)/config.pot
64b70e325cSSam Ravnborg	$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
65fa0ad657SPaul Bolle	$(Q)(for i in `ls $(srctree)/arch/*/Kconfig      \
66fa0ad657SPaul Bolle	    $(srctree)/arch/*/um/Kconfig`;               \
67720d6c29SEgry Gabor	    do                                           \
681020026fSEGRY Gabor		echo "  GEN     $$i";                    \
694217516eSSam Ravnborg		$(obj)/kxgettext $$i                     \
701020026fSEGRY Gabor		     >> $(obj)/config.pot;               \
711020026fSEGRY Gabor	    done )
72e2aef4d3SPeter Foley	$(Q)echo "  GEN     linux.pot"
731020026fSEGRY Gabor	$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
74b70e325cSSam Ravnborg	    --output $(obj)/linux.pot
75b70e325cSSam Ravnborg	$(Q)rm -f $(obj)/config.pot
763b9fa093SArnaldo Carvalho de Melo
770748cb3eSSam RavnborgPHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
781da177e4SLinus Torvalds
790748cb3eSSam Ravnborgallnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
804062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
811da177e4SLinus Torvalds
82fb16d891SAdam LeePHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig
831da177e4SLinus Torvalds
84fb16d891SAdam Leelistnewconfig olddefconfig: $(obj)/conf
854062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
861da177e4SLinus Torvalds
87fb16d891SAdam Lee# oldnoconfig is an alias of olddefconfig, because people already are dependent
88fb16d891SAdam Lee# on its behavior(sets new symbols to their default value but not 'n') with the
89fb16d891SAdam Lee# counter-intuitive name.
90fb16d891SAdam Leeoldnoconfig: $(obj)/conf
91fb16d891SAdam Lee	$< --olddefconfig $(Kconfig)
92fb16d891SAdam Lee
937cf3d73bSSam Ravnborgsavedefconfig: $(obj)/conf
947cf3d73bSSam Ravnborg	$< --$@=defconfig $(Kconfig)
957cf3d73bSSam Ravnborg
961da177e4SLinus Torvaldsdefconfig: $(obj)/conf
971da177e4SLinus Torvaldsifeq ($(KBUILD_DEFCONFIG),)
984062f1a4SSam Ravnborg	$< --defconfig $(Kconfig)
991da177e4SLinus Torvaldselse
1002266cfd5SSam Ravnborg	@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
1014062f1a4SSam Ravnborg	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
1021da177e4SLinus Torvaldsendif
1031da177e4SLinus Torvalds
1041da177e4SLinus Torvalds%_defconfig: $(obj)/conf
1054062f1a4SSam Ravnborg	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
1061da177e4SLinus Torvalds
1073aaefce1SJosh Triplettconfigfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
1083aaefce1SJosh Triplett
1093aaefce1SJosh Triplettdefine mergeconfig
1103aaefce1SJosh Triplett$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
1113aaefce1SJosh Triplett$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
1123aaefce1SJosh Triplett$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
1133aaefce1SJosh Triplett$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
1143aaefce1SJosh Triplettendef
1153aaefce1SJosh Triplett
1163aaefce1SJosh TriplettPHONY += kvmconfig
1173aaefce1SJosh Triplettkvmconfig:
1183aaefce1SJosh Triplett	$(call mergeconfig,kvm_guest)
1193aaefce1SJosh Triplett
120*0da1d4a0SJosh TriplettPHONY += tinyconfig
121*0da1d4a0SJosh Tripletttinyconfig: allnoconfig
122*0da1d4a0SJosh Triplett	$(call mergeconfig,tiny)
123*0da1d4a0SJosh Triplett
1241da177e4SLinus Torvalds# Help text used by make help
1251da177e4SLinus Torvaldshelp:
1261da177e4SLinus Torvalds	@echo  '  config	  - Update current config utilising a line-oriented program'
127692d97c3Snir.tzachar@gmail.com	@echo  '  nconfig         - Update current config utilising a ncurses menu based program'
1281da177e4SLinus Torvalds	@echo  '  menuconfig	  - Update current config utilising a menu based program'
1291da177e4SLinus Torvalds	@echo  '  xconfig	  - Update current config utilising a QT based front-end'
1301da177e4SLinus Torvalds	@echo  '  gconfig	  - Update current config utilising a GTK based front-end'
1311da177e4SLinus Torvalds	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
13203fa25daSSteven Rostedt	@echo  '  localmodconfig  - Update current config disabling modules not loaded'
133281c9dadSSteven Rostedt	@echo  '  localyesconfig  - Update current config converting local mods to core'
134590a5857SMarkus Heidelberg	@echo  '  silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
1350748cb3eSSam Ravnborg	@echo  '  defconfig	  - New config with default from ARCH supplied defconfig'
1367cf3d73bSSam Ravnborg	@echo  '  savedefconfig   - Save current config as ./defconfig (minimal config)'
137e11f0496SJesper Juhl	@echo  '  allnoconfig	  - New config where all options are answered with no'
1380748cb3eSSam Ravnborg	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
1390748cb3eSSam Ravnborg	@echo  '  allmodconfig	  - New config selecting modules when possible'
1400748cb3eSSam Ravnborg	@echo  '  alldefconfig    - New config with all symbols set to default'
1410748cb3eSSam Ravnborg	@echo  '  randconfig	  - New config with random answer to all options'
142861b4ea4SSam Ravnborg	@echo  '  listnewconfig   - List new options'
143fb16d891SAdam Lee	@echo  '  olddefconfig	  - Same as silentoldconfig but sets new symbols to their default value'
1443aaefce1SJosh Triplett	@echo  '  kvmconfig	  - Enable additional options for guest kernel support'
145*0da1d4a0SJosh Triplett	@echo  '  tinyconfig	  - Configure the tiniest possible kernel'
1461da177e4SLinus Torvalds
1472982de69SSam Ravnborg# lxdialog stuff
1482982de69SSam Ravnborgcheck-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
1492982de69SSam Ravnborg
150e9e40e14SRob Landley# Use recursively expanded variables so we do not call gcc unless
1512982de69SSam Ravnborg# we really need to do so. (Do not call gcc as part of make mrproper)
1529ba95682SArnaud LacombeHOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \
1539ba95682SArnaud Lacombe                    -DLOCALE
1542982de69SSam Ravnborg
1551da177e4SLinus Torvalds# ===========================================================================
1561da177e4SLinus Torvalds# Shared Makefile for the various kconfig executables:
1571da177e4SLinus Torvalds# conf:	  Used for defconfig, oldconfig and related targets
158692d97c3Snir.tzachar@gmail.com# nconf:  Used for the nconfig target.
159692d97c3Snir.tzachar@gmail.com#         Utilizes ncurses
1606f26e5e4SMarkus Heidelberg# mconf:  Used for the menuconfig target
1611da177e4SLinus Torvalds#         Utilizes the lxdialog package
1621da177e4SLinus Torvalds# qconf:  Used for the xconfig target
1631da177e4SLinus Torvalds#         Based on QT which needs to be installed to compile it
1641da177e4SLinus Torvalds# gconf:  Used for the gconfig target
1651da177e4SLinus Torvalds#         Based on GTK which needs to be installed to compile it
1661da177e4SLinus Torvalds# object files used by all kconfig flavours
1671da177e4SLinus Torvalds
1682982de69SSam Ravnborglxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
1692982de69SSam Ravnborglxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
1702982de69SSam Ravnborg
1711da177e4SLinus Torvaldsconf-objs	:= conf.o  zconf.tab.o
1722982de69SSam Ravnborgmconf-objs     := mconf.o zconf.tab.o $(lxdialog)
173692d97c3Snir.tzachar@gmail.comnconf-objs     := nconf.o zconf.tab.o nconf.gui.o
1743b9fa093SArnaldo Carvalho de Melokxgettext-objs	:= kxgettext.o zconf.tab.o
175f1943049SPeter Foleyqconf-cxxobjs	:= qconf.o
1765a6f8d2bSArnaud Lacombeqconf-objs	:= zconf.tab.o
1775a6f8d2bSArnaud Lacombegconf-objs	:= gconf.o zconf.tab.o
1781da177e4SLinus Torvalds
179d02ab886SPeter Foleyhostprogs-y := conf
180c29121b7SSam Ravnborg
181692d97c3Snir.tzachar@gmail.comifeq ($(MAKECMDGOALS),nconfig)
182692d97c3Snir.tzachar@gmail.com	hostprogs-y += nconf
183692d97c3Snir.tzachar@gmail.comendif
184692d97c3Snir.tzachar@gmail.com
185c29121b7SSam Ravnborgifeq ($(MAKECMDGOALS),menuconfig)
186c29121b7SSam Ravnborg	hostprogs-y += mconf
187c29121b7SSam Ravnborgendif
188c29121b7SSam Ravnborg
1891f594715SPeter Foleyifeq ($(MAKECMDGOALS),update-po-config)
1901f594715SPeter Foley	hostprogs-y += kxgettext
1911f594715SPeter Foleyendif
1921f594715SPeter Foley
1931da177e4SLinus Torvaldsifeq ($(MAKECMDGOALS),xconfig)
1941da177e4SLinus Torvalds	qconf-target := 1
1951da177e4SLinus Torvaldsendif
1961da177e4SLinus Torvaldsifeq ($(MAKECMDGOALS),gconfig)
1971da177e4SLinus Torvalds	gconf-target := 1
1981da177e4SLinus Torvaldsendif
1991da177e4SLinus Torvalds
2001da177e4SLinus Torvalds
2011da177e4SLinus Torvaldsifeq ($(qconf-target),1)
202f1943049SPeter Foley	hostprogs-y += qconf
2031da177e4SLinus Torvaldsendif
2041da177e4SLinus Torvalds
2051da177e4SLinus Torvaldsifeq ($(gconf-target),1)
206d02ab886SPeter Foley	hostprogs-y += gconf
2071da177e4SLinus Torvaldsendif
2081da177e4SLinus Torvalds
2095a6f8d2bSArnaud Lacombeclean-files	:= qconf.moc .tmp_qtcheck .tmp_gtkcheck
2102f76b358SArnaud Lacombeclean-files	+= zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
211692d97c3Snir.tzachar@gmail.comclean-files     += mconf qconf gconf nconf
2121020026fSEGRY Gaborclean-files     += config.pot linux.pot
2131da177e4SLinus Torvalds
2146e588f6dSSam Ravnborg# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
2156e588f6dSSam RavnborgPHONY += $(obj)/dochecklxdialog
2166e588f6dSSam Ravnborg$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
2176e588f6dSSam Ravnborg$(obj)/dochecklxdialog:
2187080e47bSArnaud Lacombe	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
2196e588f6dSSam Ravnborg
2206e588f6dSSam Ravnborgalways := dochecklxdialog
2216e588f6dSSam Ravnborg
222aa1e5ef5SSam Ravnborg# Add environment specific flags
223aa1e5ef5SSam RavnborgHOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
22470a6a0cbSYuri Vasilevski
2251da177e4SLinus Torvalds# generated files seem to need this to find local include files
2262f76b358SArnaud LacombeHOSTCFLAGS_zconf.lex.o	:= -I$(src)
2271da177e4SLinus TorvaldsHOSTCFLAGS_zconf.tab.o	:= -I$(src)
2281da177e4SLinus Torvalds
229378dbb2cSArnaud LacombeLEX_PREFIX_zconf	:= zconf
230378dbb2cSArnaud LacombeYACC_PREFIX_zconf	:= zconf
231378dbb2cSArnaud Lacombe
2325a6f8d2bSArnaud LacombeHOSTLOADLIBES_qconf	= $(KC_QT_LIBS)
2335a6f8d2bSArnaud LacombeHOSTCXXFLAGS_qconf.o	= $(KC_QT_CFLAGS)
2341da177e4SLinus Torvalds
2355a6f8d2bSArnaud LacombeHOSTLOADLIBES_gconf	= `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
23637193147SAdrian BunkHOSTCFLAGS_gconf.o	= `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
2371ea3ad4eSArnaud Lacombe                          -Wno-missing-prototypes
2381da177e4SLinus Torvalds
2397080e47bSArnaud LacombeHOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
2407080e47bSArnaud Lacombe
241544e7e54SJustin LecherHOSTLOADLIBES_nconf	= $(shell \
242544e7e54SJustin Lecher				pkg-config --libs menu panel ncurses 2>/dev/null \
243544e7e54SJustin Lecher				|| echo "-lmenu -lpanel -lncurses"  )
2441da177e4SLinus Torvalds$(obj)/qconf.o: $(obj)/.tmp_qtcheck
2451da177e4SLinus Torvalds
2461da177e4SLinus Torvaldsifeq ($(qconf-target),1)
247b3a5225fSRoman Zippel$(obj)/.tmp_qtcheck: $(src)/Makefile
2481da177e4SLinus Torvalds-include $(obj)/.tmp_qtcheck
2491da177e4SLinus Torvalds
2501da177e4SLinus Torvalds# QT needs some extra effort...
2511da177e4SLinus Torvalds$(obj)/.tmp_qtcheck:
252b3a5225fSRoman Zippel	@set -e; echo "  CHECK   qt"; dir=""; pkg=""; \
253133c5f7cSAlexander Stein	if ! pkg-config --exists QtCore 2> /dev/null; then \
254133c5f7cSAlexander Stein	    echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \
255b3a5225fSRoman Zippel	    pkg-config --exists qt 2> /dev/null && pkg=qt; \
256b3a5225fSRoman Zippel	    pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
257b3a5225fSRoman Zippel	    if [ -n "$$pkg" ]; then \
258b3a5225fSRoman Zippel	      cflags="\$$(shell pkg-config $$pkg --cflags)"; \
259b3a5225fSRoman Zippel	      libs="\$$(shell pkg-config $$pkg --libs)"; \
260b3a5225fSRoman Zippel	      moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \
261b3a5225fSRoman Zippel	      dir="$$(pkg-config $$pkg --variable=prefix)"; \
262b3a5225fSRoman Zippel	    else \
263b3a5225fSRoman Zippel	      for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
264b3a5225fSRoman Zippel	        if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
2651da177e4SLinus Torvalds	      done; \
266b3a5225fSRoman Zippel	      if [ -z "$$dir" ]; then \
2675b580fa6SMichal Marek	        echo >&2 "*"; \
2685b580fa6SMichal Marek	        echo >&2 "* Unable to find any QT installation. Please make sure that"; \
2695b580fa6SMichal Marek	        echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \
2705b580fa6SMichal Marek	        echo >&2 "* either qmake can be found or install pkg-config or set"; \
2715b580fa6SMichal Marek	        echo >&2 "* the QTDIR environment variable to the correct location."; \
2725b580fa6SMichal Marek	        echo >&2 "*"; \
2731da177e4SLinus Torvalds	        false; \
2741da177e4SLinus Torvalds	      fi; \
275b3a5225fSRoman Zippel	      libpath=$$dir/lib; lib=qt; osdir=""; \
2761da177e4SLinus Torvalds	      $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
277b3a5225fSRoman Zippel	        osdir=x$$($(HOSTCXX) -print-multi-os-directory); \
278b3a5225fSRoman Zippel	      test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \
279b3a5225fSRoman Zippel	      test -f $$libpath/libqt-mt.so && lib=qt-mt; \
280b3a5225fSRoman Zippel	      cflags="-I$$dir/include"; \
281b3a5225fSRoman Zippel	      libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
282b3a5225fSRoman Zippel	      moc="$$dir/bin/moc"; \
283ab919c06SSam Ravnborg	    fi; \
284b3a5225fSRoman Zippel	    if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
2851da177e4SLinus Torvalds	      echo "*"; \
286b3a5225fSRoman Zippel	      echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
2871da177e4SLinus Torvalds	      echo "*"; \
288b3a5225fSRoman Zippel	      moc="/usr/bin/moc"; \
289b3a5225fSRoman Zippel	    fi; \
290133c5f7cSAlexander Stein	else \
291458452f4SMichal Marek	  cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \
292458452f4SMichal Marek	  libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \
29348485949SYaakov Selkowitz	  moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \
29448485949SYaakov Selkowitz	  [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \
295133c5f7cSAlexander Stein	fi; \
296b3a5225fSRoman Zippel	echo "KC_QT_CFLAGS=$$cflags" > $@; \
297b3a5225fSRoman Zippel	echo "KC_QT_LIBS=$$libs" >> $@; \
298b3a5225fSRoman Zippel	echo "KC_QT_MOC=$$moc" >> $@
2991da177e4SLinus Torvaldsendif
3001da177e4SLinus Torvalds
3011da177e4SLinus Torvalds$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
3021da177e4SLinus Torvalds
3031da177e4SLinus Torvaldsifeq ($(gconf-target),1)
3041da177e4SLinus Torvalds-include $(obj)/.tmp_gtkcheck
3051da177e4SLinus Torvalds
3061da177e4SLinus Torvalds# GTK needs some extra effort, too...
3071da177e4SLinus Torvalds$(obj)/.tmp_gtkcheck:
30837193147SAdrian Bunk	@if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then		\
30937193147SAdrian Bunk		if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then			\
3101da177e4SLinus Torvalds			touch $@;								\
3111da177e4SLinus Torvalds		else									\
3125b580fa6SMichal Marek			echo >&2 "*"; 							\
3135b580fa6SMichal Marek			echo >&2 "* GTK+ is present but version >= 2.0.0 is required.";	\
3145b580fa6SMichal Marek			echo >&2 "*";							\
3151da177e4SLinus Torvalds			false;								\
3161da177e4SLinus Torvalds		fi									\
3171da177e4SLinus Torvalds	else										\
3185b580fa6SMichal Marek		echo >&2 "*"; 								\
3195b580fa6SMichal Marek		echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; 	\
3205b580fa6SMichal Marek		echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; 	\
3215b580fa6SMichal Marek		echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; 		\
3225b580fa6SMichal Marek		echo >&2 "*"; 								\
3231da177e4SLinus Torvalds		false;									\
3241da177e4SLinus Torvalds	fi
3251da177e4SLinus Torvaldsendif
3261da177e4SLinus Torvalds
3272f76b358SArnaud Lacombe$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
3281da177e4SLinus Torvalds
3295a6f8d2bSArnaud Lacombe$(obj)/qconf.o: $(obj)/qconf.moc
3301da177e4SLinus Torvalds
331ebca026aSYaakov Selkowitzquiet_cmd_moc = MOC     $@
332ebca026aSYaakov Selkowitz      cmd_moc = $(KC_QT_MOC) -i $< -o $@
333ebca026aSYaakov Selkowitz
334ebca026aSYaakov Selkowitz$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck
335ebca026aSYaakov Selkowitz	$(call cmd,moc)
3361da177e4SLinus Torvalds
33746d26319SEGRY Gabor# Extract gconf menu items for I18N support
33846d26319SEGRY Gabor$(obj)/gconf.glade.h: $(obj)/gconf.glade
3392d80eb0fSPeter Foley	$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
340a24a1b8eSPeter Foley	$(obj)/gconf.glade
341