| 1 | # $Id: qt4.kmk 2018 2008-11-02 00:08:56Z bird $ | 
|---|
| 2 | ## @file | 
|---|
| 3 | # Qt 4 unit. | 
|---|
| 4 | # | 
|---|
| 5 |  | 
|---|
| 6 | # | 
|---|
| 7 | # Copyright (c) 2008 knut st. osmundsen <bird-src-spam@anduin.net> | 
|---|
| 8 | # | 
|---|
| 9 | # This file is part of kBuild. | 
|---|
| 10 | # | 
|---|
| 11 | # kBuild is free software; you can redistribute it and/or modify | 
|---|
| 12 | # it under the terms of the GNU General Public License as published by | 
|---|
| 13 | # the Free Software Foundation; either version 2 of the License, or | 
|---|
| 14 | # (at your option) any later version. | 
|---|
| 15 | # | 
|---|
| 16 | # kBuild is distributed in the hope that it will be useful, | 
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 19 | # GNU General Public License for more details. | 
|---|
| 20 | # | 
|---|
| 21 | # You should have received a copy of the GNU General Public License | 
|---|
| 22 | # along with kBuild; if not, write to the Free Software | 
|---|
| 23 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA | 
|---|
| 24 | # | 
|---|
| 25 | # | 
|---|
| 26 | # As a special exception you are granted permission to include this file, via | 
|---|
| 27 | # the kmk include directive, as you wish without this in itself causing the | 
|---|
| 28 | # resulting makefile, program or whatever to be covered by the GPL license. | 
|---|
| 29 | # This exception does not however invalidate any other reasons why the makefile, | 
|---|
| 30 | # program, whatever should not be covered the GPL. | 
|---|
| 31 | # | 
|---|
| 32 | # | 
|---|
| 33 |  | 
|---|
| 34 |  | 
|---|
| 35 | ifdef UNIT_qt4 | 
|---|
| 36 | $(error kBuild: The qt4 unit was included twice!) | 
|---|
| 37 | endif | 
|---|
| 38 | UNIT_qt4 = qt4 | 
|---|
| 39 |  | 
|---|
| 40 |  | 
|---|
| 41 | ifndef UNIT_qt3 | 
|---|
| 42 | # Add our target properties (same as qt3). | 
|---|
| 43 | PROPS_SINGLE += QTTOOL MOCTOOL UICTOOL LRCTOOL QT_TRANSLATIONS_INST QT_TRANSLATIONS_TEMPLATE QT_PREFIX | 
|---|
| 44 | PROPS_ACCUMULATE_R += MOCDEFS MOCFLAGS UICFLAGS LRCFLAGS QT_TRANSLATIONS QT_MOCSRCS QT_MOCHDRS | 
|---|
| 45 | endif | 
|---|
| 46 | PROPS_SINGLE += RCCTOOL | 
|---|
| 47 | PROPS_ACCUMULATE_R += RCCFLAGS QT_MODULES | 
|---|
| 48 |  | 
|---|
| 49 |  | 
|---|
| 50 | ## @todo use pkg-config? | 
|---|
| 51 |  | 
|---|
| 52 | # | 
|---|
| 53 | # The QT4 SDK. | 
|---|
| 54 | # | 
|---|
| 55 | # This is implemented here rather than in sdks/QT4.kmk to enforce the global USES. | 
|---|
| 56 | # It also makes things easier to develop, with fewer files I mean. | 
|---|
| 57 | # | 
|---|
| 58 | ## @todo the SDK might actually not be necessary as it turns out... For now it servers | 
|---|
| 59 | # a purpose if the host differs from the target, in theory at least. | 
|---|
| 60 | SDK_QT4 = Qt4 | 
|---|
| 61 |  | 
|---|
| 62 | # SDK Specific Properties | 
|---|
| 63 | #       PATH_SDK_QT4           - The general Qt4 root directory. | 
|---|
| 64 | #       PATH_SDK_QT4_INC       - The include directory. | 
|---|
| 65 | #       PATH_SDK_QT4_LIB.amd64 - The lib directory for AMD64. | 
|---|
| 66 | #       PATH_SDK_QT4_LIB.x86   - The lib directory for X86. | 
|---|
| 67 | #       PATH_SDK_QT4_LIB       - The lib directory for KBUILD_TARGET. | 
|---|
| 68 | ifndef PATH_SDK_QT4 | 
|---|
| 69 | PATH_SDK_QT4 := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*))) | 
|---|
| 70 | ifeq ($(PATH_SDK_QT4),) | 
|---|
| 71 | # If target == host, try look for Qt in the various platform specific places. | 
|---|
| 72 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST)) | 
|---|
| 73 | ifeq ($(KBUILD_TARGET),darwin) | 
|---|
| 74 | PATH_SDK_QT4 := $(patsubst %/Frameworks/QtCore.framework/Versions/4,%,$(firstword $(wildcard /Library/Frameworks/QtCore.framework/Versions/4))) | 
|---|
| 75 | else ifeq ($(KBUILD_TARGET),win) | 
|---|
| 76 | # No idea here yet... | 
|---|
| 77 | else ifeq ($(KBUILD_TARGET),ose) | 
|---|
| 78 | # No port... | 
|---|
| 79 | else | 
|---|
| 80 | # The Unices. Includes and esp. libs are tricky, so override the PATH_SDK_QT4_LIB* stuff if it doesn't work. | 
|---|
| 81 | # Try find the general root of thing by looking for the qt3to4 program, if not found, then look for rcc. | 
|---|
| 82 | PATH_SDK_QT4 := $(patsubst %/bin/qt3to4,%,$(firstword $(wildcard \ | 
|---|
| 83 | /usr/bin/qt3to4 \ | 
|---|
| 84 | /usr/local/bin/qt3to4 \ | 
|---|
| 85 | /usr/qt/4/bin/qt3to4 \ | 
|---|
| 86 | /usr/share/qt4/bin/qt3to4 \ | 
|---|
| 87 | ))) | 
|---|
| 88 | ifeq ($(PATH_SDK_QT4),) | 
|---|
| 89 | PATH_SDK_QT4 := $(patsubst %/bin/rcc,%,$(firstword $(wildcard \ | 
|---|
| 90 | /usr/bin/rcc \ | 
|---|
| 91 | /usr/local/bin/rcc \ | 
|---|
| 92 | /usr/qt/4/bin/rcc \ | 
|---|
| 93 | /usr/share/qt4/bin/rcc \ | 
|---|
| 94 | ))) | 
|---|
| 95 | endif | 
|---|
| 96 | ifneq ($(PATH_SDK_QT4),) | 
|---|
| 97 | export PATH_SDK_QT4 | 
|---|
| 98 |  | 
|---|
| 99 | # Locate the include files. | 
|---|
| 100 | ifeq ($(PATH_SDK_QT4_INC),) | 
|---|
| 101 | PATH_SDK_QT4_INC := $(patsubst %/QtCore/qglobal.h,%,$(firstword $(wildcard \ | 
|---|
| 102 | $(PATH_SDK_QT4)/include/QtCore/qglobal.h \ | 
|---|
| 103 | $(PATH_SDK_QT4)/include/qt4/QtCore/qglobal.h \ | 
|---|
| 104 | /usr/include/qt4/QtCore/qtglobal.h \ | 
|---|
| 105 | /usr/local/include/qt4/QtCore/qtglobal.h \ | 
|---|
| 106 | ))) | 
|---|
| 107 | ifneq ($(PATH_SDK_QT4_INC),) | 
|---|
| 108 | export PATH_SDK_QT4_INC | 
|---|
| 109 | endif | 
|---|
| 110 | endif | 
|---|
| 111 |  | 
|---|
| 112 | # Now for the libraries (mostly for helping out finding the KBUILD_TARGET libs). | 
|---|
| 113 | ifeq ($(PATH_SDK_QT4_LIB.x86),) | 
|---|
| 114 | PATH_SDK_QT4_LIB.x86   := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \ | 
|---|
| 115 | $(PATH_SDK_QT4)/lib32/libQtCore$(SUFF_DLL) \ | 
|---|
| 116 | $(PATH_SDK_QT4)/lib32/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 117 | /usr/lib32/libQtCore$(SUFF_DLL) \ | 
|---|
| 118 | /usr/lib32/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 119 | /usr/local/lib32/libQtCore$(SUFF_DLL) \ | 
|---|
| 120 | /usr/local/lib32/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 121 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \ | 
|---|
| 122 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 123 | ))) | 
|---|
| 124 | ifneq ($(PATH_SDK_QT4_LIB.x86),) | 
|---|
| 125 | export PATH_SDK_QT4_LIB.x86 | 
|---|
| 126 | endif | 
|---|
| 127 | endif | 
|---|
| 128 | ifeq ($(PATH_SDK_QT4_LIB.amd64),) | 
|---|
| 129 | PATH_SDK_QT4_LIB.amd64 := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \ | 
|---|
| 130 | $(PATH_SDK_QT4)/lib64/libQtCore$(SUFF_DLL) \ | 
|---|
| 131 | $(PATH_SDK_QT4)/lib64/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 132 | $(PATH_SDK_QT4)/lib/amd64/libQtCore$(SUFF_DLL) \ | 
|---|
| 133 | /usr/lib64/libQtCore$(SUFF_DLL) \ | 
|---|
| 134 | /usr/lib64/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 135 | /usr/lib/amd64/libQtCore$(SUFF_DLL) \ | 
|---|
| 136 | /usr/local/lib64/libQtCore$(SUFF_DLL) \ | 
|---|
| 137 | /usr/local/lib64/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 138 | /usr/local/lib/amd64/libQtCore$(SUFF_DLL) \ | 
|---|
| 139 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \ | 
|---|
| 140 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 141 | ))) | 
|---|
| 142 | ifneq ($(PATH_SDK_QT4_LIB.amd64),) | 
|---|
| 143 | export PATH_SDK_QT4_LIB.amd64 | 
|---|
| 144 | endif | 
|---|
| 145 | endif | 
|---|
| 146 |  | 
|---|
| 147 | # And finally, the library path for KBUILD_TARGET. | 
|---|
| 148 | ifeq ($(PATH_SDK_QT4_LIB),) | 
|---|
| 149 | PATH_SDK_QT4_LIB := $(PATH_SDK_QT4_LIB.$(KBUILD_TARGET)) | 
|---|
| 150 | ifeq ($(PATH_SDK_QT4_LIB),) | 
|---|
| 151 | PATH_SDK_QT4_LIB := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \ | 
|---|
| 152 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \ | 
|---|
| 153 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 154 | /usr/lib/libQtCore$(SUFF_DLL) \ | 
|---|
| 155 | /usr/lib/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 156 | /usr/local/lib/libQtCore$(SUFF_DLL) \ | 
|---|
| 157 | /usr/local/lib/qt4/libQtCore$(SUFF_DLL) \ | 
|---|
| 158 | ))) | 
|---|
| 159 | endif | 
|---|
| 160 | ifneq ($(PATH_SDK_QT4_LIB),) | 
|---|
| 161 | export PATH_SDK_QT4_LIB | 
|---|
| 162 | endif | 
|---|
| 163 | endif | 
|---|
| 164 |  | 
|---|
| 165 | endif | 
|---|
| 166 | endif # Unices | 
|---|
| 167 | endif | 
|---|
| 168 | # Found it? | 
|---|
| 169 | ifeq ($(PATH_SDK_QT4),) | 
|---|
| 170 | $(warning kBuild: Couldn't find the Qt4 headers and libaries...) | 
|---|
| 171 | PATH_SDK_QT4 := $(PATH_DEVTOOLS_TRG)/qt/not-found | 
|---|
| 172 | endif | 
|---|
| 173 | endif | 
|---|
| 174 | else | 
|---|
| 175 | # Resolve any fancy stuff once and for all. | 
|---|
| 176 | PATH_SDK_QT4 := $(PATH_SDK_QT4) | 
|---|
| 177 | endif | 
|---|
| 178 |  | 
|---|
| 179 | # Libraries can be in either Frameworks or lib depending on how you | 
|---|
| 180 | # build it on the mac. The .dmg installs into Frameworks but builds into lib. | 
|---|
| 181 | ifeq ($(KBUILD_TARGET),darwin) | 
|---|
| 182 | ifndef PATH_SDK_QT4_LIB | 
|---|
| 183 | ifneq ($(wildcard $(PATH_SDK_QT4)/Frameworks),) | 
|---|
| 184 | PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/Frameworks | 
|---|
| 185 | else | 
|---|
| 186 | PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/lib | 
|---|
| 187 | endif | 
|---|
| 188 | endif | 
|---|
| 189 | else | 
|---|
| 190 | PATH_SDK_QT4_LIB ?= $(PATH_SDK_QT4)/lib | 
|---|
| 191 | PATH_SDK_QT4_INC ?= $(PATH_SDK_QT4)/include | 
|---|
| 192 | endif | 
|---|
| 193 |  | 
|---|
| 194 | # The bits that kBuild picks up. | 
|---|
| 195 | #  (nothing here) | 
|---|
| 196 |  | 
|---|
| 197 |  | 
|---|
| 198 | # | 
|---|
| 199 | # The QT4 tool. | 
|---|
| 200 | # | 
|---|
| 201 | # This is implemented here rather than in tools/QT4.kmk to enforce the global USES. | 
|---|
| 202 | # It also makes things easier to develop, with fewer files I mean. | 
|---|
| 203 | # | 
|---|
| 204 | TOOL_QT4 = Qt4 | 
|---|
| 205 |  | 
|---|
| 206 | # Tool Specific Properties | 
|---|
| 207 | #       PATH_TOOL_QT4     - Obsolete. | 
|---|
| 208 | #       PATH_TOOL_QT4_BIN - The | 
|---|
| 209 | #       TOOL_QT4_BIN_SUFF - | 
|---|
| 210 | if !defined(PATH_TOOL_QT4_BIN) && defined(PATH_TOOL_QT4) | 
|---|
| 211 | PATH_TOOL_QT4_BIN := $(PATH_TOOL_QT4)/bin | 
|---|
| 212 | endif | 
|---|
| 213 | ifndef PATH_TOOL_QT4_BIN | 
|---|
| 214 | PATH_TOOL_QT4_BIN := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_BLD)/qt/v4*/bin))) | 
|---|
| 215 | ifeq ($(PATH_TOOL_QT4_BIN),) | 
|---|
| 216 | ifdef TOOL_QT4_BIN_SUFF | 
|---|
| 217 | TOOL_QT4_BIN_SUFF := $(TOOL_QT4_BIN_SUFF) | 
|---|
| 218 | endif | 
|---|
| 219 | # Try looking for moc-qt4 / moc-$(suffix) first. | 
|---|
| 220 | ifneq ($(TOOL_QT4_BIN_SUFF),) | 
|---|
| 221 | PATH_TOOL_QT4_BIN := $(patsubst %/moc$(TOOL_QT4_BIN_SUFF),%,$(firstword $(wildcard \ | 
|---|
| 222 | /usr/lib/qt4/bin/moc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 223 | /usr/qt/4/bin/moc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 224 | /usr/share/qt4/bin/moc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 225 | /usr/local/bin/moc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 226 | /usr/bin/moc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 227 | ))) | 
|---|
| 228 | else | 
|---|
| 229 | PATH_TOOL_QT4_BIN := $(patsubst %/moc-qt4,%,$(firstword $(wildcard \ | 
|---|
| 230 | /usr/lib/qt4/bin/moc-qt4 \ | 
|---|
| 231 | /usr/qt/4/bin/moc-qt4 \ | 
|---|
| 232 | /usr/share/qt4/bin/moc-qt4 \ | 
|---|
| 233 | /usr/local/bin/moc-qt4 \ | 
|---|
| 234 | /usr/bin/moc-qt4 \ | 
|---|
| 235 | ))) | 
|---|
| 236 | ifneq ($(PATH_TOOL_QT4_BIN),) | 
|---|
| 237 | TOOL_QT4_BIN_SUFF := -qt4 | 
|---|
| 238 | else | 
|---|
| 239 | # If no luck, try looking for moc in the qt4 specific locations. | 
|---|
| 240 | PATH_TOOL_QT4_BIN := $(patsubst %/moc,%,$(firstword $(wildcard \ | 
|---|
| 241 | /usr/lib/qt4/bin/moc \ | 
|---|
| 242 | /usr/qt/4/bin/moc \ | 
|---|
| 243 | /usr/share/qt4/bin/moc \ | 
|---|
| 244 | ))) | 
|---|
| 245 | endif | 
|---|
| 246 | endif | 
|---|
| 247 | # If still no go, try looking for qt3to4 and rcc. | 
|---|
| 248 | ifeq ($(PATH_TOOL_QT4_BIN),) | 
|---|
| 249 | PATH_TOOL_QT4_BIN := $(patsubst %/qt3to4,%,$(firstword $(wildcard \ | 
|---|
| 250 | /usr/lib/qt4/bin/qt3to4 \ | 
|---|
| 251 | /usr/qt/4/bin/qt3to4 \ | 
|---|
| 252 | /usr/share/qt4/bin/qt3to4 \ | 
|---|
| 253 | /usr/local/bin/qt3to4 \ | 
|---|
| 254 | /usr/bin/qt3to4 \ | 
|---|
| 255 | ))) | 
|---|
| 256 | endif | 
|---|
| 257 | ifeq ($(PATH_TOOL_QT4_BIN),) | 
|---|
| 258 | PATH_TOOL_QT4_BIN := $(patsubst %/rcc$(TOOL_QT4_BIN_SUFF),%,$(firstword $(wildcard \ | 
|---|
| 259 | /usr/lib/qt4/bin/rcc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 260 | /usr/qt/4/bin/rcc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 261 | /usr/share/qt4/bin/rcc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 262 | /usr/local/bin/rcc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 263 | /usr/bin/rcc$(TOOL_QT4_BIN_SUFF) \ | 
|---|
| 264 | ))) | 
|---|
| 265 | endif | 
|---|
| 266 | if "$(PATH_TOOL_QT4_BIN)" == "" && "$(TOOL_QT4_BIN_SUFF)" != "" | 
|---|
| 267 | PATH_TOOL_QT4_BIN := $(patsubst %/rcc,%,$(firstword $(wildcard \ | 
|---|
| 268 | /usr/lib/qt4/bin/rcc \ | 
|---|
| 269 | /usr/qt/4/bin/rcc \ | 
|---|
| 270 | /usr/share/qt4/bin/rcc \ | 
|---|
| 271 | /usr/local/bin/rcc \ | 
|---|
| 272 | /usr/bin/rcc \ | 
|---|
| 273 | ))) | 
|---|
| 274 | endif | 
|---|
| 275 | ifneq ($(PATH_TOOL_QT4_BIN),) | 
|---|
| 276 | export PATH_TOOL_QT4_BIN | 
|---|
| 277 | endif | 
|---|
| 278 | endif | 
|---|
| 279 | # If not found, we'll enter the 'pathless' mode. | 
|---|
| 280 | else | 
|---|
| 281 | # Resolve any fancy stuff once and for all. | 
|---|
| 282 | PATH_TOOL_QT4_BIN := $(PATH_TOOL_QT4_BIN) | 
|---|
| 283 | endif | 
|---|
| 284 | ifneq ($(PATH_TOOL_QT4_BIN),) | 
|---|
| 285 | TOOL_QT4_MOC       ?= $(PATH_TOOL_QT4_BIN)/moc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 286 | TOOL_QT4_UIC       ?= $(PATH_TOOL_QT4_BIN)/uic$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 287 | ifndef TOOL_QT4_RCC | 
|---|
| 288 | TOOL_QT4_RCC      := $(PATH_TOOL_QT4_BIN)/rcc$(HOST_SUFF_EXE) | 
|---|
| 289 | ifeq ($(wildcard $(TOOL_QT4_RCC)),) | 
|---|
| 290 | TOOL_QT4_RCC     := $(PATH_TOOL_QT4_BIN)/rcc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 291 | endif | 
|---|
| 292 | endif | 
|---|
| 293 | TOOL_QT4_LRC       ?= $(PATH_TOOL_QT4_BIN)/lrelease$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 294 | TOOL_QT4_LUPDATE   ?= $(PATH_TOOL_QT4_BIN)/lupdate$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 295 | else | 
|---|
| 296 | # Pathless, relies on the environment. | 
|---|
| 297 | TOOL_QT4_MOC       ?= moc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 298 | TOOL_QT4_UIC       ?= uic$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 299 | TOOL_QT4_RCC       ?= rcc$(HOST_SUFF_EXE) | 
|---|
| 300 | TOOL_QT4_LRC       ?= lrelease$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 301 | TOOL_QT4_LUPDATE   ?= lupdate$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE) | 
|---|
| 302 | endif | 
|---|
| 303 |  | 
|---|
| 304 | # General Properties used by kBuild and/or units/qt.kmk | 
|---|
| 305 | TOOL_QT4_MOCFLAGS           ?= | 
|---|
| 306 | TOOL_QT4_MOCINCS            ?= | 
|---|
| 307 | TOOL_QT4_MOCDEFS            ?= | 
|---|
| 308 | TOOL_QT4_MOCDEFS.darwin     ?= __APPLE__ __GNUC__ | 
|---|
| 309 | TOOL_QT4_MOCDEFS.solaris    ?= __sun | 
|---|
| 310 | TOOL_QT4_MOCDEFS.win.amd64  ?= WIN64 | 
|---|
| 311 | TOOL_QT4_MOCDEFS.win.x86    ?= WIN32 | 
|---|
| 312 |  | 
|---|
| 313 |  | 
|---|
| 314 | ## MOC a C++ source file. | 
|---|
| 315 | # @param    $(target)   Normalized main target name. | 
|---|
| 316 | # @param    $(source)   Source filename (relative). | 
|---|
| 317 | # @param    $(out)      Object file name. This shall be (re)created by the compilation. | 
|---|
| 318 | # @param    $(dep)      Dependcy file. This may be (re)created by the compilation. | 
|---|
| 319 | # @param    $(flags)    Flags. | 
|---|
| 320 | # @param    $(defs)     Definitions. | 
|---|
| 321 | # @param    $(incs)     Includes. | 
|---|
| 322 | # @param    $(outbase)  Output basename (full). Use this for list files and such. | 
|---|
| 323 | # | 
|---|
| 324 | TOOL_QT4_MOC_CPP_DEPEND = | 
|---|
| 325 | TOOL_QT4_MOC_CPP_DEPORD = | 
|---|
| 326 | TOOL_QT4_MOC_CPP_OUTPUT = | 
|---|
| 327 | TOOL_QT4_MOC_CPP_OUTPUT_MAYBE = | 
|---|
| 328 | define TOOL_QT4_MOC_CPP_CMDS | 
|---|
| 329 | $(QUIET)$(TOOL_QT4_MOC)\ | 
|---|
| 330 | $(flags)\ | 
|---|
| 331 | $(addprefix -I, $(incs))\ | 
|---|
| 332 | $(addprefix -D, $(defs))\ | 
|---|
| 333 | -o $(out)\ | 
|---|
| 334 | $(source) | 
|---|
| 335 | endef | 
|---|
| 336 |  | 
|---|
| 337 | ## MOC a C++ header file. | 
|---|
| 338 | # @param    $(target)   Normalized main target name. | 
|---|
| 339 | # @param    $(source)   Source filename (relative). | 
|---|
| 340 | # @param    $(out)      Object file name. This shall be (re)created by the compilation. | 
|---|
| 341 | # @param    $(dep)      Dependcy file. This may be (re)created by the compilation. | 
|---|
| 342 | # @param    $(flags)    Flags. | 
|---|
| 343 | # @param    $(defs)     Definitions. | 
|---|
| 344 | # @param    $(incs)     Includes. | 
|---|
| 345 | # @param    $(outbase)  Output basename (full). Use this for list files and such. | 
|---|
| 346 | # | 
|---|
| 347 | TOOL_QT4_MOC_HPP_DEPEND = | 
|---|
| 348 | TOOL_QT4_MOC_HPP_DEPORD = | 
|---|
| 349 | TOOL_QT4_MOC_HPP_OUTPUT = | 
|---|
| 350 | TOOL_QT4_MOC_HPP_OUTPUT_MAYBE = | 
|---|
| 351 | define TOOL_QT4_MOC_HPP_CMDS | 
|---|
| 352 | $(QUIET)$(TOOL_QT4_MOC)\ | 
|---|
| 353 | $(flags)\ | 
|---|
| 354 | $(addprefix -I, $(incs))\ | 
|---|
| 355 | $(addprefix -D, $(defs))\ | 
|---|
| 356 | -o $(out)\ | 
|---|
| 357 | $(source) | 
|---|
| 358 | endef | 
|---|
| 359 |  | 
|---|
| 360 | ## Compile a Qt user interface file (.ui). | 
|---|
| 361 | # @param    $(target)   Normalized main target name. | 
|---|
| 362 | # @param    $(source)   Source filename (relative). | 
|---|
| 363 | # @param    $(out)      Object file name. This shall be (re)created by the compilation. | 
|---|
| 364 | # @param    $(dep)      Dependcy file. This may be (re)created by the compilation. | 
|---|
| 365 | # @param    $(flags)    Flags. | 
|---|
| 366 | # @param    $(defs)     Definitions. | 
|---|
| 367 | # @param    $(incs)     Includes. | 
|---|
| 368 | # @param    $(outbase)  Output basename (full). Use this for list files and such. | 
|---|
| 369 | # | 
|---|
| 370 | TOOL_QT4_UIC_UI_DEPEND = | 
|---|
| 371 | TOOL_QT4_UIC_UI_DEPORD = | 
|---|
| 372 | TOOL_QT4_UIC_UI_OUTPUT = | 
|---|
| 373 | TOOL_QT4_UIC_UI_OUTPUT_MAYBE = | 
|---|
| 374 | define TOOL_QT4_UIC_UI_CMDS | 
|---|
| 375 | $(QUIET)$(TOOL_QT4_UIC)\ | 
|---|
| 376 | $(flags)\ | 
|---|
| 377 | -o $(out)\ | 
|---|
| 378 | $(source) | 
|---|
| 379 | endef | 
|---|
| 380 |  | 
|---|
| 381 | ## Compile a Qt resource file (.qrc). | 
|---|
| 382 | # @param    $(target)   Normalized main target name. | 
|---|
| 383 | # @param    $(source)   Source filename (relative). | 
|---|
| 384 | # @param    $(out)      Object file name. This shall be (re)created by the compilation. | 
|---|
| 385 | # @param    $(dep)      Dependcy file. This may be (re)created by the compilation. | 
|---|
| 386 | # @param    $(flags)    Flags. | 
|---|
| 387 | # @param    $(defs)     Definitions. | 
|---|
| 388 | # @param    $(incs)     Includes. | 
|---|
| 389 | # @param    $(outbase)  Output basename (full). Use this for list files and such. | 
|---|
| 390 | # | 
|---|
| 391 | # @remarks  The sed script generating the dependency file is a bit naive. | 
|---|
| 392 | TOOL_QT4_RCC_QRC_DEPEND = | 
|---|
| 393 | TOOL_QT4_RCC_QRC_DEPORD = | 
|---|
| 394 | TOOL_QT4_RCC_QRC_OUTPUT = | 
|---|
| 395 | TOOL_QT4_RCC_QRC_OUTPUT_MAYBE = | 
|---|
| 396 | define TOOL_QT4_RCC_QRC_CMDS | 
|---|
| 397 | $(QUIET)$(TOOL_QT4_RCC)\ | 
|---|
| 398 | $(flags)\ | 
|---|
| 399 | -o $(out)\ | 
|---|
| 400 | $(source) | 
|---|
| 401 | $(APPEND) $(dep) '\' | 
|---|
| 402 | $(APPEND) $(dep) '$(out): \' | 
|---|
| 403 | $(APPEND) $(dep) '$(source) \' | 
|---|
| 404 | $(SED) \ | 
|---|
| 405 | -e '/^[[:blank:]]*<file[[:blank:]][^>]*>/!d' \ | 
|---|
| 406 | -e 's/^.*<file[[:blank:]][^>]*>\([^<]*\)<\/file>.*$$$$/\1/' \ | 
|---|
| 407 | -e 's|^[^/]|$(abspathex $(dir $(source)),$(defpath))/&|' \ | 
|---|
| 408 | -e 's|$$$$| \\|' \ | 
|---|
| 409 | --append $(dep) \ | 
|---|
| 410 | $(source) | 
|---|
| 411 | $(APPEND) $(dep) | 
|---|
| 412 | $(SED) \ | 
|---|
| 413 | -e '/^[[:blank:]]*<file[[:blank:]][^>]*>/!d' \ | 
|---|
| 414 | -e 's/^.*<file[[:blank:]][^>]*>\([^<]*\)<\/file>.*$$$$/\1/' \ | 
|---|
| 415 | -e 's|^[^/]|$(abspathex $(dir $(source)),$(defpath))/&|' \ | 
|---|
| 416 | -e 's|$$$$|:\n|' \ | 
|---|
| 417 | --append $(dep) \ | 
|---|
| 418 | $(source) | 
|---|
| 419 | $(APPEND) $(dep) | 
|---|
| 420 | endef | 
|---|
| 421 |  | 
|---|
| 422 | ## Compile a Qt translation file (.ts). | 
|---|
| 423 | # @param    $(target)   Normalized main target name. | 
|---|
| 424 | # @param    $(source)   Source filename (relative). | 
|---|
| 425 | # @param    $(out)      Object file name. This shall be (re)created by the compilation. | 
|---|
| 426 | # @param    $(dep)      Dependcy file. This may be (re)created by the compilation. | 
|---|
| 427 | # @param    $(flags)    Flags. | 
|---|
| 428 | # @param    $(defs)     Definitions. | 
|---|
| 429 | # @param    $(incs)     Includes. | 
|---|
| 430 | # @param    $(outbase)  Output basename (full). Use this for list files and such. | 
|---|
| 431 | # | 
|---|
| 432 | TOOL_QT4_LRC_TS_DEPEND = | 
|---|
| 433 | TOOL_QT4_LRC_TS_DEPORD = | 
|---|
| 434 | TOOL_QT4_LRC_TS_OUTPUT = | 
|---|
| 435 | TOOL_QT4_LRC_TS_OUTPUT_MAYBE = | 
|---|
| 436 | define TOOL_QT4_LRC_TS_CMDS | 
|---|
| 437 | $(QUIET)$(TOOL_QT4_LRC)\ | 
|---|
| 438 | $(flags)\ | 
|---|
| 439 | $(source)\ | 
|---|
| 440 | -qm $(out) | 
|---|
| 441 | endef | 
|---|
| 442 |  | 
|---|
| 443 |  | 
|---|
| 444 |  | 
|---|
| 445 | # | 
|---|
| 446 | # | 
|---|
| 447 | # Back to the Qt4 unit. | 
|---|
| 448 | # | 
|---|
| 449 | # | 
|---|
| 450 |  | 
|---|
| 451 |  | 
|---|
| 452 | ## wrapper for the lrelease (LRC) command dependencies. | 
|---|
| 453 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 454 | _UNIT_QT4_LRC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_LRC_CMDS_PREV_),$$(commands $(out)),FORCE) | 
|---|
| 455 | else | 
|---|
| 456 | _UNIT_QT4_LRC_CMDS_DEP = | 
|---|
| 457 | endif | 
|---|
| 458 |  | 
|---|
| 459 | ## | 
|---|
| 460 | # def_unit_qt4_target_pre_handle_translation helper that is expanded before evaluation. | 
|---|
| 461 | # | 
|---|
| 462 | # This is necessary to resolve reference to local variables before doing | 
|---|
| 463 | # assignments and setting up commands. They would otherwise be resolved | 
|---|
| 464 | # later in a different context and the result would be completely wrong. | 
|---|
| 465 | # | 
|---|
| 466 | define def_unit_qt4_target_pre_handle_translation_dx | 
|---|
| 467 |  | 
|---|
| 468 | $(out) + $(more_output) +| $(maybe_output): \ | 
|---|
| 469 | $(deps) \ | 
|---|
| 470 | $(value _UNIT_QT4_LRC_CMDS_DEP) \ | 
|---|
| 471 | | \ | 
|---|
| 472 | $(orderdeps) | 
|---|
| 473 | %$$(call MSG_TOOL,lrelease,$(target),$(source),$$@) | 
|---|
| 474 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep) | 
|---|
| 475 |  | 
|---|
| 476 | $(cmds) | 
|---|
| 477 |  | 
|---|
| 478 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 479 | %$$(QUIET2)$$(APPEND) '$(dep)' | 
|---|
| 480 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_LRC_CMDS_PREV_' | 
|---|
| 481 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' | 
|---|
| 482 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' | 
|---|
| 483 | endif | 
|---|
| 484 |  | 
|---|
| 485 | $(target)_OUT_FILES += $(out) $(more_output) $(maybe_output) | 
|---|
| 486 | $(target)-inst-nls_SOURCES += $(out) | 
|---|
| 487 |  | 
|---|
| 488 | endef # def_unit_qt4_target_pre_handle_translation_dx | 
|---|
| 489 |  | 
|---|
| 490 | ## | 
|---|
| 491 | # Handle a source file listed in QT_TRANSLATIONS. | 
|---|
| 492 | # | 
|---|
| 493 | # The files listed in QT_TRANSLATIONS are translation files (.ts) which needs | 
|---|
| 494 | # to be translated into .qm files that are loadble by Qt. | 
|---|
| 495 | # | 
|---|
| 496 | # @remarks Invoked via $(evalvalctx ). | 
|---|
| 497 | define def_unit_qt4_target_pre_handle_translation | 
|---|
| 498 | local type      := LRC | 
|---|
| 499 |  | 
|---|
| 500 | # fetch the properties. | 
|---|
| 501 | local tool      := $(kb-src-tool dummy_var) | 
|---|
| 502 | local qtnlsdir  := $(PATH_$(target))/qtnls | 
|---|
| 503 | local outbase   := $(qtnlsdir)/$(notdir $(basename $(source))) | 
|---|
| 504 | local out       := $(outbase).qm | 
|---|
| 505 | local dep       := $(out).dep | 
|---|
| 506 | local flags     := $(kb-src-prop FLAGS,dummy_var,right-to-left) | 
|---|
| 507 | local deps      := $(kb-src-prop DEPS,dummy_var,left-to-right) | 
|---|
| 508 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right) | 
|---|
| 509 |  | 
|---|
| 510 | # default path + source dep. | 
|---|
| 511 | ifneq ($(defpath),) | 
|---|
| 512 | local source    := $(abspathex $(source),$(defpath)) | 
|---|
| 513 | local deps      := $(abspathex $(deps),$(defpath)) $(source) | 
|---|
| 514 | local incs      := $(abspathex $(incs),$(defpath)) | 
|---|
| 515 | else | 
|---|
| 516 | local deps      += $(source) | 
|---|
| 517 | endif | 
|---|
| 518 |  | 
|---|
| 519 | # call the tool | 
|---|
| 520 | ifndef TOOL_$(tool)_LRC_TS_CMDS | 
|---|
| 521 | $(error kBuild: qt lrelease tool not found: TOOL_$(tool)_LRC_TS_CMDS) | 
|---|
| 522 | endif | 
|---|
| 523 | local cmds         := $(TOOL_$(tool)_LRC_TS_CMDS) | 
|---|
| 524 | local more_output  := $(TOOL_$(tool)_LRC_TS_OUTPUT) | 
|---|
| 525 | local maybe_output := $(TOOL_$(tool)_LRC_TS_OUTPUT_MAYBE) | 
|---|
| 526 | local deps         += $(TOOL_$(tool)_LRC_TS_DEPEND) | 
|---|
| 527 | local orderdeps    += $(TOOL_$(tool)_LRC_TS_DEPORD) | 
|---|
| 528 |  | 
|---|
| 529 | # generate the link rule and update some source and target variables. | 
|---|
| 530 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 531 | $(eval includedep $(dep)) | 
|---|
| 532 | endif | 
|---|
| 533 | $(eval $(def_unit_qt4_target_pre_handle_translation_dx)) | 
|---|
| 534 |  | 
|---|
| 535 | endef # def_unit_qt4_target_pre_handle_translation | 
|---|
| 536 |  | 
|---|
| 537 |  | 
|---|
| 538 |  | 
|---|
| 539 | ## wrapper for the UIC command dependencies. | 
|---|
| 540 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 541 | _UNIT_QT4_RCC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_RCC_CMDS_PREV_),$$(commands $(out)),FORCE) | 
|---|
| 542 | else | 
|---|
| 543 | _UNIT_QT4_RCC_CMDS_DEP = | 
|---|
| 544 | endif | 
|---|
| 545 |  | 
|---|
| 546 | ## | 
|---|
| 547 | # def_unit_qt4_target_pre_handle_qrc helper that is expanded before evaluation. | 
|---|
| 548 | # | 
|---|
| 549 | # This is necessary to resolve reference to local variables before doing | 
|---|
| 550 | # assignments and setting up commands. They would otherwise be resolved | 
|---|
| 551 | # later in a different context and the result would be completely wrong. | 
|---|
| 552 | # | 
|---|
| 553 | define def_unit_qt4_target_pre_handle_rcc_dx | 
|---|
| 554 |  | 
|---|
| 555 | $(out) +| $(realout) $(more_output) $(maybe_output): \ | 
|---|
| 556 | $(deps) \ | 
|---|
| 557 | $(value _UNIT_QT4_RCC_CMDS_DEP) \ | 
|---|
| 558 | | \ | 
|---|
| 559 | $(orderdeps) | 
|---|
| 560 | %$$(call MSG_TOOL,rcc,$(target),$(source),$$@) | 
|---|
| 561 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep) | 
|---|
| 562 |  | 
|---|
| 563 | $(cmds) | 
|---|
| 564 |  | 
|---|
| 565 | $(QUIET)$(CP) --changed -f $(out) $(realout) | 
|---|
| 566 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 567 | %$$(QUIET2)$$(APPEND) '$(dep)' | 
|---|
| 568 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_RCC_CMDS_PREV_' | 
|---|
| 569 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' | 
|---|
| 570 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' | 
|---|
| 571 | endif | 
|---|
| 572 |  | 
|---|
| 573 | $(target)_INTERMEDIATES += $(realout) | 
|---|
| 574 | $(target)_GEN_SOURCES_ += $(realout) | 
|---|
| 575 | $(target)_OUT_FILES += $(out) $(realout) $(more_output) $(maybe_output) | 
|---|
| 576 |  | 
|---|
| 577 | endef # def_unit_qt4_target_pre_handle_rcc_dx | 
|---|
| 578 |  | 
|---|
| 579 | ## | 
|---|
| 580 | # Source handler for .qrc sources (Qt resource files). | 
|---|
| 581 | # | 
|---|
| 582 | # @remarks $(evalvalctx me). | 
|---|
| 583 | define def_unit_qt4_src_handler_qrc | 
|---|
| 584 | local type      := RCC | 
|---|
| 585 |  | 
|---|
| 586 | # fetch the properties. | 
|---|
| 587 | local tool      := $(kb-src-tool dummy_var) | 
|---|
| 588 | local qtrccdir  := $(PATH_$(target))/qtrcc | 
|---|
| 589 | local outbase   := $(qtrccdir)/$(notdir $(basename $(source))) | 
|---|
| 590 | local out       := $(outbase).tmp.gen.cpp | 
|---|
| 591 | local realout   := $(outbase).gen.cpp | 
|---|
| 592 | local dep       := $(realout).dep | 
|---|
| 593 | local flags     := $(kb-src-prop FLAGS,dummy_var,right-to-left) | 
|---|
| 594 | local deps      := $(kb-src-prop DEPS,dummy_var,left-to-right) | 
|---|
| 595 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right) | 
|---|
| 596 |  | 
|---|
| 597 | # default path + source dep. | 
|---|
| 598 | ifneq ($(defpath),) | 
|---|
| 599 | local source    := $(abspathex $(source),$(defpath)) | 
|---|
| 600 | local deps      := $(abspathex $(deps),$(defpath)) $(source) | 
|---|
| 601 | local incs      := $(abspathex $(incs),$(defpath)) | 
|---|
| 602 | else | 
|---|
| 603 | local deps      += $(source) | 
|---|
| 604 | endif | 
|---|
| 605 |  | 
|---|
| 606 | # call the tool | 
|---|
| 607 | ifndef TOOL_$(tool)_RCC_QRC_CMDS | 
|---|
| 608 | $(error kBuild: qt rcc tool not found: TOOL_$(tool)_RCC_QRC_CMDS) | 
|---|
| 609 | endif | 
|---|
| 610 | local cmds         := $(TOOL_$(tool)_RCC_QRC_CMDS) | 
|---|
| 611 | local more_output  := $(TOOL_$(tool)_RCC_QRC_OUTPUT) | 
|---|
| 612 | local maybe_output := $(TOOL_$(tool)_RCC_QRC_OUTPUT_MAYBE) | 
|---|
| 613 | local deps         += $(TOOL_$(tool)_RCC_QRC_DEPEND) | 
|---|
| 614 | local orderdeps    += $(TOOL_$(tool)_RCC_QRC_DEPORD) | 
|---|
| 615 |  | 
|---|
| 616 | # generate the link rule and update some source and target variables. | 
|---|
| 617 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 618 | $(eval includedep $(dep)) | 
|---|
| 619 | endif | 
|---|
| 620 | $(eval $(def_unit_qt4_target_pre_handle_rcc_dx)) | 
|---|
| 621 |  | 
|---|
| 622 | endef # def_unit_qt4_src_handler_qrc | 
|---|
| 623 |  | 
|---|
| 624 |  | 
|---|
| 625 |  | 
|---|
| 626 | ## wrapper for the UIC command dependencies. | 
|---|
| 627 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 628 | _UNIT_QT4_UIC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_UIC_CMDS_PREV_),$$(commands $(out)),FORCE) | 
|---|
| 629 | else | 
|---|
| 630 | _UNIT_QT4_UIC_CMDS_DEP = | 
|---|
| 631 | endif | 
|---|
| 632 |  | 
|---|
| 633 | ## | 
|---|
| 634 | # def_unit_qt4_src_handler_ui helper that is expanded before evaluation. | 
|---|
| 635 | # | 
|---|
| 636 | # This is necessary to resolve reference to local variables before doing | 
|---|
| 637 | # assignments and setting up commands. They would otherwise be resolved | 
|---|
| 638 | # later in a different context and the result would be completely wrong. | 
|---|
| 639 | # | 
|---|
| 640 | define def_unit_qt4_target_pre_handle_ui_dx | 
|---|
| 641 |  | 
|---|
| 642 | $(out) +| $(realout) $(more_output) $(maybe_output): \ | 
|---|
| 643 | $(deps) \ | 
|---|
| 644 | $(value _UNIT_QT4_UIC_CMDS_DEP) \ | 
|---|
| 645 | | \ | 
|---|
| 646 | $(orderdeps) | 
|---|
| 647 | %$$(call MSG_TOOL,uic,$(target),$(source),$$@) | 
|---|
| 648 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep) | 
|---|
| 649 |  | 
|---|
| 650 | $(cmds) | 
|---|
| 651 |  | 
|---|
| 652 | $(QUIET)$(CP) --changed -f $(out) $(realout) | 
|---|
| 653 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 654 | %$$(QUIET2)$$(APPEND) '$(dep)' | 
|---|
| 655 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_UIC_CMDS_PREV_' | 
|---|
| 656 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' | 
|---|
| 657 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' | 
|---|
| 658 | endif | 
|---|
| 659 |  | 
|---|
| 660 | $(target)_INTERMEDIATES += $(realout) | 
|---|
| 661 | $(target)_OUT_FILES += $(out) $(realout) $(more_output) $(maybe_output) | 
|---|
| 662 |  | 
|---|
| 663 | endef # def_unit_qt4_target_pre_handle_ui_dx | 
|---|
| 664 |  | 
|---|
| 665 | ## | 
|---|
| 666 | # Source handler for .ui sources. | 
|---|
| 667 | # | 
|---|
| 668 | # @remarks $(evalvalctx me). | 
|---|
| 669 | define def_unit_qt4_src_handler_ui | 
|---|
| 670 | local type      := UIC | 
|---|
| 671 |  | 
|---|
| 672 | # fetch the properties. | 
|---|
| 673 | local tool      := $(kb-src-tool dummy_var) | 
|---|
| 674 | local qtuicdir  := $(PATH_$(target))/qtuic | 
|---|
| 675 | local outbase   := $(qtuicdir)/$(notdir $(basename $(source))) | 
|---|
| 676 | local out       := $(outbase).tmp.gen.h | 
|---|
| 677 | local realout   := $(outbase).gen.h | 
|---|
| 678 | local dep       := $(realout).dep | 
|---|
| 679 | local flags     := $(kb-src-prop FLAGS,dummy_var,right-to-left) | 
|---|
| 680 | local deps      := $(kb-src-prop DEPS,dummy_var,left-to-right) | 
|---|
| 681 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right) | 
|---|
| 682 |  | 
|---|
| 683 | # default path + source dep. | 
|---|
| 684 | ifneq ($(defpath),) | 
|---|
| 685 | local source    := $(abspathex $(source),$(defpath)) | 
|---|
| 686 | local deps      := $(abspathex $(deps),$(defpath)) $(source) | 
|---|
| 687 | local incs      := $(abspathex $(incs),$(defpath)) | 
|---|
| 688 | else | 
|---|
| 689 | local deps      += $(source) | 
|---|
| 690 | endif | 
|---|
| 691 |  | 
|---|
| 692 | # call the tool | 
|---|
| 693 | ifndef TOOL_$(tool)_UIC_UI_CMDS | 
|---|
| 694 | $(error kBuild: qt uic tool not found: TOOL_$(tool)_UIC_UI_CMDS) | 
|---|
| 695 | endif | 
|---|
| 696 | local cmds         := $(TOOL_$(tool)_UIC_UI_CMDS) | 
|---|
| 697 | local more_output  := $(TOOL_$(tool)_UIC_UI_OUTPUT) | 
|---|
| 698 | local maybe_output := $(TOOL_$(tool)_UIC_UI_OUTPUT_MAYBE) | 
|---|
| 699 | local deps         += $(TOOL_$(tool)_UIC_UI_DEPEND) | 
|---|
| 700 | local orderdeps    += $(TOOL_$(tool)_UIC_UI_DEPORD) | 
|---|
| 701 |  | 
|---|
| 702 | # generate the link rule and update some source and target variables. | 
|---|
| 703 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 704 | $(eval includedep $(dep)) | 
|---|
| 705 | endif | 
|---|
| 706 | $(eval $(def_unit_qt4_target_pre_handle_ui_dx)) | 
|---|
| 707 |  | 
|---|
| 708 | endef # def_unit_qt4_src_handler_ui | 
|---|
| 709 |  | 
|---|
| 710 |  | 
|---|
| 711 |  | 
|---|
| 712 | ## wrapper for the MOC command dependencies. | 
|---|
| 713 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 714 | _UNIT_QT4_MOC_HPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_MOC_HPP_CMDS_PREV_),$$(commands $(out)),FORCE) | 
|---|
| 715 | else | 
|---|
| 716 | _UNIT_QT4_MOC_HPP_CMDS_DEP = | 
|---|
| 717 | endif | 
|---|
| 718 |  | 
|---|
| 719 | ## | 
|---|
| 720 | # def_unit_qt4_target_pre_handle_moc_hdr helper that is expanded before evaluation. | 
|---|
| 721 | # | 
|---|
| 722 | # This is necessary to resolve reference to local variables before doing | 
|---|
| 723 | # assignments and setting up commands. They would otherwise be resolved | 
|---|
| 724 | # later in a different context and the result would be completely wrong. | 
|---|
| 725 | # | 
|---|
| 726 | define def_unit_qt4_target_pre_handle_moc_hdr_dx | 
|---|
| 727 |  | 
|---|
| 728 | $(out) +| $(realout) $(more_output) $(maybe_output): \ | 
|---|
| 729 | $(deps) \ | 
|---|
| 730 | $(value _UNIT_QT4_MOC_HPP_CMDS_DEP) \ | 
|---|
| 731 | | \ | 
|---|
| 732 | $(orderdeps) | 
|---|
| 733 | %$$(call MSG_TOOL,moc,$(target),$(source),$$@) | 
|---|
| 734 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep) | 
|---|
| 735 |  | 
|---|
| 736 | $(cmds) | 
|---|
| 737 |  | 
|---|
| 738 | $(QUIET)$(CP) --changed -f $(out) $(realout) | 
|---|
| 739 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 740 | %$$(QUIET2)$$(APPEND) '$(dep)' | 
|---|
| 741 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_MOC_HPP_CMDS_PREV_' | 
|---|
| 742 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' | 
|---|
| 743 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' | 
|---|
| 744 | endif | 
|---|
| 745 |  | 
|---|
| 746 | $(target)_INTERMEDIATES += $(realout) | 
|---|
| 747 | $(target)_GEN_SOURCES_ += $(realout) | 
|---|
| 748 | $(target)_OUT_FILES += $(out) $(realout) $(more_output) $(maybe_output) | 
|---|
| 749 |  | 
|---|
| 750 | endef | 
|---|
| 751 |  | 
|---|
| 752 | ## | 
|---|
| 753 | # Handle a source file listed in QT_MOCHDRS. | 
|---|
| 754 | # | 
|---|
| 755 | # The files listed in QT_MOCHDRS uses the Q_OBJECT macro and we will | 
|---|
| 756 | # generate a .cpp file for each of them and add it to the generated | 
|---|
| 757 | # sources so that it's compiled and linked. (There is an alternative | 
|---|
| 758 | # way to do this where the .cpp file is included, this isn't currently | 
|---|
| 759 | # supported by this unit.) | 
|---|
| 760 | # | 
|---|
| 761 | # @remarks Invoked via $(evalvalctx ). | 
|---|
| 762 | define def_unit_qt4_target_pre_handle_moc_hdr | 
|---|
| 763 | local type      := MOC | 
|---|
| 764 |  | 
|---|
| 765 | # fetch the properties. | 
|---|
| 766 | local tool      := $(kb-src-tool dummy_var) | 
|---|
| 767 | local outbase   := $(qtmocdir)/$(notdir $(basename $(source))) | 
|---|
| 768 | local out       := $(outbase).tmp.cpp | 
|---|
| 769 | local realout   := $(outbase).cpp | 
|---|
| 770 | local dep       := $(realout).dep | 
|---|
| 771 | local defs      := $(kb-src-prop DEFS,dummy_var,left-to-right) | 
|---|
| 772 | local incs      := $(kb-src-prop INCS,dummy_var,right-to-left) | 
|---|
| 773 | local flags     := $(kb-src-prop FLAGS,dummy_var,right-to-left) | 
|---|
| 774 | local deps      := $(kb-src-prop DEPS,dummy_var,left-to-right) | 
|---|
| 775 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right) | 
|---|
| 776 |  | 
|---|
| 777 | # default path + source dep. | 
|---|
| 778 | ifneq ($(defpath),) | 
|---|
| 779 | local source    := $(abspathex $(source),$(defpath)) | 
|---|
| 780 | local deps      := $(abspathex $(deps),$(defpath)) $(source) | 
|---|
| 781 | local incs      := $(abspathex $(incs),$(defpath)) | 
|---|
| 782 | else | 
|---|
| 783 | local deps      += $(source) | 
|---|
| 784 | endif | 
|---|
| 785 |  | 
|---|
| 786 | # call the tool | 
|---|
| 787 | ifndef TOOL_$(tool)_MOC_HPP_CMDS | 
|---|
| 788 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_HPP_CMDS) | 
|---|
| 789 | endif | 
|---|
| 790 | local cmds         := $(TOOL_$(tool)_MOC_HPP_CMDS) | 
|---|
| 791 | local more_output  := $(TOOL_$(tool)_MOC_HPP_OUTPUT) | 
|---|
| 792 | local maybe_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT_MAYBE) | 
|---|
| 793 | local deps         += $(TOOL_$(tool)_MOC_HPP_DEPEND) | 
|---|
| 794 | local orderdeps    += $(TOOL_$(tool)_MOC_HPP_DEPORD) | 
|---|
| 795 |  | 
|---|
| 796 | # generate the link rule and update some source and target variables. | 
|---|
| 797 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 798 | $(eval includedep $(dep)) | 
|---|
| 799 | endif | 
|---|
| 800 | $(eval $(def_unit_qt4_target_pre_handle_moc_hdr_dx)) | 
|---|
| 801 |  | 
|---|
| 802 | endef # def_unit_qt4_target_pre_handle_moc_hdr | 
|---|
| 803 |  | 
|---|
| 804 |  | 
|---|
| 805 | ## wrapper for the MOC command dependencies. | 
|---|
| 806 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 807 | _UNIT_QT4_MOC_CPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT4_MOC_CPP_CMDS_PREV_),$$(commands $(out)),FORCE) | 
|---|
| 808 | else | 
|---|
| 809 | _UNIT_QT4_MOC_CPP_CMDS_DEP = | 
|---|
| 810 | endif | 
|---|
| 811 |  | 
|---|
| 812 | ## | 
|---|
| 813 | # def_unit_qt4_target_pre_handle_moc_src helper that is expanded before evaluation. | 
|---|
| 814 | # | 
|---|
| 815 | # This is necessary to resolve reference to local variables before doing | 
|---|
| 816 | # assignments and setting up commands. They would otherwise be resolved | 
|---|
| 817 | # later in a different context and the result would be completely wrong. | 
|---|
| 818 | # | 
|---|
| 819 | define def_unit_qt4_target_pre_handle_moc_src_dx | 
|---|
| 820 |  | 
|---|
| 821 | $(out) +| $(realout) $(more_output) $(maybe_output): \ | 
|---|
| 822 | $(deps) \ | 
|---|
| 823 | $(value _UNIT_QT4_MOC_CPP_CMDS_DEP) \ | 
|---|
| 824 | | \ | 
|---|
| 825 | $(orderdeps) | 
|---|
| 826 | %$$(call MSG_TOOL,moc,$(target),$(source),$$@) | 
|---|
| 827 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep) | 
|---|
| 828 |  | 
|---|
| 829 | $(cmds) | 
|---|
| 830 |  | 
|---|
| 831 | $(QUIET)$(CP) --changed -f $(out) $(realout) | 
|---|
| 832 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 833 | %$$(QUIET2)$$(APPEND) '$(dep)' | 
|---|
| 834 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT4_MOC_CPP_CMDS_PREV_' | 
|---|
| 835 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' | 
|---|
| 836 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' | 
|---|
| 837 | endif | 
|---|
| 838 |  | 
|---|
| 839 | $(target)_INTERMEDIATES += $(realout) | 
|---|
| 840 | $(target)_OUT_FILES += $(out) $(realout) $(more_output) $(maybe_output) | 
|---|
| 841 |  | 
|---|
| 842 | endef | 
|---|
| 843 |  | 
|---|
| 844 | ## | 
|---|
| 845 | # Handle a source file listed in QT_MOCSRCS. | 
|---|
| 846 | # | 
|---|
| 847 | # The files listed in QT_MOCSRCS uses the Q_OBJECT macro and will include | 
|---|
| 848 | # a .moc file that we're expected to generate here. | 
|---|
| 849 | # | 
|---|
| 850 | # @remarks Invoked via $(evalvalctx ). | 
|---|
| 851 | define def_unit_qt4_target_pre_handle_moc_src | 
|---|
| 852 | local type      := MOC | 
|---|
| 853 |  | 
|---|
| 854 | # fetch the properties. | 
|---|
| 855 | local tool      := $(kb-src-tool dummy_var) | 
|---|
| 856 | local outbase   := $(qtmocdir)/$(notdir $(basename $(source))) | 
|---|
| 857 | local out       := $(outbase).tmp.moc | 
|---|
| 858 | local realout   := $(outbase).moc | 
|---|
| 859 | local dep       := $(realout).dep | 
|---|
| 860 | local defs      := $(kb-src-prop DEFS,dummy_var,left-to-right) | 
|---|
| 861 | local incs      := $(kb-src-prop INCS,dummy_var,right-to-left) | 
|---|
| 862 | local flags     := $(kb-src-prop FLAGS,dummy_var,right-to-left) | 
|---|
| 863 | local deps      := $(kb-src-prop DEPS,dummy_var,left-to-right) | 
|---|
| 864 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right) | 
|---|
| 865 |  | 
|---|
| 866 | # default path + source dep. | 
|---|
| 867 | ifneq ($(defpath),) | 
|---|
| 868 | local source    := $(abspathex $(source),$(defpath)) | 
|---|
| 869 | local deps      := $(abspathex $(deps),$(defpath)) $(source) | 
|---|
| 870 | local incs      := $(abspathex $(incs),$(defpath)) | 
|---|
| 871 | else | 
|---|
| 872 | local deps      += $(source) | 
|---|
| 873 | endif | 
|---|
| 874 |  | 
|---|
| 875 | # call the tool | 
|---|
| 876 | ifndef TOOL_$(tool)_MOC_CPP_CMDS | 
|---|
| 877 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_CPP_CMDS) | 
|---|
| 878 | endif | 
|---|
| 879 | local cmds         := $(TOOL_$(tool)_MOC_CPP_CMDS) | 
|---|
| 880 | local more_output  := $(TOOL_$(tool)_MOC_CPP_OUTPUT) | 
|---|
| 881 | local maybe_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT_MAYBE) | 
|---|
| 882 | local deps         += $(TOOL_$(tool)_MOC_CPP_DEPEND) | 
|---|
| 883 | local orderdeps    += $(TOOL_$(tool)_MOC_CPP_DEPORD) | 
|---|
| 884 |  | 
|---|
| 885 | # generate the link rule and update some source and target variables. | 
|---|
| 886 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
| 887 | $(eval includedep $(dep)) | 
|---|
| 888 | endif | 
|---|
| 889 | $(eval $(def_unit_qt4_target_pre_handle_moc_src_dx)) | 
|---|
| 890 |  | 
|---|
| 891 | endef # def_unit_qt4_target_pre_handle_moc_src | 
|---|
| 892 |  | 
|---|
| 893 |  | 
|---|
| 894 | ## | 
|---|
| 895 | # Adds sources containing Q_OBJECT to QT_MOCSRCS. | 
|---|
| 896 | define def_unit_qt4_target_pre_cpp_source | 
|---|
| 897 | ifneq ($(file-size $(source)),-1) | 
|---|
| 898 | ifneq ($(strip $(shell $(SED) -f $(KBUILD_PATH)/units/qt-Q_OBJECT.sed $(source))),) | 
|---|
| 899 | $(eval $(target)_QT_MOCSRCS += $(source)) | 
|---|
| 900 | endif | 
|---|
| 901 | endif | 
|---|
| 902 | endef # def_unit_qt4_target_pre_cpp_source | 
|---|
| 903 |  | 
|---|
| 904 | ## | 
|---|
| 905 | # Invoked early in the processing of a target that uses the Qt unit. | 
|---|
| 906 | # | 
|---|
| 907 | # It will append the qt source handlers to the target (.h, .ui, .ts, | 
|---|
| 908 | # .png, .bmp, .gif). | 
|---|
| 909 | # | 
|---|
| 910 | # It will then check all the C++ sources and check which needs | 
|---|
| 911 | # a .moc files and generate rules and dependencies fofor these | 
|---|
| 912 | # | 
|---|
| 913 | define def_unit_qt4_target_pre | 
|---|
| 914 |  | 
|---|
| 915 | # Make QTTOOL the default for the specific Qt tools instead of TOOL. | 
|---|
| 916 | ifneq ($($(target)_QTTOOL),) | 
|---|
| 917 | ifeq ($($(target)_MOCTOOL),) | 
|---|
| 918 | $(target)_MOCTOOL := $($(target)_QTTOOL) | 
|---|
| 919 | endif | 
|---|
| 920 | ifeq ($($(target)_UICTOOL),) | 
|---|
| 921 | $(target)_UICTOOL := $($(target)_QTTOOL) | 
|---|
| 922 | endif | 
|---|
| 923 | ifeq ($($(target)_RCCTOOL),) | 
|---|
| 924 | $(target)_RCCTOOL := $($(target)_QTTOOL) | 
|---|
| 925 | endif | 
|---|
| 926 | ifeq ($($(target)_LRCTOOL),) | 
|---|
| 927 | $(target)_LRCTOOL := $($(target)_QTTOOL) | 
|---|
| 928 | endif | 
|---|
| 929 | endif | 
|---|
| 930 |  | 
|---|
| 931 | # Deal with QT_MODULES and QT_PREFIX. | 
|---|
| 932 | local qt_modules := \ | 
|---|
| 933 | $($(target)_QT_MODULES.$(bld_trg)) \ | 
|---|
| 934 | $($(target)_QT_MODULES.$(bld_trg_arch)) \ | 
|---|
| 935 | $($(target)_QT_MODULES.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
| 936 | $($(target)_QT_MODULES.$(bld_trg_cpu)) \ | 
|---|
| 937 | $($(target)_QT_MODULES.$(bld_type)) \ | 
|---|
| 938 | $($(target)_QT_MODULES) | 
|---|
| 939 | local qt_prefix := $(firstword \ | 
|---|
| 940 | $($(target)_QT_PREFIX.$(bld_trg)) \ | 
|---|
| 941 | $($(target)_QT_PREFIX.$(bld_trg_arch)) \ | 
|---|
| 942 | $($(target)_QT_PREFIX.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
| 943 | $($(target)_QT_PREFIX.$(bld_trg_cpu)) \ | 
|---|
| 944 | $($(target)_QT_PREFIX.$(bld_type)) \ | 
|---|
| 945 | $($(target)_QT_PREFIX)) | 
|---|
| 946 | ifeq ($(bld_trg),darwin) | 
|---|
| 947 | # Adding -F to CXXFLAGS is necessary to make #include <QtCore/qstring.h> stuff work... | 
|---|
| 948 | $(eval $(target)_CXXFLAGS += -F$(PATH_SDK_QT4_LIB) ) | 
|---|
| 949 | $(eval $(target)_LDFLAGS  += -F$(PATH_SDK_QT4_LIB) $(addprefix -framework Qt$(qt_prefix),$(qt_modules)) ) | 
|---|
| 950 | $(eval $(target)_INCS     += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/$(qt_prefix)Qt$(module).framework/Versions/4/Headers) ) | 
|---|
| 951 | else | 
|---|
| 952 | ifeq ($(bld_trg),win) | 
|---|
| 953 | $(eval $(target)_LIBS    += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/$(qt_prefix)Qt$(module)4$(SUFF_LIB)) ) | 
|---|
| 954 | ifeq ($(tool_do),LINK_PROGRAM) | 
|---|
| 955 | $(eval $(target)_LIBS   += $(PATH_SDK_QT4_LIB)/$(qt_prefix)qtmain$(SUFF_LIB) ) | 
|---|
| 956 | endif | 
|---|
| 957 | else | 
|---|
| 958 | $(eval $(target)_LIBS    += $(foreach module,$(qt_modules), $(PATH_SDK_QT4_LIB)/lib$(qt_prefix)Qt$(module)$(SUFF_DLL)) ) | 
|---|
| 959 | endif | 
|---|
| 960 | $(eval $(target)_INCS     += $(addprefix $(PATH_SDK_QT4_INC)/Qt,$(qt_modules)) $(PATH_SDK_QT4_INC) ) | 
|---|
| 961 | endif | 
|---|
| 962 | $(eval $(target)_DEFS      += $(foreach module,$(toupper $(qt_modules)), QT_$(module)_LIB) ) | 
|---|
| 963 |  | 
|---|
| 964 |  | 
|---|
| 965 | # Autodetect source files with Q_OBJECT references if QT_MOCSRCS is undefined. (slow) | 
|---|
| 966 | # Tip: Use target_QT_MOCSRCS = $(NO_SUCH_VARIABLE) to avoid this. | 
|---|
| 967 | ifndef $(target)_QT_MOCSRCS | 
|---|
| 968 | $(foreach source, $(filter %.cxx %.CXX %.cpp %.CPP %.cc %.CC,\ | 
|---|
| 969 | $($(target)_SOURCES.$(bld_trg)) \ | 
|---|
| 970 | $($(target)_SOURCES.$(bld_trg_arch)) \ | 
|---|
| 971 | $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
| 972 | $($(target)_SOURCES.$(bld_trg_cpu)) \ | 
|---|
| 973 | $($(target)_SOURCES.$(bld_type)) \ | 
|---|
| 974 | $($(target)_SOURCES) \ | 
|---|
| 975 | ), $(evalval def_unit_qt4_target_pre_cpp_source)) | 
|---|
| 976 | endif | 
|---|
| 977 |  | 
|---|
| 978 | # Install source handlers for .ui files. | 
|---|
| 979 | $(target)_SRC_HANDLERS += \ | 
|---|
| 980 | .ui:def_unit_qt4_src_handler_ui \ | 
|---|
| 981 | .UI:def_unit_qt4_src_handler_ui \ | 
|---|
| 982 | .qrc:def_unit_qt4_src_handler_qrc \ | 
|---|
| 983 | .qrc:def_unit_qt4_src_handler_qrc | 
|---|
| 984 |  | 
|---|
| 985 | # Calc the MOC and UI output directories and add them to BLDDIRS and INCS. | 
|---|
| 986 | local qtmocdir := $(PATH_$(target))/qtmoc | 
|---|
| 987 | local qtuicdir := $(PATH_$(target))/qtuic | 
|---|
| 988 | local qtrccdir := $(PATH_$(target))/qtrcc | 
|---|
| 989 | local qtnlsdir := $(PATH_$(target))/qtnls | 
|---|
| 990 | $(eval $(target)_BLDDIRS += $(qtmocdir) $(qtuicdir) $(qtrccdir) $(qtnlsdir)) | 
|---|
| 991 | $(eval $(target)_INCS    += $(qtmocdir) $(qtuicdir)) | 
|---|
| 992 |  | 
|---|
| 993 | # Deal with QT_MOCSRCS. | 
|---|
| 994 | $(foreach source, \ | 
|---|
| 995 | $($(target)_QT_MOCSRCS.$(bld_trg)) \ | 
|---|
| 996 | $($(target)_QT_MOCSRCS.$(bld_trg_arch)) \ | 
|---|
| 997 | $($(target)_QT_MOCSRCS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
| 998 | $($(target)_QT_MOCSRCS.$(bld_trg_cpu)) \ | 
|---|
| 999 | $($(target)_QT_MOCSRCS.$(bld_type)) \ | 
|---|
| 1000 | $($(target)_QT_MOCSRCS) \ | 
|---|
| 1001 | , $(evalvalctx def_unit_qt4_target_pre_handle_moc_src)) | 
|---|
| 1002 |  | 
|---|
| 1003 | # Deal with QT_MOCHDRS. | 
|---|
| 1004 | $(foreach source, \ | 
|---|
| 1005 | $($(target)_QT_MOCHDRS.$(bld_trg)) \ | 
|---|
| 1006 | $($(target)_QT_MOCHDRS.$(bld_trg_arch)) \ | 
|---|
| 1007 | $($(target)_QT_MOCHDRS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
| 1008 | $($(target)_QT_MOCHDRS.$(bld_trg_cpu)) \ | 
|---|
| 1009 | $($(target)_QT_MOCHDRS.$(bld_type)) \ | 
|---|
| 1010 | $($(target)_QT_MOCHDRS) \ | 
|---|
| 1011 | , $(evalvalctx def_unit_qt4_target_pre_handle_moc_hdr)) | 
|---|
| 1012 |  | 
|---|
| 1013 | # Deal with QT_TRANSLATIONS. | 
|---|
| 1014 | # ASSUMES (_ALL_)INSTALLS is processed after the targets using this unit. | 
|---|
| 1015 | local translations := \ | 
|---|
| 1016 | $($(target)_QT_TRANSLATIONS.$(bld_trg)) \ | 
|---|
| 1017 | $($(target)_QT_TRANSLATIONS.$(bld_trg_arch)) \ | 
|---|
| 1018 | $($(target)_QT_TRANSLATIONS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
| 1019 | $($(target)_QT_TRANSLATIONS.$(bld_trg_cpu)) \ | 
|---|
| 1020 | $($(target)_QT_TRANSLATIONS.$(bld_type)) \ | 
|---|
| 1021 | $($(target)_QT_TRANSLATIONS) | 
|---|
| 1022 | ifneq ($(strip $(translations)),) | 
|---|
| 1023 | local expr := _ALL_INSTALLS += $(target)-inst-nls | 
|---|
| 1024 | $(eval $(expr)) | 
|---|
| 1025 | ifdef $(target)_QT_TRANSLATIONS_TEMPLATE | 
|---|
| 1026 | $(target)-inst-nls_TEMPLATE := $($(target)_QT_TRANSLATIONS_TEMPLATE) | 
|---|
| 1027 | else | 
|---|
| 1028 | $(target)-inst-nls_MODE := 0644 | 
|---|
| 1029 | endif | 
|---|
| 1030 | ifdef $(target)_QT_TRANSLATIONS_INST | 
|---|
| 1031 | $(target)-inst-nls_INST := $($(target)_QT_TRANSLATIONS_INST) | 
|---|
| 1032 | endif | 
|---|
| 1033 | $(target)-inst-nls_SOURCES := | 
|---|
| 1034 | $(foreach source, $(translations)\ | 
|---|
| 1035 | , $(evalvalctx def_unit_qt4_target_pre_handle_translation)) | 
|---|
| 1036 | endif | 
|---|
| 1037 |  | 
|---|
| 1038 | endef # def_unit_qt4_target_pre | 
|---|
| 1039 |  | 
|---|
| 1040 |  | 
|---|
| 1041 | # | 
|---|
| 1042 | # Rule for debugging. | 
|---|
| 1043 | # | 
|---|
| 1044 | unit-qt4-show-vars: | 
|---|
| 1045 | @$(ECHO) 'The Qt4 SDK variables:' | 
|---|
| 1046 | @$(ECHO) '  PATH_SDK_QT4           = "$(PATH_SDK_QT4)"' | 
|---|
| 1047 | @$(ECHO) '  PATH_SDK_QT4_INC       = "$(PATH_SDK_QT4_INC)"' | 
|---|
| 1048 | @$(ECHO) '  PATH_SDK_QT4_LIB       = "$(PATH_SDK_QT4_LIB)"' | 
|---|
| 1049 | @$(ECHO) '  PATH_SDK_QT4_LIB.amd64 = "$(PATH_SDK_QT4_LIB.amd64)"' | 
|---|
| 1050 | @$(ECHO) '  PATH_SDK_QT4_LIB.x86   = "$(PATH_SDK_QT4_LIB.x86)"' | 
|---|
| 1051 | @$(ECHO) 'The Qt4 TOOL variables:' | 
|---|
| 1052 | @$(ECHO) '  PATH_TOOL_QT4_BIN      = "$(PATH_TOOL_QT4_BIN)"' | 
|---|
| 1053 | @$(ECHO) '  TOOL_QT4_BIN_SUFF      = "$(TOOL_QT4_BIN_SUFF)"' | 
|---|
| 1054 | @$(ECHO) '  TOOL_QT4_MOC           = "$(TOOL_QT4_MOC)"' | 
|---|
| 1055 | @$(ECHO) '  TOOL_QT4_UIC           = "$(TOOL_QT4_UIC)"' | 
|---|
| 1056 | @$(ECHO) '  TOOL_QT4_RCC           = "$(TOOL_QT4_RCC)"' | 
|---|
| 1057 | @$(ECHO) '  TOOL_QT4_LRC           = "$(TOOL_QT4_LRC)"' | 
|---|
| 1058 | @$(ECHO) '  TOOL_QT4_LUPDATE       = "$(TOOL_QT4_LUPDATE)"' | 
|---|
| 1059 |  | 
|---|