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