1 # ===========================================================================
2 # Kernel configuration targets
3 # These targets are used from top-level makefile
5 .PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
8 $< arch/$(ARCH)/Kconfig
11 $< arch/$(ARCH)/Kconfig
13 menuconfig: $(obj)/mconf
14 $(Q)$(MAKE) $(build)=scripts/lxdialog
15 $< arch/$(ARCH)/Kconfig
18 $< arch/$(ARCH)/Kconfig
20 oldconfig: $(obj)/conf
21 $< -o arch/$(ARCH)/Kconfig
23 silentoldconfig: $(obj)/conf
24 $< -s arch/$(ARCH)/Kconfig
26 update-po-config: $(obj)/kxgettext
27 xgettext --default-domain=linux \
28 --add-comments --keyword=_ --keyword=N_ \
29 --files-from=scripts/kconfig/POTFILES.in \
30 -o scripts/kconfig/linux.pot
31 scripts/kconfig/kxgettext arch/$(ARCH)/Kconfig >> scripts/kconfig/linux.pot
33 nonint_oldconfig: scripts/kconfig/conf
34 ./scripts/kconfig/conf -b arch/$(ARCH)/Kconfig
37 .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
39 randconfig: $(obj)/conf
40 $< -r arch/$(ARCH)/Kconfig
42 allyesconfig: $(obj)/conf
43 $< -y arch/$(ARCH)/Kconfig
45 allnoconfig: $(obj)/conf
46 $< -n arch/$(ARCH)/Kconfig
48 allmodconfig: $(obj)/conf
49 $< -m arch/$(ARCH)/Kconfig
51 defconfig: $(obj)/conf
52 ifeq ($(KBUILD_DEFCONFIG),)
53 $< -d arch/$(ARCH)/Kconfig
55 @echo *** Default configuration is based on '$(KBUILD_DEFCONFIG)'
56 $(Q)$< -D arch/$(ARCH)/configs/$(KBUILD_DEFCONFIG) arch/$(ARCH)/Kconfig
59 %_defconfig: $(obj)/conf
60 $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
62 # Help text used by make help
64 @echo ' config - Update current config utilising a line-oriented program'
65 @echo ' menuconfig - Update current config utilising a menu based program'
66 @echo ' xconfig - Update current config utilising a QT based front-end'
67 @echo ' gconfig - Update current config utilising a GTK based front-end'
68 @echo ' oldconfig - Update current config utilising a provided .config as base'
69 @echo ' randconfig - New config with random answer to all options'
70 @echo ' defconfig - New config with default answer to all options'
71 @echo ' allmodconfig - New config selecting modules when possible'
72 @echo ' allyesconfig - New config where all options are accepted with yes'
73 @echo ' allnoconfig - New minimal config'
75 # ===========================================================================
76 # Shared Makefile for the various kconfig executables:
77 # conf: Used for defconfig, oldconfig and related targets
78 # mconf: Used for the mconfig target.
79 # Utilizes the lxdialog package
80 # qconf: Used for the xconfig target
81 # Based on QT which needs to be installed to compile it
82 # gconf: Used for the gconfig target
83 # Based on GTK which needs to be installed to compile it
84 # object files used by all kconfig flavours
86 hostprogs-y := conf mconf qconf gconf kxgettext
87 conf-objs := conf.o zconf.tab.o
88 mconf-objs := mconf.o zconf.tab.o
89 kxgettext-objs := kxgettext.o zconf.tab.o
91 ifeq ($(MAKECMDGOALS),xconfig)
94 ifeq ($(MAKECMDGOALS),gconfig)
99 ifeq ($(qconf-target),1)
100 qconf-cxxobjs := qconf.o
101 qconf-objs := kconfig_load.o zconf.tab.o
104 ifeq ($(gconf-target),1)
105 gconf-objs := gconf.o kconfig_load.o zconf.tab.o
108 clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
109 .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c
111 # generated files seem to need this to find local include files
112 HOSTCFLAGS_lex.zconf.o := -I$(src)
113 HOSTCFLAGS_zconf.tab.o := -I$(src)
115 HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(QTLIB) -ldl
116 HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include -D LKC_DIRECT_LINK
118 HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
119 HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \
122 $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h
124 $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
125 $(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
126 $(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped
128 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
130 ifeq ($(qconf-target),1)
131 MOC = $(QTDIR)/bin/moc
132 QTLIBPATH = $(QTDIR)/lib
133 -include $(obj)/.tmp_qtcheck
135 # QT needs some extra effort...
137 @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt* /usr/lib64/qt* ; do \
138 if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \
140 if [ -z "$$DIR" ]; then \
142 echo "* Unable to find the QT installation. Please make sure that the"; \
143 echo "* QT development package is correctly installed and the QTDIR"; \
144 echo "* environment variable is set to the correct location."; \
148 LIBPATH=$$DIR/lib; LIB=qt; \
149 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
150 LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \
151 if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \
152 echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \
153 echo "QTLIB=$$LIB" >> $@; \
154 if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \
156 echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \
158 echo "MOC=/usr/bin/moc" >> $@; \
162 $(obj)/gconf.o: $(obj)/.tmp_gtkcheck
164 ifeq ($(gconf-target),1)
165 -include $(obj)/.tmp_gtkcheck
167 # GTK needs some extra effort, too...
168 $(obj)/.tmp_gtkcheck:
169 @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \
170 if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \
174 echo "* GTK+ is present but version >= 2.0.0 is required."; \
180 echo "* Unable to find the GTK+ installation. Please make sure that"; \
181 echo "* the GTK+ 2.0 development package is correctly installed..."; \
182 echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
188 $(obj)/zconf.tab.o: $(obj)/lex.zconf.c
190 $(obj)/kconfig_load.o: $(obj)/lkc_defs.h
192 $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
194 $(obj)/gconf.o: $(obj)/lkc_defs.h
196 $(obj)/%.moc: $(src)/%.h
199 $(obj)/lkc_defs.h: $(src)/lkc_proto.h
200 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
204 # The following requires flex/bison
205 # By default we use the _shipped versions, uncomment the following line if
206 # you are modifying the flex/bison src.
211 $(obj)/zconf.tab.c: $(obj)/zconf.y
212 $(obj)/zconf.tab.h: $(obj)/zconf.tab.c
215 bison -t -d -v -b $* -p $(notdir $*) $<
218 flex -P$(notdir $*) -o$@ $<