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