xref: /linux/scripts/kconfig/Makefile (revision 7cf3d73b4360e91b14326632ab1aeda4cb26308d)
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
1147572387SSam RavnborgKconfig := arch/$(SRCARCH)/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
3603fa25daSSteven Rostedtlocalmodconfig: $(obj)/streamline_config.pl $(obj)/conf
37463bf900SSteven Rostedt	$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
38a7c02602SSteven Rostedt	$(Q)if [ -f .config ]; then					\
39a7c02602SSteven Rostedt			cmp -s .tmp.config .config ||			\
4003fa25daSSteven Rostedt			(mv -f .config .config.old.1;			\
4103fa25daSSteven Rostedt			 mv -f .tmp.config .config;			\
424062f1a4SSam Ravnborg			 $(obj)/conf --silentoldconfig $(Kconfig);	\
43a7c02602SSteven Rostedt			 mv -f .config.old.1 .config.old)		\
44a7c02602SSteven Rostedt	else								\
45a7c02602SSteven Rostedt			mv -f .tmp.config .config;			\
464062f1a4SSam Ravnborg			$(obj)/conf --silentoldconfig $(Kconfig);	\
47a7c02602SSteven Rostedt	fi
4803fa25daSSteven Rostedt	$(Q)rm -f .tmp.config
4903fa25daSSteven Rostedt
5048586218SSteven Rostedtlocalyesconfig: $(obj)/streamline_config.pl $(obj)/conf
51463bf900SSteven Rostedt	$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
52281c9dadSSteven Rostedt	$(Q)sed -i s/=m/=y/ .tmp.config
53a7c02602SSteven Rostedt	$(Q)if [ -f .config ]; then					\
54a7c02602SSteven Rostedt			cmp -s .tmp.config .config ||			\
55281c9dadSSteven Rostedt			(mv -f .config .config.old.1;			\
56281c9dadSSteven Rostedt			 mv -f .tmp.config .config;			\
574062f1a4SSam Ravnborg			 $(obj)/conf --silentoldconfig $(Kconfig);	\
58a7c02602SSteven Rostedt			 mv -f .config.old.1 .config.old)		\
59a7c02602SSteven Rostedt	else								\
60a7c02602SSteven Rostedt			mv -f .tmp.config .config;			\
614062f1a4SSam Ravnborg			$(obj)/conf --silentoldconfig $(Kconfig);	\
62a7c02602SSteven Rostedt	fi
63281c9dadSSteven Rostedt	$(Q)rm -f .tmp.config
64281c9dadSSteven Rostedt
651020026fSEGRY Gabor# Create new linux.pot file
66b70e325cSSam Ravnborg# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
67b70e325cSSam Ravnborg# The symlink is used to repair a deficiency in arch/um
6846d26319SEGRY Gaborupdate-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
691020026fSEGRY Gabor	$(Q)echo "  GEN config"
701020026fSEGRY Gabor	$(Q)xgettext --default-domain=linux              \
713b9fa093SArnaldo Carvalho de Melo	    --add-comments --keyword=_ --keyword=N_      \
72b70e325cSSam Ravnborg	    --from-code=UTF-8                            \
733b9fa093SArnaldo Carvalho de Melo	    --files-from=scripts/kconfig/POTFILES.in     \
74b70e325cSSam Ravnborg	    --output $(obj)/config.pot
75b70e325cSSam Ravnborg	$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
76b70e325cSSam Ravnborg	$(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
774217516eSSam Ravnborg	$(Q)(for i in `ls arch/*/Kconfig`;               \
78720d6c29SEgry Gabor	    do                                           \
791020026fSEGRY Gabor		echo "  GEN $$i";                        \
804217516eSSam Ravnborg		$(obj)/kxgettext $$i                     \
811020026fSEGRY Gabor		     >> $(obj)/config.pot;               \
821020026fSEGRY Gabor	    done )
831020026fSEGRY Gabor	$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
84b70e325cSSam Ravnborg	    --output $(obj)/linux.pot
85b70e325cSSam Ravnborg	$(Q)rm -f arch/um/Kconfig.arch
86b70e325cSSam Ravnborg	$(Q)rm -f $(obj)/config.pot
873b9fa093SArnaldo Carvalho de Melo
880748cb3eSSam RavnborgPHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
891da177e4SLinus Torvalds
900748cb3eSSam Ravnborgallnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
914062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
921da177e4SLinus Torvalds
93*7cf3d73bSSam RavnborgPHONY += listnewconfig oldnoconfig savedefconfig defconfig
941da177e4SLinus Torvalds
95861b4ea4SSam Ravnborglistnewconfig oldnoconfig: $(obj)/conf
964062f1a4SSam Ravnborg	$< --$@ $(Kconfig)
971da177e4SLinus Torvalds
98*7cf3d73bSSam Ravnborgsavedefconfig: $(obj)/conf
99*7cf3d73bSSam Ravnborg	$< --$@=defconfig $(Kconfig)
100*7cf3d73bSSam Ravnborg
1011da177e4SLinus Torvaldsdefconfig: $(obj)/conf
1021da177e4SLinus Torvaldsifeq ($(KBUILD_DEFCONFIG),)
1034062f1a4SSam Ravnborg	$< --defconfig $(Kconfig)
1041da177e4SLinus Torvaldselse
1052266cfd5SSam Ravnborg	@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
1064062f1a4SSam Ravnborg	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
1071da177e4SLinus Torvaldsendif
1081da177e4SLinus Torvalds
1091da177e4SLinus Torvalds%_defconfig: $(obj)/conf
1104062f1a4SSam Ravnborg	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
1111da177e4SLinus Torvalds
1121da177e4SLinus Torvalds# Help text used by make help
1131da177e4SLinus Torvaldshelp:
1141da177e4SLinus Torvalds	@echo  '  config	  - Update current config utilising a line-oriented program'
115692d97c3Snir.tzachar@gmail.com	@echo  '  nconfig         - Update current config utilising a ncurses menu based program'
1161da177e4SLinus Torvalds	@echo  '  menuconfig	  - Update current config utilising a menu based program'
1171da177e4SLinus Torvalds	@echo  '  xconfig	  - Update current config utilising a QT based front-end'
1181da177e4SLinus Torvalds	@echo  '  gconfig	  - Update current config utilising a GTK based front-end'
1191da177e4SLinus Torvalds	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
12003fa25daSSteven Rostedt	@echo  '  localmodconfig  - Update current config disabling modules not loaded'
121281c9dadSSteven Rostedt	@echo  '  localyesconfig  - Update current config converting local mods to core'
122590a5857SMarkus Heidelberg	@echo  '  silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
1230748cb3eSSam Ravnborg	@echo  '  defconfig	  - New config with default from ARCH supplied defconfig'
124*7cf3d73bSSam Ravnborg	@echo  '  savedefconfig   - Save current config as ./defconfig (minimal config)'
125e11f0496SJesper Juhl	@echo  '  allnoconfig	  - New config where all options are answered with no'
1260748cb3eSSam Ravnborg	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
1270748cb3eSSam Ravnborg	@echo  '  allmodconfig	  - New config selecting modules when possible'
1280748cb3eSSam Ravnborg	@echo  '  alldefconfig    - New config with all symbols set to default'
1290748cb3eSSam Ravnborg	@echo  '  randconfig	  - New config with random answer to all options'
130861b4ea4SSam Ravnborg	@echo  '  listnewconfig   - List new options'
131ef61ca88SSam Ravnborg	@echo  '  oldnoconfig     - Same as silentoldconfig but set new symbols to n (unset)'
1321da177e4SLinus Torvalds
1332982de69SSam Ravnborg# lxdialog stuff
1342982de69SSam Ravnborgcheck-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
1352982de69SSam Ravnborg
136e9e40e14SRob Landley# Use recursively expanded variables so we do not call gcc unless
1372982de69SSam Ravnborg# we really need to do so. (Do not call gcc as part of make mrproper)
1382982de69SSam RavnborgHOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
1392982de69SSam RavnborgHOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
1402982de69SSam Ravnborg
1412982de69SSam RavnborgHOST_EXTRACFLAGS += -DLOCALE
1422982de69SSam Ravnborg
1432982de69SSam Ravnborg
1441da177e4SLinus Torvalds# ===========================================================================
1451da177e4SLinus Torvalds# Shared Makefile for the various kconfig executables:
1461da177e4SLinus Torvalds# conf:	  Used for defconfig, oldconfig and related targets
147692d97c3Snir.tzachar@gmail.com# nconf:  Used for the nconfig target.
148692d97c3Snir.tzachar@gmail.com#         Utilizes ncurses
1496f26e5e4SMarkus Heidelberg# mconf:  Used for the menuconfig target
1501da177e4SLinus Torvalds#         Utilizes the lxdialog package
1511da177e4SLinus Torvalds# qconf:  Used for the xconfig target
1521da177e4SLinus Torvalds#         Based on QT which needs to be installed to compile it
1531da177e4SLinus Torvalds# gconf:  Used for the gconfig target
1541da177e4SLinus Torvalds#         Based on GTK which needs to be installed to compile it
1551da177e4SLinus Torvalds# object files used by all kconfig flavours
1561da177e4SLinus Torvalds
1572982de69SSam Ravnborglxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
1582982de69SSam Ravnborglxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
1592982de69SSam Ravnborg
1601da177e4SLinus Torvaldsconf-objs	:= conf.o  zconf.tab.o
1612982de69SSam Ravnborgmconf-objs     := mconf.o zconf.tab.o $(lxdialog)
162692d97c3Snir.tzachar@gmail.comnconf-objs     := nconf.o zconf.tab.o nconf.gui.o
1633b9fa093SArnaldo Carvalho de Melokxgettext-objs	:= kxgettext.o zconf.tab.o
1641da177e4SLinus Torvalds
165c29121b7SSam Ravnborghostprogs-y := conf qconf gconf kxgettext
166c29121b7SSam Ravnborg
167692d97c3Snir.tzachar@gmail.comifeq ($(MAKECMDGOALS),nconfig)
168692d97c3Snir.tzachar@gmail.com	hostprogs-y += nconf
169692d97c3Snir.tzachar@gmail.comendif
170692d97c3Snir.tzachar@gmail.com
171c29121b7SSam Ravnborgifeq ($(MAKECMDGOALS),menuconfig)
172c29121b7SSam Ravnborg	hostprogs-y += mconf
173c29121b7SSam Ravnborgendif
174c29121b7SSam Ravnborg
1751da177e4SLinus Torvaldsifeq ($(MAKECMDGOALS),xconfig)
1761da177e4SLinus Torvalds	qconf-target := 1
1771da177e4SLinus Torvaldsendif
1781da177e4SLinus Torvaldsifeq ($(MAKECMDGOALS),gconfig)
1791da177e4SLinus Torvalds	gconf-target := 1
1801da177e4SLinus Torvaldsendif
1811da177e4SLinus Torvalds
1821da177e4SLinus Torvalds
1831da177e4SLinus Torvaldsifeq ($(qconf-target),1)
1841da177e4SLinus Torvaldsqconf-cxxobjs	:= qconf.o
1851da177e4SLinus Torvaldsqconf-objs	:= kconfig_load.o zconf.tab.o
1861da177e4SLinus Torvaldsendif
1871da177e4SLinus Torvalds
1881da177e4SLinus Torvaldsifeq ($(gconf-target),1)
1891da177e4SLinus Torvaldsgconf-objs	:= gconf.o kconfig_load.o zconf.tab.o
1901da177e4SLinus Torvaldsendif
1911da177e4SLinus Torvalds
1921da177e4SLinus Torvaldsclean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck \
19346d26319SEGRY Gabor		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
194692d97c3Snir.tzachar@gmail.comclean-files     += mconf qconf gconf nconf
1951020026fSEGRY Gaborclean-files     += config.pot linux.pot
1961da177e4SLinus Torvalds
1976e588f6dSSam Ravnborg# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
1986e588f6dSSam RavnborgPHONY += $(obj)/dochecklxdialog
1996e588f6dSSam Ravnborg$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
2006e588f6dSSam Ravnborg$(obj)/dochecklxdialog:
2016e588f6dSSam Ravnborg	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES)
2026e588f6dSSam Ravnborg
2036e588f6dSSam Ravnborgalways := dochecklxdialog
2046e588f6dSSam Ravnborg
205aa1e5ef5SSam Ravnborg# Add environment specific flags
206aa1e5ef5SSam RavnborgHOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
20770a6a0cbSYuri Vasilevski
2081da177e4SLinus Torvalds# generated files seem to need this to find local include files
2091da177e4SLinus TorvaldsHOSTCFLAGS_lex.zconf.o	:= -I$(src)
2101da177e4SLinus TorvaldsHOSTCFLAGS_zconf.tab.o	:= -I$(src)
2111da177e4SLinus Torvalds
212b3a5225fSRoman ZippelHOSTLOADLIBES_qconf	= $(KC_QT_LIBS) -ldl
213b3a5225fSRoman ZippelHOSTCXXFLAGS_qconf.o	= $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
2141da177e4SLinus Torvalds
21537193147SAdrian BunkHOSTLOADLIBES_gconf	= `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
21637193147SAdrian BunkHOSTCFLAGS_gconf.o	= `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
2171da177e4SLinus Torvalds                          -D LKC_DIRECT_LINK
2181da177e4SLinus Torvalds
219692d97c3Snir.tzachar@gmail.comHOSTLOADLIBES_nconf	= -lmenu -lpanel -lncurses
2201da177e4SLinus Torvalds$(obj)/qconf.o: $(obj)/.tmp_qtcheck
2211da177e4SLinus Torvalds
2221da177e4SLinus Torvaldsifeq ($(qconf-target),1)
223b3a5225fSRoman Zippel$(obj)/.tmp_qtcheck: $(src)/Makefile
2241da177e4SLinus Torvalds-include $(obj)/.tmp_qtcheck
2251da177e4SLinus Torvalds
2261da177e4SLinus Torvalds# QT needs some extra effort...
2271da177e4SLinus Torvalds$(obj)/.tmp_qtcheck:
228b3a5225fSRoman Zippel	@set -e; echo "  CHECK   qt"; dir=""; pkg=""; \
229b3a5225fSRoman Zippel	pkg-config --exists qt 2> /dev/null && pkg=qt; \
230b3a5225fSRoman Zippel	pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
231b3a5225fSRoman Zippel	if [ -n "$$pkg" ]; then \
232b3a5225fSRoman Zippel	  cflags="\$$(shell pkg-config $$pkg --cflags)"; \
233b3a5225fSRoman Zippel	  libs="\$$(shell pkg-config $$pkg --libs)"; \
234b3a5225fSRoman Zippel	  moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \
235b3a5225fSRoman Zippel	  dir="$$(pkg-config $$pkg --variable=prefix)"; \
236b3a5225fSRoman Zippel	else \
237b3a5225fSRoman Zippel	  for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
238b3a5225fSRoman Zippel	    if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
2391da177e4SLinus Torvalds	  done; \
240b3a5225fSRoman Zippel	  if [ -z "$$dir" ]; then \
2411da177e4SLinus Torvalds	    echo "*"; \
2429ae57004SSam Ravnborg	    echo "* Unable to find the QT3 installation. Please make sure that"; \
2439ae57004SSam Ravnborg	    echo "* the QT3 development package is correctly installed and"; \
244b3a5225fSRoman Zippel	    echo "* either install pkg-config or set the QTDIR environment"; \
245b3a5225fSRoman Zippel	    echo "* variable to the correct location."; \
2461da177e4SLinus Torvalds	    echo "*"; \
2471da177e4SLinus Torvalds	    false; \
2481da177e4SLinus Torvalds	  fi; \
249b3a5225fSRoman Zippel	  libpath=$$dir/lib; lib=qt; osdir=""; \
2501da177e4SLinus Torvalds	  $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
251b3a5225fSRoman Zippel	    osdir=x$$($(HOSTCXX) -print-multi-os-directory); \
252b3a5225fSRoman Zippel	  test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \
253b3a5225fSRoman Zippel	  test -f $$libpath/libqt-mt.so && lib=qt-mt; \
254b3a5225fSRoman Zippel	  cflags="-I$$dir/include"; \
255b3a5225fSRoman Zippel	  libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
256b3a5225fSRoman Zippel	  moc="$$dir/bin/moc"; \
257ab919c06SSam Ravnborg	fi; \
258b3a5225fSRoman Zippel	if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
2591da177e4SLinus Torvalds	  echo "*"; \
260b3a5225fSRoman Zippel	  echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
2611da177e4SLinus Torvalds	  echo "*"; \
262b3a5225fSRoman Zippel	  moc="/usr/bin/moc"; \
263b3a5225fSRoman Zippel	fi; \
264b3a5225fSRoman Zippel	echo "KC_QT_CFLAGS=$$cflags" > $@; \
265b3a5225fSRoman Zippel	echo "KC_QT_LIBS=$$libs" >> $@; \
266b3a5225fSRoman Zippel	echo "KC_QT_MOC=$$moc" >> $@
2671da177e4SLinus Torvaldsendif
2681da177e4SLinus Torvalds
2691da177e4SLinus Torvalds$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
2701da177e4SLinus Torvalds
2711da177e4SLinus Torvaldsifeq ($(gconf-target),1)
2721da177e4SLinus Torvalds-include $(obj)/.tmp_gtkcheck
2731da177e4SLinus Torvalds
2741da177e4SLinus Torvalds# GTK needs some extra effort, too...
2751da177e4SLinus Torvalds$(obj)/.tmp_gtkcheck:
27637193147SAdrian Bunk	@if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then		\
27737193147SAdrian Bunk		if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then			\
2781da177e4SLinus Torvalds			touch $@;								\
2791da177e4SLinus Torvalds		else									\
2801da177e4SLinus Torvalds			echo "*"; 							\
2811da177e4SLinus Torvalds			echo "* GTK+ is present but version >= 2.0.0 is required.";	\
2821da177e4SLinus Torvalds			echo "*";							\
2831da177e4SLinus Torvalds			false;								\
2841da177e4SLinus Torvalds		fi									\
2851da177e4SLinus Torvalds	else										\
2861da177e4SLinus Torvalds		echo "*"; 								\
2871da177e4SLinus Torvalds		echo "* Unable to find the GTK+ installation. Please make sure that"; 	\
2881da177e4SLinus Torvalds		echo "* the GTK+ 2.0 development package is correctly installed..."; 	\
2891da177e4SLinus Torvalds		echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; 		\
2901da177e4SLinus Torvalds		echo "*"; 								\
2911da177e4SLinus Torvalds		false;									\
2921da177e4SLinus Torvalds	fi
2931da177e4SLinus Torvaldsendif
2941da177e4SLinus Torvalds
2957a88488bSRoman Zippel$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
2961da177e4SLinus Torvalds
2971da177e4SLinus Torvalds$(obj)/kconfig_load.o: $(obj)/lkc_defs.h
2981da177e4SLinus Torvalds
2991da177e4SLinus Torvalds$(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
3001da177e4SLinus Torvalds
3011da177e4SLinus Torvalds$(obj)/gconf.o: $(obj)/lkc_defs.h
3021da177e4SLinus Torvalds
3031da177e4SLinus Torvalds$(obj)/%.moc: $(src)/%.h
304b3a5225fSRoman Zippel	$(KC_QT_MOC) -i $< -o $@
3051da177e4SLinus Torvalds
3061da177e4SLinus Torvalds$(obj)/lkc_defs.h: $(src)/lkc_proto.h
3071da177e4SLinus Torvalds	sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
3081da177e4SLinus Torvalds
30946d26319SEGRY Gabor# Extract gconf menu items for I18N support
31046d26319SEGRY Gabor$(obj)/gconf.glade.h: $(obj)/gconf.glade
31146d26319SEGRY Gabor	intltool-extract --type=gettext/glade $(obj)/gconf.glade
3121da177e4SLinus Torvalds
3131da177e4SLinus Torvalds###
3147a88488bSRoman Zippel# The following requires flex/bison/gperf
3151da177e4SLinus Torvalds# By default we use the _shipped versions, uncomment the following line if
3161da177e4SLinus Torvalds# you are modifying the flex/bison src.
3171da177e4SLinus Torvalds# LKC_GENPARSER := 1
3181da177e4SLinus Torvalds
3191da177e4SLinus Torvaldsifdef LKC_GENPARSER
3201da177e4SLinus Torvalds
321491d7110SRoman Zippel$(obj)/zconf.tab.c: $(src)/zconf.y
322491d7110SRoman Zippel$(obj)/lex.zconf.c: $(src)/zconf.l
3237a88488bSRoman Zippel$(obj)/zconf.hash.c: $(src)/zconf.gperf
3241da177e4SLinus Torvalds
3251da177e4SLinus Torvalds%.tab.c: %.y
326491d7110SRoman Zippel	bison -l -b $* -p $(notdir $*) $<
327491d7110SRoman Zippel	cp $@ $@_shipped
3281da177e4SLinus Torvalds
3291da177e4SLinus Torvaldslex.%.c: %.l
330491d7110SRoman Zippel	flex -L -P$(notdir $*) -o$@ $<
331491d7110SRoman Zippel	cp $@ $@_shipped
3321da177e4SLinus Torvalds
3337a88488bSRoman Zippel%.hash.c: %.gperf
3347a88488bSRoman Zippel	gperf < $< > $@
3357a88488bSRoman Zippel	cp $@ $@_shipped
3367a88488bSRoman Zippel
3371da177e4SLinus Torvaldsendif
338