1 # ===========================================================================
2 # Kernel configuration targets
3 # These targets are used from top-level makefile
5 .PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig \
9 $< arch/$(ARCH)/Kconfig
12 $< arch/$(ARCH)/Kconfig
14 menuconfig: $(obj)/mconf
15 $(Q)$(MAKE) $(build)=scripts/lxdialog
16 $< arch/$(ARCH)/Kconfig
19 $< arch/$(ARCH)/Kconfig
21 oldconfig: $(obj)/conf
22 $< -o arch/$(ARCH)/Kconfig
24 silentoldconfig: $(obj)/conf
25 $< -s arch/$(ARCH)/Kconfig
27 check_CONFIG_IKCONFIG_PROC:
28 $(Q)if ! [ -f /proc/config.gz ]; then \
29 echo "Running kernel compiled without CONFIG_IKCONFIG_PROC"; \
33 _cloneconfig: check_CONFIG_IKCONFIG_PROC
34 $(Q)gzip -cd /proc/config.gz > $(objtree)/.config
35 cloneconfig: _cloneconfig oldconfig
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: check_CONFIG_IKCONFIG_PROC
52 $(Q)eval "$$(gzip -cd /proc/config.gz)"; \
53 config=$(srctree)/arch/$(ARCH)/defconfig.$$CONFIG_CFGNAME; \
54 if ! [ -e $$config ]; then \
55 echo "Config file $$config not found"; \
58 cp $$config $(objtree)/.config
59 defconfig: _defconfig oldconfig
61 # Help text used by make help
63 @echo ' oldconfig - Update current config utilising a line-oriented program'
64 @echo ' cloneconfig - Update current config to the contents of /proc/config.gz'
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 ' defconfig - New config with default answer to all options'
69 @echo ' allmodconfig - New config selecting modules when possible'
70 @echo ' allyesconfig - New config where all options are accepted with yes'
71 @echo ' allnoconfig - New minimal config'
73 # ===========================================================================
74 # Shared Makefile for the various kconfig executables:
75 # conf: Used for defconfig, oldconfig and related targets
76 # mconf: Used for the mconfig target.
77 # Utilizes the lxdialog package
78 # qconf: Used for the xconfig target
79 # Based on QT which needs to be installed to compile it
80 # gconf: Used for the gconfig target
81 # Based on GTK which needs to be installed to compile it
82 # object files used by all kconfig flavours
84 libkconfig-objs := zconf.tab.o
86 host-progs := conf mconf qconf gconf
87 conf-objs := conf.o libkconfig.so
88 mconf-objs := mconf.o libkconfig.so
90 ifeq ($(MAKECMDGOALS),xconfig)
93 ifeq ($(MAKECMDGOALS),gconfig)
98 ifeq ($(qconf-target),1)
99 qconf-cxxobjs := qconf.o
100 qconf-objs := kconfig_load.o
103 ifeq ($(gconf-target),1)
104 gconf-objs := gconf.o kconfig_load.o
107 clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \
108 .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c
110 # generated files seem to need this to find local include files
111 HOSTCFLAGS_lex.zconf.o := -I$(src)
112 HOSTCFLAGS_zconf.tab.o := -I$(src)
114 HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(QTLIB) -ldl
115 HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include
117 HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
118 HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags`
120 $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
122 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
124 ifeq ($(qconf-target),1)
125 MOC = $(QTDIR)/bin/moc
126 QTLIBPATH = $(QTDIR)/lib
127 -include $(obj)/.tmp_qtcheck
129 # QT needs some extra effort...
131 @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
132 if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \
134 if [ -z "$$DIR" ]; then \
136 echo "* Unable to find the QT installation. Please make sure that the"; \
137 echo "* QT development package is correctly installed and the QTDIR"; \
138 echo "* environment variable is set to the correct location."; \
142 LIBPATH=$$DIR/lib; LIB=qt; \
143 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
144 LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \
145 if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \
146 echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \
147 echo "QTLIB=$$LIB" >> $@; \
148 if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \
150 echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \
152 echo "MOC=/usr/bin/moc" >> $@; \
156 $(obj)/gconf.o: $(obj)/.tmp_gtkcheck
158 ifeq ($(gconf-target),1)
159 -include $(obj)/.tmp_gtkcheck
161 # GTK needs some extra effort, too...
162 $(obj)/.tmp_gtkcheck:
163 @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \
164 if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \
168 echo "* GTK+ is present but version >= 2.0.0 is required."; \
174 echo "* Unable to find the GTK+ installation. Please make sure that"; \
175 echo "* the GTK+ 2.0 development package is correctly installed..."; \
176 echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
182 $(obj)/zconf.tab.o: $(obj)/lex.zconf.c
184 $(obj)/kconfig_load.o: $(obj)/lkc_defs.h
186 $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
188 $(obj)/gconf.o: $(obj)/lkc_defs.h
190 $(obj)/%.moc: $(src)/%.h
193 $(obj)/lkc_defs.h: $(src)/lkc_proto.h
194 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
198 # The following requires flex/bison
199 # By default we use the _shipped versions, uncomment the following line if
200 # you are modifying the flex/bison src.
205 $(obj)/zconf.tab.c: $(obj)/zconf.y
206 $(obj)/zconf.tab.h: $(obj)/zconf.tab.c
209 bison -t -d -v -b $* -p $(notdir $*) $<
212 flex -P$(notdir $*) -o$@ $<