Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 1 | # =========================================================================== |
| 2 | # Kernel configuration targets |
| 3 | # These targets are used from top-level makefile |
Tom Rini | da58dec | 2015-11-10 01:06:16 +0000 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: GPL-2.0 |
| 6 | # |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 7 | |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 8 | PHONY += xconfig gconfig menuconfig config silentoldconfig update-po-config \ |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 9 | localmodconfig localyesconfig |
| 10 | |
Masahiro Yamada | 5f9eb22 | 2015-03-13 18:08:55 +0900 | [diff] [blame] | 11 | # Added for U-Boot |
| 12 | # Linux has defconfig files in arch/$(SRCARCH)/configs/, |
| 13 | # on the other hand, U-Boot does in configs/. |
| 14 | # Set SRCARCH to .. fake this Makefile. |
| 15 | SRCARCH := .. |
| 16 | |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 17 | ifdef KBUILD_KCONFIG |
| 18 | Kconfig := $(KBUILD_KCONFIG) |
| 19 | else |
| 20 | Kconfig := Kconfig |
| 21 | endif |
| 22 | |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 23 | ifeq ($(quiet),silent_) |
| 24 | silent := -s |
| 25 | endif |
| 26 | |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 27 | # We need this, in case the user has it in its environment |
| 28 | unexport CONFIG_ |
| 29 | |
| 30 | xconfig: $(obj)/qconf |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 31 | $< $(silent) $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 32 | |
| 33 | gconfig: $(obj)/gconf |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 34 | $< $(silent) $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 35 | |
| 36 | menuconfig: $(obj)/mconf |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 37 | $< $(silent) $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 38 | |
| 39 | config: $(obj)/conf |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 40 | $< $(silent) --oldaskconfig $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 41 | |
| 42 | nconfig: $(obj)/nconf |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 43 | $< $(silent) $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 44 | |
| 45 | silentoldconfig: $(obj)/conf |
| 46 | $(Q)mkdir -p include/config include/generated |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 47 | $(Q)test -e include/generated/autoksyms.h || \ |
| 48 | touch include/generated/autoksyms.h |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 49 | $< $(silent) --$@ $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 50 | |
| 51 | localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
| 52 | $(Q)mkdir -p include/config include/generated |
| 53 | $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config |
| 54 | $(Q)if [ -f .config ]; then \ |
| 55 | cmp -s .tmp.config .config || \ |
| 56 | (mv -f .config .config.old.1; \ |
| 57 | mv -f .tmp.config .config; \ |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 58 | $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \ |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 59 | mv -f .config.old.1 .config.old) \ |
| 60 | else \ |
| 61 | mv -f .tmp.config .config; \ |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 62 | $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \ |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 63 | fi |
| 64 | $(Q)rm -f .tmp.config |
| 65 | |
| 66 | # Create new linux.pot file |
| 67 | # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files |
| 68 | update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 69 | $(Q)$(kecho) " GEN config.pot" |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 70 | $(Q)xgettext --default-domain=linux \ |
| 71 | --add-comments --keyword=_ --keyword=N_ \ |
| 72 | --from-code=UTF-8 \ |
| 73 | --files-from=$(srctree)/scripts/kconfig/POTFILES.in \ |
| 74 | --directory=$(srctree) --directory=$(objtree) \ |
| 75 | --output $(obj)/config.pot |
| 76 | $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot |
| 77 | $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ |
| 78 | $(srctree)/arch/*/um/Kconfig`; \ |
| 79 | do \ |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 80 | $(kecho) " GEN $$i"; \ |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 81 | $(obj)/kxgettext $$i \ |
| 82 | >> $(obj)/config.pot; \ |
| 83 | done ) |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 84 | $(Q)$(kecho) " GEN linux.pot" |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 85 | $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ |
| 86 | --output $(obj)/linux.pot |
| 87 | $(Q)rm -f $(obj)/config.pot |
| 88 | |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 89 | # These targets map 1:1 to the commandline options of 'conf' |
| 90 | simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ |
| 91 | alldefconfig randconfig listnewconfig olddefconfig |
| 92 | PHONY += $(simple-targets) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 93 | |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 94 | $(simple-targets): $(obj)/conf |
| 95 | $< $(silent) --$@ $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 96 | |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 97 | PHONY += oldnoconfig savedefconfig defconfig |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 98 | |
| 99 | # oldnoconfig is an alias of olddefconfig, because people already are dependent |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 100 | # on its behavior (sets new symbols to their default value but not 'n') with the |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 101 | # counter-intuitive name. |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 102 | oldnoconfig: olddefconfig |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 103 | |
| 104 | savedefconfig: $(obj)/conf |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 105 | $< $(silent) --$@=defconfig $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 106 | |
| 107 | defconfig: $(obj)/conf |
| 108 | ifeq ($(KBUILD_DEFCONFIG),) |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 109 | $< $(silent) --defconfig $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 110 | else |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 111 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),) |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 112 | @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" |
| 113 | $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 114 | else |
| 115 | @$(kecho) "*** Default configuration is based on target '$(KBUILD_DEFCONFIG)'" |
| 116 | $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG) |
| 117 | endif |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 118 | endif |
| 119 | |
| 120 | %_defconfig: $(obj)/conf |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 121 | $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 122 | |
Masahiro Yamada | 5f9eb22 | 2015-03-13 18:08:55 +0900 | [diff] [blame] | 123 | # Added for U-Boot (backward compatibility) |
| 124 | %_config: %_defconfig |
| 125 | @: |
| 126 | |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 127 | configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@) |
Masahiro Yamada | ad61899 | 2014-10-30 11:06:12 +0900 | [diff] [blame] | 128 | |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 129 | %.config: $(obj)/conf |
| 130 | $(if $(call configfiles),, $(error No configuration exists for this target on this architecture)) |
| 131 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles) |
| 132 | +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig |
Masahiro Yamada | ad61899 | 2014-10-30 11:06:12 +0900 | [diff] [blame] | 133 | |
| 134 | PHONY += kvmconfig |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 135 | kvmconfig: kvm_guest.config |
| 136 | @: |
Masahiro Yamada | ad61899 | 2014-10-30 11:06:12 +0900 | [diff] [blame] | 137 | |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 138 | PHONY += xenconfig |
| 139 | xenconfig: xen.config |
| 140 | @: |
| 141 | |
Masahiro Yamada | ad61899 | 2014-10-30 11:06:12 +0900 | [diff] [blame] | 142 | PHONY += tinyconfig |
Masahiro Yamada | 9b5f0b1 | 2015-07-05 01:56:54 +0900 | [diff] [blame] | 143 | tinyconfig: |
| 144 | $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config |
Masahiro Yamada | ad61899 | 2014-10-30 11:06:12 +0900 | [diff] [blame] | 145 | |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 146 | # Help text used by make help |
| 147 | help: |
| 148 | @echo ' config - Update current config utilising a line-oriented program' |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 149 | @echo ' nconfig - Update current config utilising a ncurses menu based' |
| 150 | @echo ' program' |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 151 | @echo ' menuconfig - Update current config utilising a menu based program' |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 152 | @echo ' xconfig - Update current config utilising a Qt based front-end' |
| 153 | @echo ' gconfig - Update current config utilising a GTK+ based front-end' |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 154 | @echo ' oldconfig - Update current config utilising a provided .config as base' |
| 155 | @echo ' localmodconfig - Update current config disabling modules not loaded' |
| 156 | @echo ' localyesconfig - Update current config converting local mods to core' |
| 157 | @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' |
| 158 | @echo ' defconfig - New config with default from ARCH supplied defconfig' |
| 159 | @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' |
| 160 | @echo ' allnoconfig - New config where all options are answered with no' |
| 161 | @echo ' allyesconfig - New config where all options are accepted with yes' |
| 162 | @echo ' allmodconfig - New config selecting modules when possible' |
| 163 | @echo ' alldefconfig - New config with all symbols set to default' |
| 164 | @echo ' randconfig - New config with random answer to all options' |
| 165 | @echo ' listnewconfig - List new options' |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 166 | @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their' |
| 167 | @echo ' default value' |
| 168 | # @echo ' kvmconfig - Enable additional options for kvm guest kernel support' |
| 169 | # @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support' |
Masahiro Yamada | ad61899 | 2014-10-30 11:06:12 +0900 | [diff] [blame] | 170 | # @echo ' tinyconfig - Configure the tiniest possible kernel' |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 171 | |
| 172 | # lxdialog stuff |
| 173 | check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh |
| 174 | |
| 175 | # Use recursively expanded variables so we do not call gcc unless |
| 176 | # we really need to do so. (Do not call gcc as part of make mrproper) |
| 177 | HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ |
| 178 | -DLOCALE |
| 179 | |
| 180 | # =========================================================================== |
| 181 | # Shared Makefile for the various kconfig executables: |
| 182 | # conf: Used for defconfig, oldconfig and related targets |
| 183 | # nconf: Used for the nconfig target. |
| 184 | # Utilizes ncurses |
| 185 | # mconf: Used for the menuconfig target |
| 186 | # Utilizes the lxdialog package |
| 187 | # qconf: Used for the xconfig target |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 188 | # Based on Qt which needs to be installed to compile it |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 189 | # gconf: Used for the gconfig target |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 190 | # Based on GTK+ which needs to be installed to compile it |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 191 | # object files used by all kconfig flavours |
| 192 | |
| 193 | lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o |
| 194 | lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o |
| 195 | |
| 196 | conf-objs := conf.o zconf.tab.o |
| 197 | mconf-objs := mconf.o zconf.tab.o $(lxdialog) |
| 198 | nconf-objs := nconf.o zconf.tab.o nconf.gui.o |
| 199 | kxgettext-objs := kxgettext.o zconf.tab.o |
| 200 | qconf-cxxobjs := qconf.o |
| 201 | qconf-objs := zconf.tab.o |
| 202 | gconf-objs := gconf.o zconf.tab.o |
| 203 | |
Masahiro Yamada | cb6e7b0 | 2014-10-30 11:06:10 +0900 | [diff] [blame] | 204 | hostprogs-y := conf nconf mconf kxgettext qconf gconf |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 205 | |
| 206 | clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck |
| 207 | clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 208 | clean-files += config.pot linux.pot |
| 209 | |
| 210 | # Check that we have the required ncurses stuff installed for lxdialog (menuconfig) |
| 211 | PHONY += $(obj)/dochecklxdialog |
| 212 | $(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog |
| 213 | $(obj)/dochecklxdialog: |
| 214 | $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) |
| 215 | |
| 216 | always := dochecklxdialog |
| 217 | |
| 218 | # Add environment specific flags |
| 219 | HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) |
| 220 | |
| 221 | # generated files seem to need this to find local include files |
| 222 | HOSTCFLAGS_zconf.lex.o := -I$(src) |
| 223 | HOSTCFLAGS_zconf.tab.o := -I$(src) |
| 224 | |
| 225 | LEX_PREFIX_zconf := zconf |
| 226 | YACC_PREFIX_zconf := zconf |
| 227 | |
| 228 | HOSTLOADLIBES_qconf = $(KC_QT_LIBS) |
| 229 | HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) |
| 230 | |
| 231 | HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` |
| 232 | HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ |
| 233 | -Wno-missing-prototypes |
| 234 | |
| 235 | HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) |
| 236 | |
| 237 | HOSTLOADLIBES_nconf = $(shell \ |
Masahiro Yamada | ad61899 | 2014-10-30 11:06:12 +0900 | [diff] [blame] | 238 | pkg-config --libs menuw panelw ncursesw 2>/dev/null \ |
| 239 | || pkg-config --libs menu panel ncurses 2>/dev/null \ |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 240 | || echo "-lmenu -lpanel -lncurses" ) |
| 241 | $(obj)/qconf.o: $(obj)/.tmp_qtcheck |
| 242 | |
Masahiro Yamada | cb6e7b0 | 2014-10-30 11:06:10 +0900 | [diff] [blame] | 243 | ifeq ($(MAKECMDGOALS),xconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 244 | $(obj)/.tmp_qtcheck: $(src)/Makefile |
| 245 | -include $(obj)/.tmp_qtcheck |
| 246 | |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 247 | # Qt needs some extra effort... |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 248 | $(obj)/.tmp_qtcheck: |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 249 | @set -e; $(kecho) " CHECK qt"; \ |
| 250 | if pkg-config --exists Qt5Core; then \ |
| 251 | cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \ |
| 252 | libs=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \ |
| 253 | moc=`pkg-config --variable=host_bins Qt5Core`/moc; \ |
| 254 | elif pkg-config --exists QtCore; then \ |
| 255 | cflags=`pkg-config --cflags QtCore QtGui`; \ |
| 256 | libs=`pkg-config --libs QtCore QtGui`; \ |
| 257 | moc=`pkg-config --variable=moc_location QtCore`; \ |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 258 | else \ |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 259 | echo >&2 "*"; \ |
| 260 | echo >&2 "* Could not find Qt via pkg-config."; \ |
| 261 | echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \ |
| 262 | echo >&2 "*"; \ |
| 263 | exit 1; \ |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 264 | fi; \ |
| 265 | echo "KC_QT_CFLAGS=$$cflags" > $@; \ |
| 266 | echo "KC_QT_LIBS=$$libs" >> $@; \ |
| 267 | echo "KC_QT_MOC=$$moc" >> $@ |
| 268 | endif |
| 269 | |
| 270 | $(obj)/gconf.o: $(obj)/.tmp_gtkcheck |
| 271 | |
Masahiro Yamada | cb6e7b0 | 2014-10-30 11:06:10 +0900 | [diff] [blame] | 272 | ifeq ($(MAKECMDGOALS),gconfig) |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 273 | -include $(obj)/.tmp_gtkcheck |
| 274 | |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 275 | # GTK+ needs some extra effort, too... |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 276 | $(obj)/.tmp_gtkcheck: |
| 277 | @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \ |
| 278 | if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ |
| 279 | touch $@; \ |
| 280 | else \ |
| 281 | echo >&2 "*"; \ |
| 282 | echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \ |
| 283 | echo >&2 "*"; \ |
| 284 | false; \ |
| 285 | fi \ |
| 286 | else \ |
| 287 | echo >&2 "*"; \ |
| 288 | echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \ |
| 289 | echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \ |
| 290 | echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ |
| 291 | echo >&2 "*"; \ |
| 292 | false; \ |
| 293 | fi |
| 294 | endif |
| 295 | |
| 296 | $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c |
| 297 | |
| 298 | $(obj)/qconf.o: $(obj)/qconf.moc |
| 299 | |
| 300 | quiet_cmd_moc = MOC $@ |
| 301 | cmd_moc = $(KC_QT_MOC) -i $< -o $@ |
| 302 | |
| 303 | $(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck |
| 304 | $(call cmd,moc) |
| 305 | |
Masahiro Yamada | bf7ab1e | 2017-02-11 12:39:54 +0900 | [diff] [blame] | 306 | # Extract gconf menu items for i18n support |
Masahiro Yamada | 0a9064f | 2014-07-30 14:08:13 +0900 | [diff] [blame] | 307 | $(obj)/gconf.glade.h: $(obj)/gconf.glade |
| 308 | $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \ |
| 309 | $(obj)/gconf.glade |