xref: /linux/scripts/kconfig/Makefile (revision a24a1b8e2aef10e8987e0a0b2b0dcff78af90ebb)
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
141da177e4SLinus Torvaldsxconfig: $(obj)/qconf
15e703f75dSSam Ravnborg	$< $(Kconfig)
161da177e4SLinus Torvalds
171da177e4SLinus Torvaldsgconfig: $(obj)/gconf
18e703f75dSSam Ravnborg	$< $(Kconfig)
191da177e4SLinus Torvalds
201da177e4SLinus Torvaldsmenuconfig: $(obj)/mconf
21e703f75dSSam Ravnborg	$< $(Kconfig)
221da177e4SLinus Torvalds
231da177e4SLinus Torvaldsconfig: $(obj)/conf
244062f1a4SSam Ravnborg	$< --oldaskconfig $(Kconfig)
251da177e4SLinus Torvalds
26692d97c3Snir.tzachar@gmail.comnconfig: $(obj)/nconf
27692d97c3Snir.tzachar@gmail.com	$< $(Kconfig)
28692d97c3Snir.tzachar@gmail.com
291da177e4SLinus Torvaldsoldconfig: $(obj)/conf
304062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
311da177e4SLinus Torvalds
321da177e4SLinus Torvaldssilentoldconfig: $(obj)/conf
3332197c7fSMichal Marek	$(Q)mkdir -p include/generated
344062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
351da177e4SLinus Torvalds
36615f0833SSteven Rostedt# if no path is given, then use src directory to find file
37615f0833SSteven Rostedtifdef LSMOD
383cebbb81SMichal MarekLSMOD_F := $(LSMOD)
393cebbb81SMichal Marekifeq ($(findstring /,$(LSMOD)),)
403cebbb81SMichal Marek  LSMOD_F := $(objtree)/$(LSMOD)
413cebbb81SMichal Marekendif
42615f0833SSteven Rostedtendif
43615f0833SSteven Rostedt
4403fa25daSSteven Rostedtlocalmodconfig: $(obj)/streamline_config.pl $(obj)/conf
4517263bafSSteven Rostedt	$(Q)mkdir -p include/generated
46615f0833SSteven Rostedt	$(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
47a7c02602SSteven Rostedt	$(Q)if [ -f .config ]; then 					\
48a7c02602SSteven Rostedt			cmp -s .tmp.config .config ||			\
4903fa25daSSteven Rostedt			(mv -f .config .config.old.1;			\
5003fa25daSSteven Rostedt			 mv -f .tmp.config .config;			\
514062f1a4SSam Ravnborg			 $(obj)/conf --silentoldconfig $(Kconfig);	\
52a7c02602SSteven Rostedt			 mv -f .config.old.1 .config.old)		\
53a7c02602SSteven Rostedt	else								\
54a7c02602SSteven Rostedt			mv -f .tmp.config .config;			\
554062f1a4SSam Ravnborg			$(obj)/conf --silentoldconfig $(Kconfig);	\
56a7c02602SSteven Rostedt	fi
5703fa25daSSteven Rostedt	$(Q)rm -f .tmp.config
5803fa25daSSteven Rostedt
5948586218SSteven Rostedtlocalyesconfig: $(obj)/streamline_config.pl $(obj)/conf
6017263bafSSteven Rostedt	$(Q)mkdir -p include/generated
61615f0833SSteven Rostedt	$(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
62281c9dadSSteven Rostedt	$(Q)sed -i s/=m/=y/ .tmp.config
63a7c02602SSteven Rostedt	$(Q)if [ -f .config ]; then					\
64a7c02602SSteven Rostedt			cmp -s .tmp.config .config ||			\
65281c9dadSSteven Rostedt			(mv -f .config .config.old.1;			\
66281c9dadSSteven Rostedt			 mv -f .tmp.config .config;			\
674062f1a4SSam Ravnborg			 $(obj)/conf --silentoldconfig $(Kconfig);	\
68a7c02602SSteven Rostedt			 mv -f .config.old.1 .config.old)		\
69a7c02602SSteven Rostedt	else								\
70a7c02602SSteven Rostedt			mv -f .tmp.config .config;			\
714062f1a4SSam Ravnborg			$(obj)/conf --silentoldconfig $(Kconfig);	\
72a7c02602SSteven Rostedt	fi
73281c9dadSSteven Rostedt	$(Q)rm -f .tmp.config
74281c9dadSSteven Rostedt
751020026fSEGRY Gabor# Create new linux.pot file
76b70e325cSSam Ravnborg# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
77b70e325cSSam Ravnborg# The symlink is used to repair a deficiency in arch/um
7846d26319SEGRY Gaborupdate-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
791020026fSEGRY Gabor	$(Q)echo "  GEN config"
801020026fSEGRY Gabor	$(Q)xgettext --default-domain=linux                         \
813b9fa093SArnaldo Carvalho de Melo	    --add-comments --keyword=_ --keyword=N_                 \
82b70e325cSSam Ravnborg	    --from-code=UTF-8                                       \
83*a24a1b8eSPeter Foley	    --files-from=$(srctree)/scripts/kconfig/POTFILES.in     \
84*a24a1b8eSPeter Foley	    --directory=$(srctree) --directory=$(objtree)           \
85b70e325cSSam Ravnborg	    --output $(obj)/config.pot
86b70e325cSSam Ravnborg	$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
87b70e325cSSam Ravnborg	$(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
88*a24a1b8eSPeter Foley	$(Q)(for i in `ls $(srctree)/arch/*/Kconfig`;    \
89720d6c29SEgry Gabor	    do                                           \
901020026fSEGRY Gabor		echo "  GEN $$i";                        \
914217516eSSam Ravnborg		$(obj)/kxgettext $$i                     \
921020026fSEGRY Gabor		     >> $(obj)/config.pot;               \
931020026fSEGRY Gabor	    done )
941020026fSEGRY Gabor	$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
95b70e325cSSam Ravnborg	    --output $(obj)/linux.pot
96*a24a1b8eSPeter Foley	$(Q)rm -f $(srctree)/arch/um/Kconfig.arch
97b70e325cSSam Ravnborg	$(Q)rm -f $(obj)/config.pot
983b9fa093SArnaldo Carvalho de Melo
990748cb3eSSam RavnborgPHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
1001da177e4SLinus Torvalds
1010748cb3eSSam Ravnborgallnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
1024062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
1031da177e4SLinus Torvalds
1047cf3d73bSSam RavnborgPHONY += listnewconfig oldnoconfig savedefconfig defconfig
1051da177e4SLinus Torvalds
106861b4ea4SSam Ravnborglistnewconfig oldnoconfig: $(obj)/conf
1074062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
1081da177e4SLinus Torvalds
1097cf3d73bSSam Ravnborgsavedefconfig: $(obj)/conf
1107cf3d73bSSam Ravnborg	$< --$@=defconfig $(Kconfig)
1117cf3d73bSSam Ravnborg
1121da177e4SLinus Torvaldsdefconfig: $(obj)/conf
1131da177e4SLinus Torvaldsifeq ($(KBUILD_DEFCONFIG),)
1144062f1a4SSam Ravnborg	$< --defconfig $(Kconfig)
1151da177e4SLinus Torvaldselse
1162266cfd5SSam Ravnborg	@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
1174062f1a4SSam Ravnborg	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
1181da177e4SLinus Torvaldsendif
1191da177e4SLinus Torvalds
1201da177e4SLinus Torvalds%_defconfig: $(obj)/conf
1214062f1a4SSam Ravnborg	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
1221da177e4SLinus Torvalds
1231da177e4SLinus Torvalds# Help text used by make help
1241da177e4SLinus Torvaldshelp:
1251da177e4SLinus Torvalds	@echo  '  config	  - Update current config utilising a line-oriented program'
126692d97c3Snir.tzachar@gmail.com	@echo  '  nconfig         - Update current config utilising a ncurses menu based program'
1271da177e4SLinus Torvalds	@echo  '  menuconfig	  - Update current config utilising a menu based program'
1281da177e4SLinus Torvalds	@echo  '  xconfig	  - Update current config utilising a QT based front-end'
1291da177e4SLinus Torvalds	@echo  '  gconfig	  - Update current config utilising a GTK based front-end'
1301da177e4SLinus Torvalds	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
13103fa25daSSteven Rostedt	@echo  '  localmodconfig  - Update current config disabling modules not loaded'
132281c9dadSSteven Rostedt	@echo  '  localyesconfig  - Update current config converting local mods to core'
133590a5857SMarkus Heidelberg	@echo  '  silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
1340748cb3eSSam Ravnborg	@echo  '  defconfig	  - New config with default from ARCH supplied defconfig'
1357cf3d73bSSam Ravnborg	@echo  '  savedefconfig   - Save current config as ./defconfig (minimal config)'
136e11f0496SJesper Juhl	@echo  '  allnoconfig	  - New config where all options are answered with no'
1370748cb3eSSam Ravnborg	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
1380748cb3eSSam Ravnborg	@echo  '  allmodconfig	  - New config selecting modules when possible'
1390748cb3eSSam Ravnborg	@echo  '  alldefconfig    - New config with all symbols set to default'
1400748cb3eSSam Ravnborg	@echo  '  randconfig	  - New config with random answer to all options'
141861b4ea4SSam Ravnborg	@echo  '  listnewconfig   - List new options'
142ef61ca88SSam Ravnborg	@echo  '  oldnoconfig     - Same as silentoldconfig but set new symbols to n (unset)'
1431da177e4SLinus Torvalds
1442982de69SSam Ravnborg# lxdialog stuff
1452982de69SSam Ravnborgcheck-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
1462982de69SSam Ravnborg
147e9e40e14SRob Landley# Use recursively expanded variables so we do not call gcc unless
1482982de69SSam Ravnborg# we really need to do so. (Do not call gcc as part of make mrproper)
1499ba95682SArnaud LacombeHOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \
1509ba95682SArnaud Lacombe                    -DLOCALE
1512982de69SSam Ravnborg
1521da177e4SLinus Torvalds# ===========================================================================
1531da177e4SLinus Torvalds# Shared Makefile for the various kconfig executables:
1541da177e4SLinus Torvalds# conf:	  Used for defconfig, oldconfig and related targets
155692d97c3Snir.tzachar@gmail.com# nconf:  Used for the nconfig target.
156692d97c3Snir.tzachar@gmail.com#         Utilizes ncurses
1576f26e5e4SMarkus Heidelberg# mconf:  Used for the menuconfig target
1581da177e4SLinus Torvalds#         Utilizes the lxdialog package
1591da177e4SLinus Torvalds# qconf:  Used for the xconfig target
1601da177e4SLinus Torvalds#         Based on QT which needs to be installed to compile it
1611da177e4SLinus Torvalds# gconf:  Used for the gconfig target
1621da177e4SLinus Torvalds#         Based on GTK which needs to be installed to compile it
1631da177e4SLinus Torvalds# object files used by all kconfig flavours
1641da177e4SLinus Torvalds
1652982de69SSam Ravnborglxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
1662982de69SSam Ravnborglxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
1672982de69SSam Ravnborg
1681da177e4SLinus Torvaldsconf-objs	:= conf.o  zconf.tab.o
1692982de69SSam Ravnborgmconf-objs     := mconf.o zconf.tab.o $(lxdialog)
170692d97c3Snir.tzachar@gmail.comnconf-objs     := nconf.o zconf.tab.o nconf.gui.o
1713b9fa093SArnaldo Carvalho de Melokxgettext-objs	:= kxgettext.o zconf.tab.o
172f1943049SPeter Foleyqconf-cxxobjs	:= qconf.o
173f1943049SPeter Foleyqconf-objs	:= kconfig_load.o zconf.tab.o
174d02ab886SPeter Foleygconf-objs	:= gconf.o kconfig_load.o zconf.tab.o
1751da177e4SLinus Torvalds
176d02ab886SPeter Foleyhostprogs-y := conf
177c29121b7SSam Ravnborg
178692d97c3Snir.tzachar@gmail.comifeq ($(MAKECMDGOALS),nconfig)
179692d97c3Snir.tzachar@gmail.com	hostprogs-y += nconf
180692d97c3Snir.tzachar@gmail.comendif
181692d97c3Snir.tzachar@gmail.com
182c29121b7SSam Ravnborgifeq ($(MAKECMDGOALS),menuconfig)
183c29121b7SSam Ravnborg	hostprogs-y += mconf
184c29121b7SSam Ravnborgendif
185c29121b7SSam Ravnborg
1861f594715SPeter Foleyifeq ($(MAKECMDGOALS),update-po-config)
1871f594715SPeter Foley	hostprogs-y += kxgettext
1881f594715SPeter Foleyendif
1891f594715SPeter Foley
1901da177e4SLinus Torvaldsifeq ($(MAKECMDGOALS),xconfig)
1911da177e4SLinus Torvalds	qconf-target := 1
1921da177e4SLinus Torvaldsendif
1931da177e4SLinus Torvaldsifeq ($(MAKECMDGOALS),gconfig)
1941da177e4SLinus Torvalds	gconf-target := 1
1951da177e4SLinus Torvaldsendif
1961da177e4SLinus Torvalds
1971da177e4SLinus Torvalds
1981da177e4SLinus Torvaldsifeq ($(qconf-target),1)
199f1943049SPeter Foley	hostprogs-y += qconf
2001da177e4SLinus Torvaldsendif
2011da177e4SLinus Torvalds
2021da177e4SLinus Torvaldsifeq ($(gconf-target),1)
203d02ab886SPeter Foley	hostprogs-y += gconf
2041da177e4SLinus Torvaldsendif
2051da177e4SLinus Torvalds
206b24d7d7bSPeter Foleyclean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck
207b24d7d7bSPeter Foleyclean-files	+= zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
208692d97c3Snir.tzachar@gmail.comclean-files     += mconf qconf gconf nconf
2091020026fSEGRY Gaborclean-files     += config.pot linux.pot
2101da177e4SLinus Torvalds
2116e588f6dSSam Ravnborg# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
2126e588f6dSSam RavnborgPHONY += $(obj)/dochecklxdialog
2136e588f6dSSam Ravnborg$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
2146e588f6dSSam Ravnborg$(obj)/dochecklxdialog:
2157080e47bSArnaud Lacombe	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
2166e588f6dSSam Ravnborg
2176e588f6dSSam Ravnborgalways := dochecklxdialog
2186e588f6dSSam Ravnborg
219aa1e5ef5SSam Ravnborg# Add environment specific flags
220aa1e5ef5SSam RavnborgHOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
22170a6a0cbSYuri Vasilevski
2221da177e4SLinus Torvalds# generated files seem to need this to find local include files
2231da177e4SLinus TorvaldsHOSTCFLAGS_lex.zconf.o	:= -I$(src)
2241da177e4SLinus TorvaldsHOSTCFLAGS_zconf.tab.o	:= -I$(src)
2251da177e4SLinus Torvalds
226b3a5225fSRoman ZippelHOSTLOADLIBES_qconf	= $(KC_QT_LIBS) -ldl
227b3a5225fSRoman ZippelHOSTCXXFLAGS_qconf.o	= $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
2281da177e4SLinus Torvalds
229cbab05f0SRichard KennedyHOSTLOADLIBES_gconf	= `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl
23037193147SAdrian BunkHOSTCFLAGS_gconf.o	= `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
2311da177e4SLinus Torvalds                          -D LKC_DIRECT_LINK
2321da177e4SLinus Torvalds
2337080e47bSArnaud LacombeHOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
2347080e47bSArnaud Lacombe
235692d97c3Snir.tzachar@gmail.comHOSTLOADLIBES_nconf	= -lmenu -lpanel -lncurses
2361da177e4SLinus Torvalds$(obj)/qconf.o: $(obj)/.tmp_qtcheck
2371da177e4SLinus Torvalds
2381da177e4SLinus Torvaldsifeq ($(qconf-target),1)
239b3a5225fSRoman Zippel$(obj)/.tmp_qtcheck: $(src)/Makefile
2401da177e4SLinus Torvalds-include $(obj)/.tmp_qtcheck
2411da177e4SLinus Torvalds
2421da177e4SLinus Torvalds# QT needs some extra effort...
2431da177e4SLinus Torvalds$(obj)/.tmp_qtcheck:
244b3a5225fSRoman Zippel	@set -e; echo "  CHECK   qt"; dir=""; pkg=""; \
245133c5f7cSAlexander Stein	if ! pkg-config --exists QtCore 2> /dev/null; then \
246133c5f7cSAlexander Stein	    echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \
247b3a5225fSRoman Zippel	    pkg-config --exists qt 2> /dev/null && pkg=qt; \
248b3a5225fSRoman Zippel	    pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
249b3a5225fSRoman Zippel	    if [ -n "$$pkg" ]; then \
250b3a5225fSRoman Zippel	      cflags="\$$(shell pkg-config $$pkg --cflags)"; \
251b3a5225fSRoman Zippel	      libs="\$$(shell pkg-config $$pkg --libs)"; \
252b3a5225fSRoman Zippel	      moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \
253b3a5225fSRoman Zippel	      dir="$$(pkg-config $$pkg --variable=prefix)"; \
254b3a5225fSRoman Zippel	    else \
255b3a5225fSRoman Zippel	      for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
256b3a5225fSRoman Zippel	        if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
2571da177e4SLinus Torvalds	      done; \
258b3a5225fSRoman Zippel	      if [ -z "$$dir" ]; then \
2591da177e4SLinus Torvalds	        echo "*"; \
260133c5f7cSAlexander Stein	        echo "* Unable to find any QT installation. Please make sure that"; \
261133c5f7cSAlexander Stein	        echo "* the QT4 or QT3 development package is correctly installed and"; \
262133c5f7cSAlexander Stein	        echo "* either qmake can be found or install pkg-config or set"; \
263133c5f7cSAlexander Stein	        echo "* the QTDIR environment variable to the correct location."; \
2641da177e4SLinus Torvalds	        echo "*"; \
2651da177e4SLinus Torvalds	        false; \
2661da177e4SLinus Torvalds	      fi; \
267b3a5225fSRoman Zippel	      libpath=$$dir/lib; lib=qt; osdir=""; \
2681da177e4SLinus Torvalds	      $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
269b3a5225fSRoman Zippel	        osdir=x$$($(HOSTCXX) -print-multi-os-directory); \
270b3a5225fSRoman Zippel	      test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \
271b3a5225fSRoman Zippel	      test -f $$libpath/libqt-mt.so && lib=qt-mt; \
272b3a5225fSRoman Zippel	      cflags="-I$$dir/include"; \
273b3a5225fSRoman Zippel	      libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
274b3a5225fSRoman Zippel	      moc="$$dir/bin/moc"; \
275ab919c06SSam Ravnborg	    fi; \
276b3a5225fSRoman Zippel	    if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
2771da177e4SLinus Torvalds	      echo "*"; \
278b3a5225fSRoman Zippel	      echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
2791da177e4SLinus Torvalds	      echo "*"; \
280b3a5225fSRoman Zippel	      moc="/usr/bin/moc"; \
281b3a5225fSRoman Zippel	    fi; \
282133c5f7cSAlexander Stein	else \
283458452f4SMichal Marek	  cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \
284458452f4SMichal Marek	  libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \
28520f4ad8aSAlexander Stein	  binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \
28620f4ad8aSAlexander Stein	  moc="$$binpath/bin/moc"; \
287133c5f7cSAlexander Stein	fi; \
288b3a5225fSRoman Zippel	echo "KC_QT_CFLAGS=$$cflags" > $@; \
289b3a5225fSRoman Zippel	echo "KC_QT_LIBS=$$libs" >> $@; \
290b3a5225fSRoman Zippel	echo "KC_QT_MOC=$$moc" >> $@
2911da177e4SLinus Torvaldsendif
2921da177e4SLinus Torvalds
2931da177e4SLinus Torvalds$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
2941da177e4SLinus Torvalds
2951da177e4SLinus Torvaldsifeq ($(gconf-target),1)
2961da177e4SLinus Torvalds-include $(obj)/.tmp_gtkcheck
2971da177e4SLinus Torvalds
2981da177e4SLinus Torvalds# GTK needs some extra effort, too...
2991da177e4SLinus Torvalds$(obj)/.tmp_gtkcheck:
30037193147SAdrian Bunk	@if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then		\
30137193147SAdrian Bunk		if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then			\
3021da177e4SLinus Torvalds			touch $@;								\
3031da177e4SLinus Torvalds		else									\
3041da177e4SLinus Torvalds			echo "*"; 							\
3051da177e4SLinus Torvalds			echo "* GTK+ is present but version >= 2.0.0 is required.";	\
3061da177e4SLinus Torvalds			echo "*";							\
3071da177e4SLinus Torvalds			false;								\
3081da177e4SLinus Torvalds		fi									\
3091da177e4SLinus Torvalds	else										\
3101da177e4SLinus Torvalds		echo "*"; 								\
3111da177e4SLinus Torvalds		echo "* Unable to find the GTK+ installation. Please make sure that"; 	\
3121da177e4SLinus Torvalds		echo "* the GTK+ 2.0 development package is correctly installed..."; 	\
3131da177e4SLinus Torvalds		echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; 		\
3141da177e4SLinus Torvalds		echo "*"; 								\
3151da177e4SLinus Torvalds		false;									\
3161da177e4SLinus Torvalds	fi
3171da177e4SLinus Torvaldsendif
3181da177e4SLinus Torvalds
3197a88488bSRoman Zippel$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
3201da177e4SLinus Torvalds
3211da177e4SLinus Torvalds$(obj)/kconfig_load.o: $(obj)/lkc_defs.h
3221da177e4SLinus Torvalds
3231da177e4SLinus Torvalds$(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
3241da177e4SLinus Torvalds
3251da177e4SLinus Torvalds$(obj)/gconf.o: $(obj)/lkc_defs.h
3261da177e4SLinus Torvalds
3271da177e4SLinus Torvalds$(obj)/%.moc: $(src)/%.h
328b3a5225fSRoman Zippel	$(KC_QT_MOC) -i $< -o $@
3291da177e4SLinus Torvalds
3301da177e4SLinus Torvalds$(obj)/lkc_defs.h: $(src)/lkc_proto.h
3311da177e4SLinus Torvalds	sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
3321da177e4SLinus Torvalds
33346d26319SEGRY Gabor# Extract gconf menu items for I18N support
33446d26319SEGRY Gabor$(obj)/gconf.glade.h: $(obj)/gconf.glade
335*a24a1b8eSPeter Foley	intltool-extract --type=gettext/glade --srcdir=$(srctree) \
336*a24a1b8eSPeter Foley	$(obj)/gconf.glade
3371da177e4SLinus Torvalds
3381da177e4SLinus Torvalds###
3397a88488bSRoman Zippel# The following requires flex/bison/gperf
3401da177e4SLinus Torvalds# By default we use the _shipped versions, uncomment the following line if
3411da177e4SLinus Torvalds# you are modifying the flex/bison src.
3421da177e4SLinus Torvalds# LKC_GENPARSER := 1
3431da177e4SLinus Torvalds
3441da177e4SLinus Torvaldsifdef LKC_GENPARSER
3451da177e4SLinus Torvalds
346491d7110SRoman Zippel$(obj)/zconf.tab.c: $(src)/zconf.y
347491d7110SRoman Zippel$(obj)/lex.zconf.c: $(src)/zconf.l
3487a88488bSRoman Zippel$(obj)/zconf.hash.c: $(src)/zconf.gperf
3491da177e4SLinus Torvalds
3501da177e4SLinus Torvalds%.tab.c: %.y
351491d7110SRoman Zippel	bison -l -b $* -p $(notdir $*) $<
352491d7110SRoman Zippel	cp $@ $@_shipped
3531da177e4SLinus Torvalds
3541da177e4SLinus Torvaldslex.%.c: %.l
355491d7110SRoman Zippel	flex -L -P$(notdir $*) -o$@ $<
356491d7110SRoman Zippel	cp $@ $@_shipped
3571da177e4SLinus Torvalds
3587a88488bSRoman Zippel%.hash.c: %.gperf
3597a88488bSRoman Zippel	gperf < $< > $@
3607a88488bSRoman Zippel	cp $@ $@_shipped
3617a88488bSRoman Zippel
3621da177e4SLinus Torvaldsendif
363