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