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