1 # ===========================================================================
2 # Kernel configuration targets
3 # These targets are used from top-level makefile
5 export LD_LIBRARY_PATH = scripts/kconfig
7 .PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig
10 $< arch/$(ARCH)/Kconfig
13 $< arch/$(ARCH)/Kconfig
15 menuconfig: $(obj)/mconf
16 $(Q)$(MAKE) $(build)=scripts/lxdialog
17 $< arch/$(ARCH)/Kconfig
20 $< arch/$(ARCH)/Kconfig
22 oldconfig: $(obj)/conf
23 $< -o arch/$(ARCH)/Kconfig
25 silentoldconfig: $(obj)/conf
26 $< -s arch/$(ARCH)/Kconfig
28 nonint_oldconfig: scripts/kconfig/conf
29 ./scripts/kconfig/conf -b arch/$(ARCH)/Kconfig
32 .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
34 randconfig: $(obj)/conf
35 $< -r arch/$(ARCH)/Kconfig
37 allyesconfig: $(obj)/conf
38 $< -y arch/$(ARCH)/Kconfig
40 allnoconfig: $(obj)/conf
41 $< -n arch/$(ARCH)/Kconfig
43 allmodconfig: $(obj)/conf
44 $< -m arch/$(ARCH)/Kconfig
46 defconfig: $(obj)/conf
47 ifeq ($(KBUILD_DEFCONFIG),)
48 $< -d arch/$(ARCH)/Kconfig
50 @echo *** Default configuration is based on '$(KBUILD_DEFCONFIG)'
51 $(Q)$< -D arch/$(ARCH)/configs/$(KBUILD_DEFCONFIG) arch/$(ARCH)/Kconfig
54 %_defconfig: $(obj)/conf
55 $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
57 # Help text used by make help
59 @echo ' oldconfig - Update current config utilising a line-oriented program'
60 @echo ' menuconfig - Update current config utilising a menu based program'
61 @echo ' xconfig - Update current config utilising a QT based front-end'
62 @echo ' gconfig - Update current config utilising a GTK based front-end'
63 @echo ' defconfig - New config with default answer to all options'
64 @echo ' allmodconfig - New config selecting modules when possible'
65 @echo ' allyesconfig - New config where all options are accepted with yes'
66 @echo ' allnoconfig - New minimal config'
68 # ===========================================================================
69 # Shared Makefile for the various kconfig executables:
70 # conf: Used for defconfig, oldconfig and related targets
71 # mconf: Used for the mconfig target.
72 # Utilizes the lxdialog package
73 # qconf: Used for the xconfig target
74 # Based on QT which needs to be installed to compile it
75 # gconf: Used for the gconfig target
76 # Based on GTK which needs to be installed to compile it
77 # object files used by all kconfig flavours
79 hostprogs-y := conf mconf qconf gconf
80 conf-objs := conf.o zconf.tab.o
81 mconf-objs := mconf.o zconf.tab.o
83 ifeq ($(MAKECMDGOALS),xconfig)
86 ifeq ($(MAKECMDGOALS),gconfig)
91 ifeq ($(qconf-target),1)
92 qconf-cxxobjs := qconf.o
93 qconf-objs := kconfig_load.o zconf.tab.o
96 ifeq ($(gconf-target),1)
97 gconf-objs := gconf.o kconfig_load.o zconf.tab.o
100 clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
101 .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c
103 # generated files seem to need this to find local include files
104 HOSTCFLAGS_lex.zconf.o := -I$(src)
105 HOSTCFLAGS_zconf.tab.o := -I$(src)
107 HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(QTLIB) -ldl
108 HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include -D LKC_DIRECT_LINK
110 HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
111 HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \
114 $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
116 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
118 ifeq ($(qconf-target),1)
119 MOC = $(QTDIR)/bin/moc
120 QTLIBPATH = $(QTDIR)/lib
121 -include $(obj)/.tmp_qtcheck
123 # QT needs some extra effort...
125 @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt* /usr/lib64/qt* ; do \
126 if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \
128 if [ -z "$$DIR" ]; then \
130 echo "* Unable to find the QT installation. Please make sure that the"; \
131 echo "* QT development package is correctly installed and the QTDIR"; \
132 echo "* environment variable is set to the correct location."; \
136 LIBPATH=$$DIR/lib; LIB=qt; \
137 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
138 LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \
139 if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \
140 echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \
141 echo "QTLIB=$$LIB" >> $@; \
142 if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \
144 echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \
146 echo "MOC=/usr/bin/moc" >> $@; \
150 $(obj)/gconf.o: $(obj)/.tmp_gtkcheck
152 ifeq ($(gconf-target),1)
153 -include $(obj)/.tmp_gtkcheck
155 # GTK needs some extra effort, too...
156 $(obj)/.tmp_gtkcheck:
157 @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \
158 if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \
162 echo "* GTK+ is present but version >= 2.0.0 is required."; \
168 echo "* Unable to find the GTK+ installation. Please make sure that"; \
169 echo "* the GTK+ 2.0 development package is correctly installed..."; \
170 echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
176 $(obj)/zconf.tab.o: $(obj)/lex.zconf.c
178 $(obj)/kconfig_load.o: $(obj)/lkc_defs.h
180 $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
182 $(obj)/gconf.o: $(obj)/lkc_defs.h
184 $(obj)/%.moc: $(src)/%.h
187 $(obj)/lkc_defs.h: $(src)/lkc_proto.h
188 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
192 # The following requires flex/bison
193 # By default we use the _shipped versions, uncomment the following line if
194 # you are modifying the flex/bison src.
199 $(obj)/zconf.tab.c: $(obj)/zconf.y
200 $(obj)/zconf.tab.h: $(obj)/zconf.tab.c
203 bison -t -d -v -b $* -p $(notdir $*) $<
206 flex -P$(notdir $*) -o$@ $<