Blame view
scripts/kconfig/Makefile
10.5 KB
1da177e4c
|
1 2 3 |
# =========================================================================== # Kernel configuration targets # These targets are used from top-level makefile |
03fa25da8
|
4 |
PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \ |
281c9dadc
|
5 |
localmodconfig localyesconfig |
1da177e4c
|
6 |
|
61bee2044
|
7 8 9 |
ifdef KBUILD_KCONFIG Kconfig := $(KBUILD_KCONFIG) else |
838a2e55e
|
10 |
Kconfig := Kconfig |
61bee2044
|
11 |
endif |
e703f75d6
|
12 |
|
1da177e4c
|
13 |
xconfig: $(obj)/qconf |
e703f75d6
|
14 |
$< $(Kconfig) |
1da177e4c
|
15 16 |
gconfig: $(obj)/gconf |
e703f75d6
|
17 |
$< $(Kconfig) |
1da177e4c
|
18 19 |
menuconfig: $(obj)/mconf |
e703f75d6
|
20 |
$< $(Kconfig) |
1da177e4c
|
21 22 |
config: $(obj)/conf |
4062f1a4c
|
23 |
$< --oldaskconfig $(Kconfig) |
1da177e4c
|
24 |
|
692d97c38
|
25 26 |
nconfig: $(obj)/nconf $< $(Kconfig) |
1da177e4c
|
27 |
oldconfig: $(obj)/conf |
4062f1a4c
|
28 |
$< --$@ $(Kconfig) |
1da177e4c
|
29 30 |
silentoldconfig: $(obj)/conf |
32197c7ff
|
31 |
$(Q)mkdir -p include/generated |
4062f1a4c
|
32 |
$< --$@ $(Kconfig) |
1da177e4c
|
33 |
|
50bce3e80
|
34 |
localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
17263baf9
|
35 |
$(Q)mkdir -p include/generated |
22d550ae8
|
36 |
$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config |
7a996d3ab
|
37 |
$(Q)if [ -f .config ]; then \ |
4062f1a4c
|
38 39 40 41 42 43 44 45 |
cmp -s .tmp.config .config || \ (mv -f .config .config.old.1; \ mv -f .tmp.config .config; \ $(obj)/conf --silentoldconfig $(Kconfig); \ mv -f .config.old.1 .config.old) \ else \ mv -f .tmp.config .config; \ $(obj)/conf --silentoldconfig $(Kconfig); \ |
a7c02602a
|
46 |
fi |
03fa25da8
|
47 |
$(Q)rm -f .tmp.config |
1020026f9
|
48 |
# Create new linux.pot file |
b70e325cf
|
49 |
# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files |
46d263197
|
50 |
update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h |
e2aef4d33
|
51 |
$(Q)echo " GEN config.pot" |
a24a1b8e2
|
52 53 54 55 56 |
$(Q)xgettext --default-domain=linux \ --add-comments --keyword=_ --keyword=N_ \ --from-code=UTF-8 \ --files-from=$(srctree)/scripts/kconfig/POTFILES.in \ --directory=$(srctree) --directory=$(objtree) \ |
b70e325cf
|
57 58 |
--output $(obj)/config.pot $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot |
fa0ad6575
|
59 60 |
$(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ $(srctree)/arch/*/um/Kconfig`; \ |
1020026f9
|
61 |
do \ |
e2aef4d33
|
62 |
echo " GEN $$i"; \ |
4217516e5
|
63 |
$(obj)/kxgettext $$i \ |
1020026f9
|
64 65 |
>> $(obj)/config.pot; \ done ) |
e2aef4d33
|
66 |
$(Q)echo " GEN linux.pot" |
1020026f9
|
67 |
$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ |
b70e325cf
|
68 |
--output $(obj)/linux.pot |
b70e325cf
|
69 |
$(Q)rm -f $(obj)/config.pot |
3b9fa0931
|
70 |
|
0748cb3e1
|
71 |
PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig |
1da177e4c
|
72 |
|
0748cb3e1
|
73 |
allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf |
4062f1a4c
|
74 |
$< --$@ $(Kconfig) |
1da177e4c
|
75 |
|
7cf3d73b4
|
76 |
PHONY += listnewconfig oldnoconfig savedefconfig defconfig |
1da177e4c
|
77 |
|
861b4ea4c
|
78 |
listnewconfig oldnoconfig: $(obj)/conf |
4062f1a4c
|
79 |
$< --$@ $(Kconfig) |
1da177e4c
|
80 |
|
7cf3d73b4
|
81 82 |
savedefconfig: $(obj)/conf $< --$@=defconfig $(Kconfig) |
1da177e4c
|
83 84 |
defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) |
4062f1a4c
|
85 |
$< --defconfig $(Kconfig) |
1da177e4c
|
86 |
else |
2266cfd50
|
87 |
@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" |
4062f1a4c
|
88 |
$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) |
1da177e4c
|
89 90 91 |
endif %_defconfig: $(obj)/conf |
4062f1a4c
|
92 |
$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) |
1da177e4c
|
93 94 95 96 |
# Help text used by make help help: @echo ' config - Update current config utilising a line-oriented program' |
692d97c38
|
97 |
@echo ' nconfig - Update current config utilising a ncurses menu based program' |
1da177e4c
|
98 99 100 101 |
@echo ' menuconfig - Update current config utilising a menu based program' @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' @echo ' oldconfig - Update current config utilising a provided .config as base' |
03fa25da8
|
102 |
@echo ' localmodconfig - Update current config disabling modules not loaded' |
281c9dadc
|
103 |
@echo ' localyesconfig - Update current config converting local mods to core' |
590a58572
|
104 |
@echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' |
0748cb3e1
|
105 |
@echo ' defconfig - New config with default from ARCH supplied defconfig' |
7cf3d73b4
|
106 |
@echo ' savedefconfig - Save current config as ./defconfig (minimal config)' |
e11f04962
|
107 |
@echo ' allnoconfig - New config where all options are answered with no' |
0748cb3e1
|
108 109 110 111 |
@echo ' allyesconfig - New config where all options are accepted with yes' @echo ' allmodconfig - New config selecting modules when possible' @echo ' alldefconfig - New config with all symbols set to default' @echo ' randconfig - New config with random answer to all options' |
861b4ea4c
|
112 |
@echo ' listnewconfig - List new options' |
ef61ca88c
|
113 |
@echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' |
1da177e4c
|
114 |
|
2982de699
|
115 116 |
# lxdialog stuff check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh |
e9e40e143
|
117 |
# Use recursively expanded variables so we do not call gcc unless |
2982de699
|
118 |
# we really need to do so. (Do not call gcc as part of make mrproper) |
9ba956825
|
119 120 |
HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ -DLOCALE |
2982de699
|
121 |
|
1da177e4c
|
122 123 124 |
# =========================================================================== # Shared Makefile for the various kconfig executables: # conf: Used for defconfig, oldconfig and related targets |
692d97c38
|
125 126 |
# nconf: Used for the nconfig target. # Utilizes ncurses |
6f26e5e41
|
127 |
# mconf: Used for the menuconfig target |
1da177e4c
|
128 129 130 131 132 133 |
# Utilizes the lxdialog package # qconf: Used for the xconfig target # Based on QT which needs to be installed to compile it # gconf: Used for the gconfig target # Based on GTK which needs to be installed to compile it # object files used by all kconfig flavours |
2982de699
|
134 135 |
lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o |
1da177e4c
|
136 |
conf-objs := conf.o zconf.tab.o |
692d97c38
|
137 138 |
mconf-objs := mconf.o zconf.tab.o $(lxdialog) nconf-objs := nconf.o zconf.tab.o nconf.gui.o |
3b9fa0931
|
139 |
kxgettext-objs := kxgettext.o zconf.tab.o |
f19430496
|
140 |
qconf-cxxobjs := qconf.o |
5a6f8d2bd
|
141 142 |
qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o |
1da177e4c
|
143 |
|
d02ab886d
|
144 |
hostprogs-y := conf |
c29121b78
|
145 |
|
692d97c38
|
146 147 148 |
ifeq ($(MAKECMDGOALS),nconfig) hostprogs-y += nconf endif |
c29121b78
|
149 150 151 |
ifeq ($(MAKECMDGOALS),menuconfig) hostprogs-y += mconf endif |
1f594715b
|
152 153 154 |
ifeq ($(MAKECMDGOALS),update-po-config) hostprogs-y += kxgettext endif |
1da177e4c
|
155 156 157 158 159 160 161 162 163 |
ifeq ($(MAKECMDGOALS),xconfig) qconf-target := 1 endif ifeq ($(MAKECMDGOALS),gconfig) gconf-target := 1 endif ifeq ($(qconf-target),1) |
f19430496
|
164 |
hostprogs-y += qconf |
1da177e4c
|
165 166 167 |
endif ifeq ($(gconf-target),1) |
d02ab886d
|
168 |
hostprogs-y += gconf |
1da177e4c
|
169 |
endif |
5a6f8d2bd
|
170 |
clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck |
2f76b358f
|
171 |
clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h |
692d97c38
|
172 |
clean-files += mconf qconf gconf nconf |
1020026f9
|
173 |
clean-files += config.pot linux.pot |
1da177e4c
|
174 |
|
6e588f6dc
|
175 176 177 178 |
# Check that we have the required ncurses stuff installed for lxdialog (menuconfig) PHONY += $(obj)/dochecklxdialog $(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog $(obj)/dochecklxdialog: |
7080e47bb
|
179 |
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) |
6e588f6dc
|
180 181 |
always := dochecklxdialog |
aa1e5ef5c
|
182 183 |
# Add environment specific flags HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) |
70a6a0cb9
|
184 |
|
1da177e4c
|
185 |
# generated files seem to need this to find local include files |
2f76b358f
|
186 |
HOSTCFLAGS_zconf.lex.o := -I$(src) |
1da177e4c
|
187 |
HOSTCFLAGS_zconf.tab.o := -I$(src) |
378dbb2cf
|
188 189 |
LEX_PREFIX_zconf := zconf YACC_PREFIX_zconf := zconf |
5a6f8d2bd
|
190 191 |
HOSTLOADLIBES_qconf = $(KC_QT_LIBS) HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) |
1da177e4c
|
192 |
|
5a6f8d2bd
|
193 |
HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` |
371931479
|
194 |
HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ |
1ea3ad4e9
|
195 |
-Wno-missing-prototypes |
1da177e4c
|
196 |
|
7080e47bb
|
197 |
HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) |
692d97c38
|
198 |
HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses |
1da177e4c
|
199 200 201 |
$(obj)/qconf.o: $(obj)/.tmp_qtcheck ifeq ($(qconf-target),1) |
b3a5225f3
|
202 |
$(obj)/.tmp_qtcheck: $(src)/Makefile |
1da177e4c
|
203 204 205 206 |
-include $(obj)/.tmp_qtcheck # QT needs some extra effort... $(obj)/.tmp_qtcheck: |
b3a5225f3
|
207 |
@set -e; echo " CHECK qt"; dir=""; pkg=""; \ |
133c5f7c1
|
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
if ! pkg-config --exists QtCore 2> /dev/null; then \ echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ pkg-config --exists qt 2> /dev/null && pkg=qt; \ pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ if [ -n "$$pkg" ]; then \ cflags="\$$(shell pkg-config $$pkg --cflags)"; \ libs="\$$(shell pkg-config $$pkg --libs)"; \ moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ dir="$$(pkg-config $$pkg --variable=prefix)"; \ else \ for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ done; \ if [ -z "$$dir" ]; then \ echo "*"; \ echo "* Unable to find any QT installation. Please make sure that"; \ echo "* the QT4 or QT3 development package is correctly installed and"; \ echo "* either qmake can be found or install pkg-config or set"; \ echo "* the QTDIR environment variable to the correct location."; \ echo "*"; \ false; \ fi; \ libpath=$$dir/lib; lib=qt; osdir=""; \ $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ test -f $$libpath/libqt-mt.so && lib=qt-mt; \ cflags="-I$$dir/include"; \ libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ moc="$$dir/bin/moc"; \ fi; \ if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ echo "*"; \ echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ echo "*"; \ moc="/usr/bin/moc"; \ fi; \ |
ab919c061
|
245 |
else \ |
458452f4a
|
246 247 |
cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ |
20f4ad8a1
|
248 249 |
binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ moc="$$binpath/bin/moc"; \ |
b3a5225f3
|
250 251 252 253 |
fi; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ echo "KC_QT_MOC=$$moc" >> $@ |
1da177e4c
|
254 255 256 257 258 259 260 261 262 |
endif $(obj)/gconf.o: $(obj)/.tmp_gtkcheck ifeq ($(gconf-target),1) -include $(obj)/.tmp_gtkcheck # GTK needs some extra effort, too... $(obj)/.tmp_gtkcheck: |
371931479
|
263 264 |
@if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \ if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ |
1da177e4c
|
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
touch $@; \ else \ echo "*"; \ echo "* GTK+ is present but version >= 2.0.0 is required."; \ echo "*"; \ false; \ fi \ else \ echo "*"; \ echo "* Unable to find the GTK+ installation. Please make sure that"; \ echo "* the GTK+ 2.0 development package is correctly installed..."; \ echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ echo "*"; \ false; \ fi endif |
2f76b358f
|
281 |
$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c |
1da177e4c
|
282 |
|
5a6f8d2bd
|
283 |
$(obj)/qconf.o: $(obj)/qconf.moc |
1da177e4c
|
284 285 |
$(obj)/%.moc: $(src)/%.h |
b3a5225f3
|
286 |
$(KC_QT_MOC) -i $< -o $@ |
1da177e4c
|
287 |
|
46d263197
|
288 289 |
# Extract gconf menu items for I18N support $(obj)/gconf.glade.h: $(obj)/gconf.glade |
2d80eb0fa
|
290 |
$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \ |
a24a1b8e2
|
291 |
$(obj)/gconf.glade |
1da177e4c
|
292 |