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