1 # ===========================================================================
2 # Kernel configuration targets
3 # These targets are used from top-level makefile
5 .PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig
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 .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
28 randconfig: $(obj)/conf
29 $< -r arch/$(ARCH)/Kconfig
31 allyesconfig: $(obj)/conf
32 $< -y arch/$(ARCH)/Kconfig
34 allnoconfig: $(obj)/conf
35 $< -n arch/$(ARCH)/Kconfig
37 allmodconfig: $(obj)/conf
38 $< -m arch/$(ARCH)/Kconfig
40 defconfig: $(obj)/conf
41 $< -d arch/$(ARCH)/Kconfig
43 %_defconfig: $(obj)/conf
44 $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
46 # Help text used by make help
48 @echo ' oldconfig - Update current config utilising a line-oriented program'
49 @echo ' menuconfig - Update current config utilising a menu based program'
50 @echo ' xconfig - Update current config utilising a QT based front-end'
51 @echo ' gconfig - Update current config utilising a GTK based front-end'
52 @echo ' defconfig - New config with default answer to all options'
53 @echo ' allmodconfig - New config selecting modules when possible'
54 @echo ' allyesconfig - New config where all options are accepted with yes'
55 @echo ' allnoconfig - New minimal config'
57 # ===========================================================================
58 # Shared Makefile for the various kconfig executables:
59 # conf: Used for defconfig, oldconfig and related targets
60 # mconf: Used for the mconfig target.
61 # Utilizes the lxdialog package
62 # qconf: Used for the xconfig target
63 # Based on QT which needs to be installed to compile it
64 # gconf: Used for the gconfig target
65 # Based on GTK which needs to be installed to compile it
66 # object files used by all kconfig flavours
68 libkconfig-objs := zconf.tab.o
70 host-progs := conf mconf qconf gconf
71 conf-objs := conf.o libkconfig.so
72 mconf-objs := mconf.o libkconfig.so
74 ifeq ($(MAKECMDGOALS),xconfig)
77 ifeq ($(MAKECMDGOALS),gconfig)
82 ifeq ($(qconf-target),1)
83 qconf-cxxobjs := qconf.o
84 qconf-objs := kconfig_load.o
87 ifeq ($(gconf-target),1)
88 gconf-objs := gconf.o kconfig_load.o
91 clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \
92 .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c
94 # generated files seem to need this to find local include files
95 HOSTCFLAGS_lex.zconf.o := -I$(src)
96 HOSTCFLAGS_zconf.tab.o := -I$(src)
98 HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(QTLIB) -ldl
99 HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include
101 HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
102 HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags`
104 $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
106 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
108 ifeq ($(qconf-target),1)
109 MOC = $(QTDIR)/bin/moc
110 QTLIBPATH = $(QTDIR)/lib
111 -include $(obj)/.tmp_qtcheck
113 # QT needs some extra effort...
115 @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
116 if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \
118 if [ -z "$$DIR" ]; then \
120 echo "* Unable to find the QT installation. Please make sure that the"; \
121 echo "* QT development package is correctly installed and the QTDIR"; \
122 echo "* environment variable is set to the correct location."; \
126 LIBPATH=$$DIR/lib; LIB=qt; \
127 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
128 LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \
129 if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \
130 echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \
131 echo "QTLIB=$$LIB" >> $@; \
132 if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \
134 echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \
136 echo "MOC=/usr/bin/moc" >> $@; \
140 $(obj)/gconf.o: $(obj)/.tmp_gtkcheck
142 ifeq ($(gconf-target),1)
143 -include $(obj)/.tmp_gtkcheck
145 # GTK needs some extra effort, too...
146 $(obj)/.tmp_gtkcheck:
147 @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \
148 if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \
152 echo "* GTK+ is present but version >= 2.0.0 is required."; \
158 echo "* Unable to find the GTK+ installation. Please make sure that"; \
159 echo "* the GTK+ 2.0 development package is correctly installed..."; \
160 echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
166 $(obj)/zconf.tab.o: $(obj)/lex.zconf.c
168 $(obj)/kconfig_load.o: $(obj)/lkc_defs.h
170 $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
172 $(obj)/gconf.o: $(obj)/lkc_defs.h
174 $(obj)/%.moc: $(src)/%.h
177 $(obj)/lkc_defs.h: $(src)/lkc_proto.h
178 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
182 # The following requires flex/bison
183 # By default we use the _shipped versions, uncomment the following line if
184 # you are modifying the flex/bison src.
189 $(obj)/zconf.tab.c: $(obj)/zconf.y
190 $(obj)/zconf.tab.h: $(obj)/zconf.tab.c
193 bison -t -d -v -b $* -p $(notdir $*) $<
196 flex -P$(notdir $*) -o$@ $<