Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 1 | # =========================================================================== |
| 2 | # Kernel configuration targets |
| 3 | # These targets are used from top-level makefile |
| 4 | |
Patrick Georgi | 4647bb1 | 2015-06-11 09:45:00 +0200 | [diff] [blame] | 5 | export LC_ALL=C |
| 6 | export LANG=C |
| 7 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 8 | PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \ |
| 9 | localmodconfig localyesconfig |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 10 | |
Patrick Georgi | 26774f2 | 2009-11-21 19:54:02 +0000 | [diff] [blame] | 11 | _OS=$(shell uname -s |cut -c-7) |
| 12 | regex-objs= |
| 13 | ifeq ($(_OS),MINGW32) |
| 14 | regex-objs=regex.o |
| 15 | endif |
| 16 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 17 | Kconfig := src/Kconfig |
| 18 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 19 | xconfig: $(objk)/qconf |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 20 | $< $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 21 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 22 | gconfig: $(objk)/gconf |
Uwe Hermann | 6113c1c | 2012-04-12 21:39:27 +0200 | [diff] [blame] | 23 | cp -f $(srck)/gconf.glade $(objk)/gconf.glade |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 24 | $< $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 25 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 26 | menuconfig: $(objk)/mconf |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 27 | $< $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 28 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 29 | config: $(objk)/conf |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 30 | $< --oldaskconfig $(Kconfig) |
| 31 | |
| 32 | nconfig: $(objk)/nconf |
| 33 | $< $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 34 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 35 | oldconfig: $(objk)/conf |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 36 | $< --$@ $(Kconfig) |
| 37 | $< --silentoldconfig $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 38 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 39 | silentoldconfig: $(objk)/conf |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 40 | $< --$@ $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 41 | |
| 42 | # --- UNUSED, ignore ---------------------------------------------------------- |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 43 | localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
| 44 | $(Q)mkdir -p include/generated |
| 45 | $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config |
| 46 | $(Q)if [ -f .config ]; then \ |
| 47 | cmp -s .tmp.config .config || \ |
| 48 | (mv -f .config .config.old.1; \ |
| 49 | mv -f .tmp.config .config; \ |
| 50 | $(obj)/conf --silentoldconfig $(Kconfig); \ |
| 51 | mv -f .config.old.1 .config.old) \ |
| 52 | else \ |
| 53 | mv -f .tmp.config .config; \ |
| 54 | $(obj)/conf --silentoldconfig $(Kconfig); \ |
| 55 | fi |
| 56 | $(Q)rm -f .tmp.config |
| 57 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 58 | # Create new linux.pot file |
| 59 | # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 60 | update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 61 | $(Q)echo " GEN config.pot" |
| 62 | $(Q)xgettext --default-domain=linux \ |
| 63 | --add-comments --keyword=_ --keyword=N_ \ |
| 64 | --from-code=UTF-8 \ |
| 65 | --files-from=$(srctree)/scripts/kconfig/POTFILES.in \ |
| 66 | --directory=$(srctree) --directory=$(objtree) \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 67 | --output $(obj)/config.pot |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 68 | $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot |
| 69 | $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ |
| 70 | $(srctree)/arch/*/um/Kconfig`; \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 71 | do \ |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 72 | echo " GEN $$i"; \ |
| 73 | $(obj)/kxgettext $$i \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 74 | >> $(obj)/config.pot; \ |
| 75 | done ) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 76 | $(Q)echo " GEN linux.pot" |
| 77 | $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 78 | --output $(obj)/linux.pot |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 79 | $(Q)rm -f $(obj)/config.pot |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 80 | # --- UNUSED, ignore ---------------------------------------------------------- |
| 81 | |
Martin Roth | f099e1b | 2015-06-07 20:30:28 -0600 | [diff] [blame] | 82 | PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig savedefconfig |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 83 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 84 | allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(objk)/conf |
| 85 | $< --$@ $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 86 | |
Martin Roth | f099e1b | 2015-06-07 20:30:28 -0600 | [diff] [blame] | 87 | savedefconfig: $(objk)/conf |
| 88 | $< --$@=defconfig $(Kconfig) |
| 89 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 90 | defconfig: $(objk)/conf |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 91 | ifeq ($(KBUILD_DEFCONFIG),) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 92 | $< -d $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 93 | else |
| 94 | @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 95 | $< -D $(KBUILD_DEFCONFIG) $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 96 | endif |
| 97 | |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 98 | %_defconfig: $(objk)/conf |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 99 | $< -D configs/$@ $(Kconfig) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 100 | |
| 101 | # Help text used by make help |
| 102 | help: |
| 103 | @echo ' config - Update current config utilising a line-oriented program' |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 104 | @echo ' nconfig - Update current config utilising a ncurses menu based program' |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 105 | @echo ' menuconfig - Update current config utilising a menu based program' |
| 106 | @echo ' xconfig - Update current config utilising a QT based front-end' |
| 107 | @echo ' gconfig - Update current config utilising a GTK based front-end' |
| 108 | @echo ' oldconfig - Update current config utilising a provided .config as base' |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 109 | @echo ' localmodconfig - Update current config disabling modules not loaded' |
| 110 | @echo ' localyesconfig - Update current config converting local mods to core' |
| 111 | @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 112 | @echo ' defconfig - New config with default answer to all options' |
Martin Roth | f099e1b | 2015-06-07 20:30:28 -0600 | [diff] [blame] | 113 | @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 114 | @echo ' allnoconfig - New config where all options are answered with no' |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 115 | @echo ' allyesconfig - New config where all options are accepted with yes' |
| 116 | @echo ' allmodconfig - New config selecting modules when possible' |
| 117 | @echo ' randconfig - New config with random answer to all options' |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 118 | |
| 119 | # lxdialog stuff |
| 120 | check-lxdialog := $(srck)/lxdialog/check-lxdialog.sh |
| 121 | |
| 122 | # Use recursively expanded variables so we do not call gcc unless |
| 123 | # we really need to do so. (Do not call gcc as part of make mrproper) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 124 | HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ |
| 125 | -DLOCALE |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 126 | HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) |
| 127 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 128 | |
| 129 | # =========================================================================== |
| 130 | # Shared Makefile for the various kconfig executables: |
| 131 | # conf: Used for defconfig, oldconfig and related targets |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 132 | # nconf: Used for the nconfig target. |
| 133 | # Utilizes ncurses |
| 134 | # mconf: Used for the menuconfig target |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 135 | # Utilizes the lxdialog package |
| 136 | # qconf: Used for the xconfig target |
| 137 | # Based on QT which needs to be installed to compile it |
| 138 | # gconf: Used for the gconfig target |
| 139 | # Based on GTK which needs to be installed to compile it |
| 140 | # object files used by all kconfig flavours |
| 141 | |
| 142 | lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o |
| 143 | lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o |
| 144 | |
Patrick Georgi | 26774f2 | 2009-11-21 19:54:02 +0000 | [diff] [blame] | 145 | conf-objs := conf.o zconf.tab.o $(regex-objs) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 146 | mconf-objs := mconf.o zconf.tab.o $(lxdialog) $(regex-objs) |
| 147 | nconf-objs := nconf.o zconf.tab.o nconf.gui.o |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 148 | kxgettext-objs := kxgettext.o zconf.tab.o |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 149 | qconf-cxxobjs := qconf.o |
| 150 | qconf-objs := zconf.tab.o |
| 151 | gconf-objs := gconf.o zconf.tab.o |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 152 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 153 | hostprogs-y := conf |
| 154 | |
| 155 | ifeq ($(MAKECMDGOALS),nconfig) |
| 156 | hostprogs-y += nconf |
| 157 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 158 | |
| 159 | ifeq ($(MAKECMDGOALS),menuconfig) |
| 160 | hostprogs-y += mconf |
| 161 | endif |
| 162 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 163 | ifeq ($(MAKECMDGOALS),update-po-config) |
| 164 | hostprogs-y += kxgettext |
| 165 | endif |
| 166 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 167 | ifeq ($(MAKECMDGOALS),xconfig) |
| 168 | qconf-target := 1 |
| 169 | endif |
| 170 | ifeq ($(MAKECMDGOALS),gconfig) |
| 171 | gconf-target := 1 |
| 172 | endif |
| 173 | |
| 174 | |
| 175 | ifeq ($(qconf-target),1) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 176 | hostprogs-y += qconf |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 177 | endif |
| 178 | |
| 179 | ifeq ($(gconf-target),1) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 180 | hostprogs-y += gconf |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 181 | endif |
| 182 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 183 | clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck |
| 184 | clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h |
| 185 | clean-files += mconf qconf gconf nconf |
| 186 | clean-files += config.pot linux.pot |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 187 | |
| 188 | # Check that we have the required ncurses stuff installed for lxdialog (menuconfig) |
| 189 | PHONY += $(objk)/dochecklxdialog |
| 190 | $(addprefix $(obj)/,$(lxdialog)): $(objk)/dochecklxdialog |
| 191 | $(objk)/dochecklxdialog: |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 192 | $(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 193 | |
| 194 | always := dochecklxdialog |
| 195 | |
| 196 | # Add environment specific flags |
| 197 | HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srck)/check.sh $(HOSTCC) $(HOSTCFLAGS)) |
| 198 | |
| 199 | # generated files seem to need this to find local include files |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 200 | HOSTCFLAGS_zconf.lex.o := -I$(src) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 201 | HOSTCFLAGS_zconf.tab.o := -I$(src) |
| 202 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 203 | LEX_PREFIX_zconf := zconf |
| 204 | YACC_PREFIX_zconf := zconf |
| 205 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 206 | HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 207 | HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 208 | |
| 209 | HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` |
| 210 | HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 211 | -Wno-missing-prototypes |
| 212 | |
| 213 | HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) |
| 214 | |
| 215 | HOSTLOADLIBES_nconf = $(shell \ |
| 216 | pkg-config --libs menu panel ncurses 2>/dev/null \ |
| 217 | || echo "-lmenu -lpanel -lncurses" ) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 218 | |
| 219 | $(objk)/qconf.o: $(objk)/.tmp_qtcheck |
| 220 | |
| 221 | ifeq ($(qconf-target),1) |
| 222 | $(objk)/.tmp_qtcheck: $(srck)/Makefile |
| 223 | -include $(objk)/.tmp_qtcheck |
| 224 | |
| 225 | # QT needs some extra effort... |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 226 | $(objk)/.tmp_qtcheck: |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 227 | @set -e; echo " CHECK qt"; dir=""; pkg=""; \ |
| 228 | if ! pkg-config --exists QtCore 2> /dev/null; then \ |
| 229 | echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ |
| 230 | pkg-config --exists qt 2> /dev/null && pkg=qt; \ |
| 231 | pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ |
| 232 | if [ -n "$$pkg" ]; then \ |
| 233 | cflags="\$$(shell pkg-config $$pkg --cflags)"; \ |
| 234 | libs="\$$(shell pkg-config $$pkg --libs)"; \ |
| 235 | moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ |
| 236 | dir="$$(pkg-config $$pkg --variable=prefix)"; \ |
| 237 | else \ |
| 238 | for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ |
| 239 | if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ |
| 240 | done; \ |
| 241 | if [ -z "$$dir" ]; then \ |
| 242 | echo >&2 "*"; \ |
| 243 | echo >&2 "* Unable to find any QT installation. Please make sure that"; \ |
| 244 | echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \ |
| 245 | echo >&2 "* either qmake can be found or install pkg-config or set"; \ |
| 246 | echo >&2 "* the QTDIR environment variable to the correct location."; \ |
| 247 | echo >&2 "*"; \ |
| 248 | false; \ |
| 249 | fi; \ |
| 250 | libpath=$$dir/lib; lib=qt; osdir=""; \ |
| 251 | $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ |
| 252 | osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ |
| 253 | test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ |
| 254 | test -f $$libpath/libqt-mt.so && lib=qt-mt; \ |
| 255 | cflags="-I$$dir/include"; \ |
| 256 | libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ |
| 257 | moc="$$dir/bin/moc"; \ |
| 258 | fi; \ |
| 259 | if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ |
| 260 | echo "*"; \ |
| 261 | echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ |
| 262 | echo "*"; \ |
| 263 | moc="/usr/bin/moc"; \ |
| 264 | fi; \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 265 | else \ |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 266 | cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ |
| 267 | libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ |
| 268 | moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \ |
| 269 | [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 270 | fi; \ |
| 271 | echo "KC_QT_CFLAGS=$$cflags" > $@; \ |
| 272 | echo "KC_QT_LIBS=$$libs" >> $@; \ |
| 273 | echo "KC_QT_MOC=$$moc" >> $@ |
| 274 | endif |
| 275 | |
| 276 | $(objk)/gconf.o: $(objk)/.tmp_gtkcheck |
| 277 | |
| 278 | ifeq ($(gconf-target),1) |
| 279 | -include $(objk)/.tmp_gtkcheck |
| 280 | |
| 281 | # GTK needs some extra effort, too... |
Patrick Georgi | 9ebd65d | 2010-04-27 09:23:33 +0000 | [diff] [blame] | 282 | $(objk)/.tmp_gtkcheck: |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 283 | @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \ |
| 284 | if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ |
| 285 | touch $@; \ |
| 286 | else \ |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 287 | echo >&2 "*"; \ |
| 288 | echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \ |
| 289 | echo >&2 "*"; \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 290 | false; \ |
| 291 | fi \ |
| 292 | else \ |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 293 | echo >&2 "*"; \ |
| 294 | echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \ |
| 295 | echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \ |
| 296 | echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ |
| 297 | echo >&2 "*"; \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 298 | false; \ |
| 299 | fi |
| 300 | endif |
| 301 | |
| 302 | # --- UNUSED, ignore ---------------------------------------------------------- |
| 303 | ifdef UNUSED |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 304 | $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 305 | |
| 306 | $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h |
| 307 | |
| 308 | $(obj)/gconf.o: $(obj)/lkc_defs.h |
| 309 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 310 | $(obj)/%.moc: $(srck)/%.h |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 311 | $(KC_QT_MOC) -i $< -o $@ |
| 312 | |
| 313 | $(obj)/lkc_defs.h: $(src)/lkc_proto.h |
| 314 | sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' |
| 315 | |
| 316 | # Extract gconf menu items for I18N support |
| 317 | $(obj)/gconf.glade.h: $(obj)/gconf.glade |
| 318 | intltool-extract --type=gettext/glade $(obj)/gconf.glade |
| 319 | endif |
| 320 | # --- UNUSED, ignore ---------------------------------------------------------- |
| 321 | |
| 322 | ### |
| 323 | # The following requires flex/bison/gperf |
| 324 | # By default we use the _shipped versions, uncomment the following line if |
| 325 | # you are modifying the flex/bison src. |
| 326 | # LKC_GENPARSER := 1 |
| 327 | |
| 328 | ifdef LKC_GENPARSER |
| 329 | |
| 330 | # --- UNUSED, ignore ---------------------------------------------------------- |
| 331 | $(obj)/zconf.tab.c: $(src)/zconf.y |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 332 | $(obj)/zconf.lex.c: $(src)/zconf.l |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 333 | $(obj)/zconf.hash.c: $(src)/zconf.gperf |
| 334 | |
| 335 | %.tab.c: %.y |
Stefan Reinauer | f78a09b | 2015-04-03 20:01:38 +0200 | [diff] [blame] | 336 | bison -t -l -b $* -p $(notdir $*) $< |
Patrick Georgi | 3961834 | 2015-05-10 17:58:48 +0200 | [diff] [blame] | 337 | |
| 338 | %.tab.c_shipped: %.tab.c |
| 339 | cp $< $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 340 | |
Stefan Reinauer | f78a09b | 2015-04-03 20:01:38 +0200 | [diff] [blame] | 341 | %.lex.c: %.l |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 342 | flex -L -P$(notdir $*) -o$@ $< |
Patrick Georgi | 3961834 | 2015-05-10 17:58:48 +0200 | [diff] [blame] | 343 | |
| 344 | %.lex.c_shipped: %.lex.c |
| 345 | cp $< $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 346 | |
| 347 | %.hash.c: %.gperf |
| 348 | gperf < $< > $@ |
| 349 | cp $@ $@_shipped |
| 350 | # --- UNUSED, ignore ---------------------------------------------------------- |
| 351 | |
| 352 | endif |
| 353 | |
| 354 | $(objk)/qconf: $(patsubst %,$(objk)/%,$(qconf-cxxobjs)) \ |
| 355 | $(patsubst %,$(objk)/%,$(qconf-objs)) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 356 | $(HOSTCXX) $(HOSTCXXFLAGS) -o $@ $^ $(HOSTLOADLIBES_qconf) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 357 | $(objk)/gconf: $(patsubst %,$(objk)/%,$(gconf-objs)) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 358 | $(HOSTCC) $(HOSTCFLAGS) -o $@ $^ $(HOSTLOADLIBES_gconf) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 359 | $(objk)/mconf: $(patsubst %,$(objk)/%,$(mconf-objs)) |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 360 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $^ -o $@ $(HOST_LOADLIBES) |
| 361 | $(objk)/nconf: $(patsubst %,$(objk)/%,$(nconf-objs)) |
| 362 | $(HOSTCC) $(HOSTCFLAGS) -o $@ $^ $(HOSTLOADLIBES_nconf) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 363 | $(objk)/conf: $(patsubst %,$(objk)/%,$(conf-objs)) |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 364 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -o $@ $^ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 365 | |
| 366 | $(objk)/mconf.o: $(srck)/mconf.c |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 367 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $< |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 368 | $(objk)/nconf.o: $(srck)/nconf.c |
| 369 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $< |
| 370 | $(objk)/nconf.gui.o: $(srck)/nconf.gui.c |
| 371 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 372 | $(objk)/conf.o: $(srck)/conf.c |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 373 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $< |
Patrick Georgi | 26774f2 | 2009-11-21 19:54:02 +0000 | [diff] [blame] | 374 | $(objk)/regex.o: $(srck)/regex.c |
| 375 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -DHAVE_STRING_H -c -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 376 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 377 | $(objk)/zconf.tab.o: $(objk)/zconf.tab.c $(objk)/zconf.lex.c \ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 378 | $(objk)/zconf.hash.c |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 379 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $(objk)/zconf.tab.c |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 380 | $(objk)/qconf.o: $(srck)/qconf.cc $(objk)/qconf.moc $(objk)/lkc_defs.h |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 381 | $(HOSTCXX) $(HOSTCXXFLAGS) $(HOSTCXXFLAGS_qconf.o) -c -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 382 | $(objk)/gconf.o: $(srck)/gconf.c $(objk)/lkc_defs.h |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 383 | $(HOSTCC) $(HOSTCFLAGS) $(HOSTCFLAGS_gconf.o) -c -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 384 | $(objk)/%.moc: $(srck)/%.h |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 385 | $(KC_QT_MOC) -i $< -o $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 386 | $(objk)/lkc_defs.h: $(srck)/lkc_proto.h |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 387 | sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 388 | |
Patrick Georgi | d520840 | 2014-04-11 20:24:06 +0200 | [diff] [blame] | 389 | $(objk)/zconf.lex.c: $(srck)/zconf.lex.c_shipped |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 390 | cp $< $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 391 | $(objk)/zconf.hash.c: $(srck)/zconf.hash.c_shipped |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 392 | cp $< $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 393 | $(objk)/zconf.tab.c: $(srck)/zconf.tab.c_shipped |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 394 | cp $< $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 395 | |
| 396 | $(objk)/lxdialog/lxdialog: $(objk)/dochecklxdialog \ |
| 397 | $(patsubst %,$(objk)/lxdialog/%,$(lxdialog)) |
Christian Ruppert | 74b6599 | 2011-12-17 21:56:05 +0100 | [diff] [blame] | 398 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ |
| 399 | $(patsubst %,$(objk)/lxdialog/%,$(lxdialog)) $(HOST_LOADLIBES) -o $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 400 | $(objk)/lxdialog/%.o: $(srck)/lxdialog/%.c |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 401 | $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $^ -c -o $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 402 | |
Patrick Georgi | b3a18ac | 2012-09-13 22:13:33 +0200 | [diff] [blame] | 403 | $(objk)/%.o: HOSTCFLAGS+=-I$(srck) -I$(objk) |
| 404 | $(objk)/%.o: HOSTCXXFLAGS+=-I$(srck) -I$(objk) |