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 nonint_oldconfig: scripts/kconfig/conf
27 ./scripts/kconfig/conf -b arch/$(ARCH)/Kconfig
30 .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
32 randconfig: $(obj)/conf
33 $< -r arch/$(ARCH)/Kconfig
35 allyesconfig: $(obj)/conf
36 $< -y arch/$(ARCH)/Kconfig
38 allnoconfig: $(obj)/conf
39 $< -n arch/$(ARCH)/Kconfig
41 allmodconfig: $(obj)/conf
42 $< -m arch/$(ARCH)/Kconfig
44 defconfig: $(obj)/conf
45 $< -d arch/$(ARCH)/Kconfig
47 %_defconfig: $(obj)/conf
48 $(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
50 # Help text used by make help
52 @echo ' oldconfig - Update current config utilising a line-oriented program'
53 @echo ' menuconfig - Update current config utilising a menu based program'
54 @echo ' xconfig - Update current config utilising a QT based front-end'
55 @echo ' gconfig - Update current config utilising a GTK based front-end'
56 @echo ' defconfig - New config with default answer to all options'
57 @echo ' allmodconfig - New config selecting modules when possible'
58 @echo ' allyesconfig - New config where all options are accepted with yes'
59 @echo ' allnoconfig - New minimal config'
61 # ===========================================================================
62 # Shared Makefile for the various kconfig executables:
63 # conf: Used for defconfig, oldconfig and related targets
64 # mconf: Used for the mconfig target.
65 # Utilizes the lxdialog package
66 # qconf: Used for the xconfig target
67 # Based on QT which needs to be installed to compile it
68 # gconf: Used for the gconfig target
69 # Based on GTK which needs to be installed to compile it
70 # object files used by all kconfig flavours
72 libkconfig-objs := zconf.tab.o
74 host-progs := conf mconf qconf gconf
76 mconf-objs := mconf.o libkconfig.so
78 ifeq ($(MAKECMDGOALS),xconfig)
81 ifeq ($(MAKECMDGOALS),gconfig)
86 ifeq ($(qconf-target),1)
87 qconf-cxxobjs := qconf.o
88 qconf-objs := kconfig_load.o
91 ifeq ($(gconf-target),1)
92 gconf-objs := gconf.o kconfig_load.o
95 clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \
96 .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c
98 # generated files seem to need this to find local include files
99 HOSTCFLAGS_lex.zconf.o := -I$(src)
100 HOSTCFLAGS_zconf.tab.o := -I$(src)
102 HOSTLOADLIBES_conf = -Wl,-rpath,\$$ORIGIN -Lscripts/kconfig -lkconfig
104 HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(QTLIB) -ldl
105 HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include
107 HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
108 HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags`
110 $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h $(obj)/libkconfig.so
112 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
114 ifeq ($(qconf-target),1)
115 MOC = $(QTDIR)/bin/moc
116 QTLIBPATH = $(QTDIR)/lib
117 -include $(obj)/.tmp_qtcheck
119 # QT needs some extra effort...
121 @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt* /usr/lib64/qt* ; do \
122 if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \
124 if [ -z "$$DIR" ]; then \
126 echo "* Unable to find the QT installation. Please make sure that the"; \
127 echo "* QT development package is correctly installed and the QTDIR"; \
128 echo "* environment variable is set to the correct location."; \
132 LIBPATH=$$DIR/lib; LIB=qt; \
133 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
134 LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \
135 if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \
136 echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \
137 echo "QTLIB=$$LIB" >> $@; \
138 if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \
140 echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \
142 echo "MOC=/usr/bin/moc" >> $@; \
146 $(obj)/gconf.o: $(obj)/.tmp_gtkcheck
148 ifeq ($(gconf-target),1)
149 -include $(obj)/.tmp_gtkcheck
151 # GTK needs some extra effort, too...
152 $(obj)/.tmp_gtkcheck:
153 @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \
154 if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \
158 echo "* GTK+ is present but version >= 2.0.0 is required."; \
164 echo "* Unable to find the GTK+ installation. Please make sure that"; \
165 echo "* the GTK+ 2.0 development package is correctly installed..."; \
166 echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \
172 $(obj)/zconf.tab.o: $(obj)/lex.zconf.c
174 $(obj)/kconfig_load.o: $(obj)/lkc_defs.h
176 $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
178 $(obj)/gconf.o: $(obj)/lkc_defs.h
180 $(obj)/%.moc: $(src)/%.h
183 $(obj)/lkc_defs.h: $(src)/lkc_proto.h
184 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
188 # The following requires flex/bison
189 # By default we use the _shipped versions, uncomment the following line if
190 # you are modifying the flex/bison src.
195 $(obj)/zconf.tab.c: $(obj)/zconf.y
196 $(obj)/zconf.tab.h: $(obj)/zconf.tab.c
199 bison -t -d -v -b $* -p $(notdir $*) $<
202 flex -P$(notdir $*) -o$@ $<