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