source: branches/kBuild-0.1.5/kBuild/units/qt3.kmk

Last change on this file was 2333, checked in by bird, 16 years ago

Backported 2320: qt3.kmk: Fixed PATH_SDK_QT3_LIB detection (used wrong keyword and ending up with 32-bit libs on 64-bit hosts).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 32.8 KB
RevLine 
[1671]1# $Id: qt3.kmk 2333 2009-04-10 16:31:48Z bird $
2## @file
[1764]3# Qt 3.3.x unit.
[1671]4#
5
6#
[2243]7# Copyright (c) 2008-2009 knut st. osmundsen <bird-kBuild-spamix@anduin.net>
[1671]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#
[2018]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#
[1671]33
[2018]34
[1684]35ifdef UNIT_qt3
36 $(error kBuild: The qt3 unit was included twice!)
37endif
38UNIT_qt3 = qt3
[1671]39
40
[1684]41ifndef UNIT_qt4
42 # Add our target properties (same as qt4).
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
45endif
46PROPS_SINGLE +=
[1685]47PROPS_ACCUMULATE_R += QT_IMAGES
[1671]48
[1684]49
[1671]50#
[1684]51# The QT3 SDK.
[1671]52#
[1685]53# This is implemented here rather than in sdks/QT3.kmk to enforce the global USES.
[1671]54# It also makes things easier to develop, with fewer files I mean.
55#
[1677]56## @todo the SDK might actually not be necessary as it turns out... For now it servers
57# a purpose if the host differs from the target, in theory at least.
[1684]58SDK_QT3 = Qt3
[1671]59
[1677]60# SDK Specific Properties
[1765]61# PATH_SDK_QT3 - the general location of the Qt3 SDK stuff.
62# PATH_SDK_QT3_INC - the Qt3 include directory.
63# PATH_SDK_QT3_LIB - the Qt3 library directory for KBUILD_TARGET.
64# PATH_SDK_QT3_LIB.amd64 - the Qt3 library directory for AMD64.
65# PATH_SDK_QT3_LIB.x86 - the Qt3 library directory for X86.
[1684]66ifndef PATH_SDK_QT3
67 PATH_SDK_QT3 := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v3*)))
68 ifeq ($(PATH_SDK_QT3),)
[1677]69 # If target == host, try look for Qt in the various platform specific places.
70 ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
71 ifeq ($(KBUILD_TARGET),darwin)
[1684]72 # No idea here yet...
73 else ifeq ($(KBUILD_TARGET),os2)
[2219]74 # No idea here yet... Check QTDIR perhaps, but for now users have toset PATH_SDK_QT3.
[1677]75 else ifeq ($(KBUILD_TARGET),win)
[2219]76 # No idea here yet... Check QTDIR perhaps, but for now users have toset PATH_SDK_QT3.
[1677]77 else
[1684]78 # The Unices. Includes and esp. libs are tricky, so override the PATH_SDK_QT3_LIB* stuff if it doesn't work.
[1765]79 # Try find the general location of the thing by looking for the qm2ts program, then try looking for
80 # the moc program in likely and unlikely places save /usr[/local]/bin to avoid mistaking it with Qt4.
[1758]81 PATH_SDK_QT3 := $(patsubst %/bin/qm2ts,%,$(firstword $(wildcard \
82 /usr/lib/qt-3.3/bin/qm2ts \
83 /usr/lib64/qt-3.3/bin/qm2ts \
84 /usr/qt/3/bin/qm2ts \
[1764]85 $(if $(QTDIR),$(QTDIR)/bin/qm2ts) \
[1758]86 /usr/bin/qm2ts \
87 /usr/local/bin/qm2ts \
88 /usr/share/qt3/bin/qm2ts \
[1759]89 )))
[1764]90 ifeq ($(PATH_SDK_QT3),) # Try with moc, but not in /usr/bin and /usr/local/bin.
91 PATH_SDK_QT3 := $(patsubst %/bin/moc,%,$(firstword $(wildcard \
92 /usr/lib/qt-3.3/bin/moc \
93 /usr/lib64/qt-3.3/bin/moc \
94 /usr/qt/3/bin/moc \
95 /usr/share/qt3/bin/moc \
96 $(if $(QTDIR),$(QTDIR)/bin/moc) \
97 )))
98 endif
[1684]99 ifneq ($(PATH_SDK_QT3),)
[1765]100 # Found something! Export the variable for the benefit of recursive make instances.
101 export PATH_SDK_QT3
102
103 # Determin the include directory.
[1684]104 ifeq ($(PATH_SDK_QT3_INC),)
[1765]105 PATH_SDK_QT3_INC := $(patsubst %/private/qfiledefs_p.h,%,$(firstword $(wildcard \
106 $(PATH_SDK_QT3)/include/private/qfiledefs_p.h \
107 $(PATH_SDK_QT3)/include/qt3/private/qfiledefs_p.h \
108 /usr/include/qt3/private/qfiledefs_p.h)))
109 ifneq ($(PATH_SDK_QT3_INC),)
110 export PATH_SDK_QT3_INC
111 endif
[1677]112 endif
[1765]113
114 # Determin the most likely x86 and AMD64 lib directories (only used for making PATH_SDK_QT3_LIB).
[1684]115 ifeq ($(PATH_SDK_QT3_LIB.x86),)
116 PATH_SDK_QT3_LIB.x86 := $(patsubst %/libqt-mt$(SUFF_DLL),%,$(firstword $(wildcard \
117 $(PATH_SDK_QT3)/lib32/libqt-mt$(SUFF_DLL) \
118 $(PATH_SDK_QT3)/lib32/qt3/libqt-mt$(SUFF_DLL) \
[1756]119 $(PATH_SDK_QT3)/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1685]120 /usr/lib32/libqt-mt$(SUFF_DLL) \
121 /usr/lib32/qt3/libqt-mt$(SUFF_DLL) \
[1756]122 /usr/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1685]123 /usr/local/lib32/libqt-mt$(SUFF_DLL) \
124 /usr/local/lib32/qt3/libqt-mt$(SUFF_DLL) \
[1756]125 /usr/local/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1684]126 $(PATH_SDK_QT3)/lib/libqt-mt$(SUFF_DLL) \
127 $(PATH_SDK_QT3)/lib/qt3/libqt-mt$(SUFF_DLL) \
[1756]128 $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1677]129 )))
[1765]130 ifneq ($(PATH_SDK_QT3_LIB.x86),)
131 export PATH_SDK_QT3_LIB.x86
132 endif
[1677]133 endif
[1684]134 ifeq ($(PATH_SDK_QT3_LIB.amd64),)
135 PATH_SDK_QT3_LIB.amd64 := $(patsubst %/libqt-mt$(SUFF_DLL),%,$(firstword $(wildcard \
136 $(PATH_SDK_QT3)/lib64/libqt-mt$(SUFF_DLL) \
137 $(PATH_SDK_QT3)/lib64/qt3/libqt-mt$(SUFF_DLL) \
[1756]138 $(PATH_SDK_QT3)/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1684]139 $(PATH_SDK_QT3)/lib/amd64/libqt-mt$(SUFF_DLL) \
[1756]140 $(PATH_SDK_QT3)/lib/64/libqt-mt$(SUFF_DLL) \
[1685]141 /usr/lib64/libqt-mt$(SUFF_DLL) \
142 /usr/lib64/qt3/libqt-mt$(SUFF_DLL) \
[1756]143 /usr/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1685]144 /usr/lib/amd64/libqt-mt$(SUFF_DLL) \
[1756]145 /usr/lib/64/libqt-mt$(SUFF_DLL) \
[1685]146 /usr/local/lib64/libqt-mt$(SUFF_DLL) \
147 /usr/local/lib64/qt3/libqt-mt$(SUFF_DLL) \
[1756]148 /usr/local/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1685]149 /usr/local/lib/amd64/libqt-mt$(SUFF_DLL) \
[1756]150 /usr/local/lib/64/libqt-mt$(SUFF_DLL) \
[1684]151 $(PATH_SDK_QT3)/lib/libqt-mt$(SUFF_DLL) \
152 $(PATH_SDK_QT3)/lib/qt3/libqt-mt$(SUFF_DLL) \
[1756]153 $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1677]154 )))
[1765]155 ifneq ($(PATH_SDK_QT3_LIB.amd64),)
156 export PATH_SDK_QT3_LIB.amd64
157 endif
[1677]158 endif
[1765]159
160 # Determin the KBUILD_TARGET lib directory.
[1684]161 ifeq ($(PATH_SDK_QT3_LIB),)
[2333]162 PATH_SDK_QT3_LIB := $(PATH_SDK_QT3_LIB.$(KBUILD_TARGET_ARCH))
[1684]163 ifeq ($(PATH_SDK_QT3_LIB),)
164 PATH_SDK_QT3_LIB := $(patsubst %/libqt-mt$(SUFF_DLL),%,$(firstword $(wildcard \
165 $(PATH_SDK_QT3)/lib/libqt-mt$(SUFF_DLL) \
166 $(PATH_SDK_QT3)/lib/qt3/libqt-mt$(SUFF_DLL) \
[1756]167 $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1685]168 /usr/lib/libqt-mt$(SUFF_DLL) \
169 /usr/lib/qt3/libqt-mt$(SUFF_DLL) \
[1756]170 /usr/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1685]171 /usr/local/lib/libqt-mt$(SUFF_DLL) \
172 /usr/local/lib/qt3/libqt-mt$(SUFF_DLL) \
[1756]173 /usr/local/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
[1677]174 )))
[1765]175 ifneq ($(PATH_SDK_QT3_LIB),)
176 export PATH_SDK_QT3_LIB
177 endif
[1677]178 endif
179 endif
[1765]180
[1677]181 endif
182 endif # Unices
183 endif
184 # Found it?
[1684]185 ifeq ($(PATH_SDK_QT3),)
[1685]186 $(warning kBuild: Couldn't find the Qt3 headers and libaries...)
[1684]187 PATH_SDK_QT3 := $(PATH_DEVTOOLS_TRG)/qt/not-found
[1677]188 endif
189 endif
190else
191 # Resolve any fancy stuff once and for all.
[1684]192 PATH_SDK_QT3 := $(PATH_SDK_QT3)
[1677]193endif
[1671]194
[1677]195# Libraries can be in either Frameworks or lib depending on how you
196# build it on the mac. The .dmg installs into Frameworks but builds into lib.
[1684]197PATH_SDK_QT3_LIB ?= $(PATH_SDK_QT3)/lib
198PATH_SDK_QT3_INC ?= $(PATH_SDK_QT3)/include
[1677]199
200# The bits that kBuild picks up.
201# (nothing here)
202
203
[1671]204#
[1684]205# The QT3 tool.
[1671]206#
[1684]207# This is implemented here rather than in tools/QT3.kmk to enforce the global USES.
[1671]208# It also makes things easier to develop, with fewer files I mean.
209#
[1684]210TOOL_QT3 = Qt3
[1671]211
[1765]212# Tool Specific Properties (PATH_TOOL_QT3_BIN and TOOL_QT3_BIN_SUFF)
213# TOOL_QT3_BIN_SUFF - the '-qt3' bit found on debian.
214# PATH_TOOL_QT3_BIN - the directory containing moc, uic, lrelease, lupdate and qm2ts.
215ifndef PATH_TOOL_QT3_BIN
216 PATH_TOOL_QT3_BIN := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_BLD)/qt/v3*/bin)))
217 ifeq ($(PATH_TOOL_QT3_BIN),)
218 if1of ($(KBUILD_HOST), win os2)
[2219]219 # Sorry, no joy here. Check QTDIR perhaps, but for now users have to set PATH_TOOL_QT3_BIN.
[1765]220 else
221 ifdef TOOL_QT3_BIN_SUFF
222 TOOL_QT3_BIN_SUFF := $(TOOL_QT3_BIN_SUFF)
223 endif
224 PATH_TOOL_QT3_BIN := $(patsubst %/qm2ts$(TOOL_QT3_BIN_SUFF),%,$(firstword $(wildcard \
225 /usr/lib/qt-3.3/bin/qm2ts$(TOOL_QT3_BIN_SUFF) \
226 /usr/lib64/qt-3.3/bin/qm2ts$(TOOL_QT3_BIN_SUFF) \
227 /usr/qt/3/bin/qm2ts$(TOOL_QT3_BIN_SUFF) \
228 $(if $(QTDIR),$(QTDIR)/bin/qm2ts$(TOOL_QT3_BIN_SUFF)) \
229 /usr/bin/qm2ts$(TOOL_QT3_BIN_SUFF) \
230 /usr/local/bin/qm2ts$(TOOL_QT3_BIN_SUFF) \
231 /usr/share/qt3/bin/qm2ts$(TOOL_QT3_BIN_SUFF) \
232 )))
233 ifeq ($(PATH_TOOL_QT3_BIN),)
[2018]234 # If we couldn't find the qt3 specific tool qm2ts, debian and other skip
[1765]235 # this (thanks a bundle). Try with look for 'moc' with a '-qt3' extension,
[2018]236 # then for just moc. In the latter case don't search /usr[/local]/bin to
[1765]237 # void finding the qt4 tools and messing up.
238 ifeq ($(TOOL_QT3_BIN_SUFF),)
239 PATH_TOOL_QT3_BIN := $(patsubst %/moc-qt3,%,$(firstword $(wildcard \
240 /usr/bin/moc-qt3 \
241 /usr/local/bin/moc-qt3 \
242 /usr/lib/qt-3.3/bin/moc-qt3 \
243 /usr/lib64/qt-3.3/bin/moc-qt3 \
244 /usr/qt/3/bin/moc-qt3 \
245 /usr/share/qt3/bin/moc-qt3 \
246 $(if $(QTDIR),$(QTDIR)/bin/moc-qt3) \
247 )))
248 endif
249 ifneq ($(PATH_TOOL_QT3_BIN),)
250 export TOOL_QT3_BIN_SUFF := -qt3
251 else
252 PATH_TOOL_QT3_BIN := $(patsubst %/moc$(TOOL_QT3_BIN_SUFF),%,$(firstword $(wildcard \
253 /usr/lib/qt-3.3/bin/moc$(TOOL_QT3_BIN_SUFF) \
254 /usr/lib64/qt-3.3/bin/moc$(TOOL_QT3_BIN_SUFF) \
255 /usr/qt/3/bin/moc$(TOOL_QT3_BIN_SUFF) \
256 /usr/share/qt3/bin/moc$(TOOL_QT3_BIN_SUFF) \
257 $(if $(QTDIR),$(QTDIR)/bin/moc$(TOOL_QT3_BIN_SUFF)) \
258 )))
259 endif
260 endif
261 ifneq ($(PATH_TOOL_QT3_BIN),)
262 export PATH_TOOL_QT3_BIN
263 endif
[1764]264 endif
[1684]265 endif
[1671]266 # If not found, we'll enter the 'pathless' mode.
267else
268 # Resolve any fancy stuff once and for all.
[1765]269 PATH_TOOL_QT3_BIN := $(PATH_TOOL_QT3_BIN)
270 TOOL_QT3_BIN_SUFF := $(TOOL_QT3_BIN_SUFF)
[1671]271endif
[1765]272ifneq ($(PATH_TOOL_QT3_BIN),)
[2219]273 ifeq ($(KBUILD_HOST),os2)
274 TOOL_QT3_ENV_SETUP ?= $(REDIRECT) -E 'BEGINLIBPATH=$(PATH_TOOL_QT3_BIN);$(libpath BEGINLIBPATH)' --
275 endif
276 TOOL_QT3_MOC ?= $(TOOL_QT3_ENV_SETUP) $(PATH_TOOL_QT3_BIN)/moc$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
277 TOOL_QT3_UIC ?= $(TOOL_QT3_ENV_SETUP) $(PATH_TOOL_QT3_BIN)/uic$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
278 TOOL_QT3_LRC ?= $(TOOL_QT3_ENV_SETUP) $(PATH_TOOL_QT3_BIN)/lrelease$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
279 TOOL_QT3_LUPDATE ?= $(TOOL_QT3_ENV_SETUP) $(PATH_TOOL_QT3_BIN)/lupdate$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
[1671]280else
281 # Pathless, relies on the environment.
[1765]282 TOOL_QT3_MOC ?= moc$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
283 TOOL_QT3_UIC ?= uic$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
284 TOOL_QT3_LRC ?= lrelease$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
285 TOOL_QT3_LUPDATE ?= lupdate$(TOOL_QT3_BIN_SUFF)$(HOST_SUFF_EXE)
[1671]286endif
287
288# General Properties used by kBuild and/or units/qt.kmk
[1684]289TOOL_QT3_MOCFLAGS ?=
290TOOL_QT3_UICFLAGS ?=
291TOOL_QT3_LRCFLAGS ?=
[1671]292
293
294## MOC a C++ source file.
295# @param $(target) Normalized main target name.
296# @param $(source) Source filename (relative).
297# @param $(out) Object file name. This shall be (re)created by the compilation.
298# @param $(dep) Dependcy file. This may be (re)created by the compilation.
299# @param $(flags) Flags.
300# @param $(outbase) Output basename (full). Use this for list files and such.
301#
[1684]302TOOL_QT3_MOC_CPP_DEPEND =
303TOOL_QT3_MOC_CPP_DEPORD =
304TOOL_QT3_MOC_CPP_OUTPUT =
305TOOL_QT3_MOC_CPP_OUTPUT_MAYBE =
306define TOOL_QT3_MOC_CPP_CMDS
307 $(QUIET)$(TOOL_QT3_MOC)\
[1671]308 $(flags)\
309 -o $(out)\
[1684]310 -i \
[1671]311 $(source)
312endef
313
314## MOC a C++ header 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 $(outbase) Output basename (full). Use this for list files and such.
321#
[1684]322TOOL_QT3_MOC_HPP_DEPEND =
323TOOL_QT3_MOC_HPP_DEPORD =
324TOOL_QT3_MOC_HPP_OUTPUT =
325TOOL_QT3_MOC_HPP_OUTPUT_MAYBE =
326define TOOL_QT3_MOC_HPP_CMDS
327 $(QUIET)$(TOOL_QT3_MOC)\
[1671]328 $(flags)\
329 -o $(out)\
330 $(source)
331endef
332
333## Compile a Qt user interface file (.ui).
334# @param $(target) Normalized main target name.
335# @param $(source) Source filename (relative).
[1684]336# @param $(out.cpp) The C++ source file to be generated.
337# @param $(out.h) The C++ header file to be generated.
[1671]338# @param $(dep) Dependcy file. This may be (re)created by the compilation.
339# @param $(flags) Flags.
340# @param $(outbase) Output basename (full). Use this for list files and such.
341#
[1684]342TOOL_QT3_UIC_UI_DEPEND =
343TOOL_QT3_UIC_UI_DEPORD =
344TOOL_QT3_UIC_UI_OUTPUT =
345TOOL_QT3_UIC_UI_OUTPUT_MAYBE =
346define TOOL_QT3_UIC_UI_CMDS
347 $(QUIET)$(TOOL_QT3_UIC)\
[1671]348 $(flags)\
[1684]349 -o $(out.h)\
[1671]350 $(source)
[1684]351 $(QUIET)$(TOOL_QT3_UIC)\
[1671]352 $(flags)\
[1684]353 -i $(out.h) \
354 -o $(out.cpp)\
[1671]355 $(source)
356endef
357
[1675]358## Compile a Qt translation file (.ts).
359# @param $(target) Normalized main target name.
360# @param $(source) Source filename (relative).
361# @param $(out) Object file name. This shall be (re)created by the compilation.
362# @param $(dep) Dependcy file. This may be (re)created by the compilation.
363# @param $(flags) Flags.
364# @param $(defs) Definitions.
365# @param $(incs) Includes.
366# @param $(outbase) Output basename (full). Use this for list files and such.
367#
[1684]368TOOL_QT3_LRC_TS_DEPEND =
369TOOL_QT3_LRC_TS_DEPORD =
370TOOL_QT3_LRC_TS_OUTPUT =
371TOOL_QT3_LRC_TS_OUTPUT_MAYBE =
372define TOOL_QT3_LRC_TS_CMDS
373 $(QUIET)$(TOOL_QT3_LRC)\
[1675]374 $(flags)\
375 $(source)\
376 -qm $(out)
377endef
[1671]378
379
[1675]380
[1671]381#
382#
[1685]383# Back to the Qt3 unit.
[1671]384#
385#
386
387
[1675]388## wrapper for the lrelease (LRC) command dependencies.
389ifndef NO_COMPILE_CMDS_DEPS
[1684]390 _UNIT_QT3_LRC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT3_LRC_CMDS_PREV_),$$(commands $(out)),FORCE)
[1675]391else
[1684]392 _UNIT_QT3_LRC_CMDS_DEP =
[1675]393endif
394
[1671]395##
[1684]396# def_unit_qt3_target_pre_handle_translation helper that is expanded before evaluation.
[1671]397#
[1675]398# This is necessary to resolve reference to local variables before doing
399# assignments and setting up commands. They would otherwise be resolved
400# later in a different context and the result would be completely wrong.
401#
[1684]402define def_unit_qt3_target_pre_handle_translation_dx
[1671]403
[1675]404$(out) + $(more_output) +| $(maybe_output): \
405 $(deps) \
[1684]406 $(value _UNIT_QT3_LRC_CMDS_DEP) \
[1675]407 | \
408 $(orderdeps)
409 %$$(call MSG_TOOL,lrelease,$(target),$(source),$$@)
410 $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
[1671]411
[1675]412$(cmds)
413
414ifndef NO_COMPILE_CMDS_DEPS
415 %$$(QUIET2)$$(APPEND) '$(dep)'
[1684]416 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_LRC_CMDS_PREV_'
[1675]417 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
418 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
419endif
420
[2197]421$(target)_CLEAN += $(out) $(more_output) $(maybe_output) $(dep)
[1675]422$(target)-inst-nls_SOURCES += $(out)
423
[1684]424endef # def_unit_qt3_target_pre_handle_translation_dx
[1675]425
426##
427# Handle a source file listed in QT_TRANSLATIONS.
428#
429# The files listed in QT_TRANSLATIONS are translation files (.ts) which needs
430# to be translated into .qm files that are loadble by Qt.
431#
432# @remarks Invoked via $(evalvalctx ).
[1684]433define def_unit_qt3_target_pre_handle_translation
[1675]434local type := LRC
435
436# fetch the properties.
437local tool := $(kb-src-tool dummy_var)
[2239]438local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
[1675]439local outbase := $(qtnlsdir)/$(notdir $(basename $(source)))
440local out := $(outbase).qm
441local dep := $(out).dep
442local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
443local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
444local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
445
446# default path + source dep.
447ifneq ($(defpath),)
[1771]448local source := $(abspathex $(source),$(defpath))
449local deps := $(abspathex $(deps),$(defpath)) $(source)
450local incs := $(abspathex $(incs),$(defpath))
[1675]451else
452local deps += $(source)
453endif
454
455# call the tool
456ifndef TOOL_$(tool)_LRC_TS_CMDS
457 $(error kBuild: qt lrelease tool not found: TOOL_$(tool)_LRC_TS_CMDS)
458endif
459local cmds := $(TOOL_$(tool)_LRC_TS_CMDS)
460local more_output := $(TOOL_$(tool)_LRC_TS_OUTPUT)
461local maybe_output := $(TOOL_$(tool)_LRC_TS_OUTPUT_MAYBE)
462local deps += $(TOOL_$(tool)_LRC_TS_DEPEND)
463local orderdeps += $(TOOL_$(tool)_LRC_TS_DEPORD)
464
465# generate the link rule and update some source and target variables.
466ifndef NO_COMPILE_CMDS_DEPS
467 $(eval includedep $(dep))
468endif
[1684]469$(eval $(def_unit_qt3_target_pre_handle_translation_dx))
[1675]470
[1684]471endef # def_unit_qt3_target_pre_handle_translation
[1675]472
473
474
[1671]475## wrapper for the UIC command dependencies.
476ifndef NO_COMPILE_CMDS_DEPS
[1684]477 _UNIT_QT3_UIC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT3_UIC_CMDS_PREV_),$$(commands $(out.h)),FORCE)
[1671]478else
[1684]479 _UNIT_QT3_UIC_CMDS_DEP =
[1671]480endif
481
482##
[1684]483# def_unit_qt3_src_handler_ui helper that is expanded before evaluation.
[1671]484#
485# This is necessary to resolve reference to local variables before doing
486# assignments and setting up commands. They would otherwise be resolved
487# later in a different context and the result would be completely wrong.
488#
[1684]489define def_unit_qt3_target_pre_handle_ui_dx
[1671]490
[1684]491$(out.h) + $(out.cpp) +| $(realout.h) $(realout.cpp) $(more_output) $(maybe_output): \
[1671]492 $(deps) \
[1684]493 $(value _UNIT_QT3_UIC_CMDS_DEP) \
[1671]494 | \
495 $(orderdeps)
[1684]496 %$$(call MSG_TOOL,uic,$(target),$(source),$(out.h) $(out.cpp))
497 $(QUIET2)$(RM) -f $(out.h) $(out.cpp) $(more_output) $(maybe_output) $(dep)
[1671]498
499$(cmds)
500
[1684]501 $(QUIET)$(CP) --changed -f $(out.h) $(realout.h)
502 $(QUIET)$(CP) --changed -f $(out.cpp) $(realout.cpp)
[1671]503ifndef NO_COMPILE_CMDS_DEPS
504 %$$(QUIET2)$$(APPEND) '$(dep)'
[1684]505 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_UIC_CMDS_PREV_'
506 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out.h)'
[1671]507 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
508endif
509
[1684]510$(target)_INTERMEDIATES += $(realout.h)
511$(target)_GEN_SOURCES_ += $(realout.cpp)
[2197]512$(target)_CLEAN += $(out.h) $(out.cpp) $(realout.h) $(realout.cpp) $(more_output) $(maybe_output) $(dep)
[1671]513
[1684]514endef # def_unit_qt3_target_pre_handle_ui_dx
[1671]515
516##
517# Source handler for .ui sources.
518#
519# @remarks $(evalvalctx me).
[1684]520define def_unit_qt3_src_handler_ui
[1671]521local type := UIC
522
523# fetch the properties.
524local tool := $(kb-src-tool dummy_var)
[2239]525local qtuicdir := $($(target)_0_OUTDIR)/qtuic
[1671]526local outbase := $(qtuicdir)/$(notdir $(basename $(source)))
[1684]527local out.h := $(outbase).tmp.h
528local out.cpp := $(outbase).tmp.cpp
529local realout.h := $(outbase).h
530local realout.cpp:=$(outbase).cpp
531local dep := $(realout.h).dep
[1671]532local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
533local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
534local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
535
536# default path + source dep.
537ifneq ($(defpath),)
[1771]538local source := $(abspathex $(source),$(defpath))
539local deps := $(abspathex $(deps),$(defpath)) $(source)
540local incs := $(abspathex $(incs),$(defpath))
[1671]541else
542local deps += $(source)
543endif
544
545# call the tool
546ifndef TOOL_$(tool)_UIC_UI_CMDS
547 $(error kBuild: qt uic tool not found: TOOL_$(tool)_UIC_UI_CMDS)
548endif
549local cmds := $(TOOL_$(tool)_UIC_UI_CMDS)
550local more_output := $(TOOL_$(tool)_UIC_UI_OUTPUT)
551local maybe_output := $(TOOL_$(tool)_UIC_UI_OUTPUT_MAYBE)
552local deps += $(TOOL_$(tool)_UIC_UI_DEPEND)
553local orderdeps += $(TOOL_$(tool)_UIC_UI_DEPORD)
554
555# generate the link rule and update some source and target variables.
556ifndef NO_COMPILE_CMDS_DEPS
557 $(eval includedep $(dep))
558endif
[1684]559$(eval $(def_unit_qt3_target_pre_handle_ui_dx))
[1671]560
[1684]561endef # def_unit_qt3_src_handler_ui
[1671]562
563
[1675]564
[1671]565## wrapper for the MOC command dependencies.
566ifndef NO_COMPILE_CMDS_DEPS
[1684]567 _UNIT_QT3_MOC_HPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT3_MOC_HPP_CMDS_PREV_),$$(commands $(out)),FORCE)
[1671]568else
[1684]569 _UNIT_QT3_MOC_HPP_CMDS_DEP =
[1671]570endif
571
572##
[1684]573# def_unit_qt3_target_pre_handle_moc_hdr helper that is expanded before evaluation.
[1671]574#
575# This is necessary to resolve reference to local variables before doing
576# assignments and setting up commands. They would otherwise be resolved
577# later in a different context and the result would be completely wrong.
578#
[1684]579define def_unit_qt3_target_pre_handle_moc_hdr_dx
[1671]580
581$(out) +| $(realout) $(more_output) $(maybe_output): \
582 $(deps) \
[1684]583 $(value _UNIT_QT3_MOC_HPP_CMDS_DEP) \
[1671]584 | \
585 $(orderdeps)
[1684]586 %$$(call MSG_TOOL,moc,$(target),$(source),$(realout))
[1671]587 $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
588
589$(cmds)
590
591 $(QUIET)$(CP) --changed -f $(out) $(realout)
592ifndef NO_COMPILE_CMDS_DEPS
593 %$$(QUIET2)$$(APPEND) '$(dep)'
[1684]594 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_MOC_HPP_CMDS_PREV_'
[1671]595 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
596 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
597endif
598
599$(target)_INTERMEDIATES += $(realout)
600$(target)_GEN_SOURCES_ += $(realout)
[2197]601$(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
[1671]602
603endef
604
605##
[1684]606# Handle a source file listed in QT_MOCHDRS.
[1671]607#
[1675]608# The files listed in QT_MOCHDRS uses the Q_OBJECT macro and we will
609# generate a .cpp file for each of them and add it to the generated
610# sources so that it's compiled and linked. (There is an alternative
611# way to do this where the .cpp file is included, this isn't currently
612# supported by this unit.)
[1671]613#
614# @remarks Invoked via $(evalvalctx ).
[1684]615define def_unit_qt3_target_pre_handle_moc_hdr
[1671]616local type := MOC
617
618# fetch the properties.
619local tool := $(kb-src-tool dummy_var)
620local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
621local out := $(outbase).tmp.cpp
622local realout := $(outbase).cpp
623local dep := $(realout).dep
624local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
625local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
626local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
627
628# default path + source dep.
629ifneq ($(defpath),)
[1771]630local source := $(abspathex $(source),$(defpath))
631local deps := $(abspathex $(deps),$(defpath)) $(source)
[1671]632else
633local deps += $(source)
634endif
635
636# call the tool
637ifndef TOOL_$(tool)_MOC_HPP_CMDS
638 $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_HPP_CMDS)
639endif
640local cmds := $(TOOL_$(tool)_MOC_HPP_CMDS)
641local more_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT)
642local maybe_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT_MAYBE)
643local deps += $(TOOL_$(tool)_MOC_HPP_DEPEND)
644local orderdeps += $(TOOL_$(tool)_MOC_HPP_DEPORD)
645
646# generate the link rule and update some source and target variables.
647ifndef NO_COMPILE_CMDS_DEPS
648 $(eval includedep $(dep))
649endif
[1684]650$(eval $(def_unit_qt3_target_pre_handle_moc_hdr_dx))
[1671]651
[1684]652endef # def_unit_qt3_target_pre_handle_moc_hdr
[1671]653
654
[1684]655
656## wrapper for the MOC command dependencies.
657ifndef NO_COMPILE_CMDS_DEPS
658 _UNIT_QT3_MOC_CPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT3_MOC_CPP_CMDS_PREV_),$$(commands $(out)),FORCE)
659else
660 _UNIT_QT3_MOC_CPP_CMDS_DEP =
661endif
662
[1671]663##
[1684]664# def_unit_qt3_target_pre_handle_moc_src helper that is expanded before evaluation.
[1671]665#
666# This is necessary to resolve reference to local variables before doing
667# assignments and setting up commands. They would otherwise be resolved
668# later in a different context and the result would be completely wrong.
669#
[1684]670define def_unit_qt3_target_pre_handle_moc_src_dx
[1671]671
672$(out) +| $(realout) $(more_output) $(maybe_output): \
673 $(deps) \
[1684]674 $(value _UNIT_QT3_MOC_CPP_CMDS_DEP) \
[1671]675 | \
676 $(orderdeps)
[1684]677 %$$(call MSG_TOOL,moc,$(target),$(source),$(realout))
[1671]678 $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
679
680$(cmds)
681
682 $(QUIET)$(CP) --changed -f $(out) $(realout)
683ifndef NO_COMPILE_CMDS_DEPS
684 %$$(QUIET2)$$(APPEND) '$(dep)'
[1684]685 %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_MOC_CPP_CMDS_PREV_'
[1671]686 %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
687 %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
688endif
689
690$(target)_INTERMEDIATES += $(realout)
[2197]691$(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
[1671]692
693endef
694
695##
696# Handle a source file listed in QT_MOCSRCS.
697#
698# The files listed in QT_MOCSRCS uses the Q_OBJECT macro and will include
699# a .moc file that we're expected to generate here.
700#
701# @remarks Invoked via $(evalvalctx ).
[1684]702define def_unit_qt3_target_pre_handle_moc_src
[1671]703local type := MOC
704
705# fetch the properties.
706local tool := $(kb-src-tool dummy_var)
707local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
708local out := $(outbase).tmp.moc
709local realout := $(outbase).moc
710local dep := $(realout).dep
711local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
712local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
713local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
714
715# default path + source dep.
716ifneq ($(defpath),)
[1771]717local source := $(abspathex $(source),$(defpath))
718local deps := $(abspathex $(deps),$(defpath)) $(source)
719local incs := $(abspathex $(incs),$(defpath))
[1671]720else
721local deps += $(source)
722endif
723
724# call the tool
725ifndef TOOL_$(tool)_MOC_CPP_CMDS
726 $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_CPP_CMDS)
727endif
728local cmds := $(TOOL_$(tool)_MOC_CPP_CMDS)
729local more_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT)
730local maybe_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT_MAYBE)
731local deps += $(TOOL_$(tool)_MOC_CPP_DEPEND)
732local orderdeps += $(TOOL_$(tool)_MOC_CPP_DEPORD)
733
734# generate the link rule and update some source and target variables.
735ifndef NO_COMPILE_CMDS_DEPS
736 $(eval includedep $(dep))
737endif
[1684]738$(eval $(def_unit_qt3_target_pre_handle_moc_src_dx))
[1671]739
[1684]740endef # def_unit_qt3_target_pre_handle_moc_src
[1671]741
742
743##
744# Adds sources containing Q_OBJECT to QT_MOCSRCS.
[1684]745define def_unit_qt3_target_pre_cpp_source
[1671]746ifneq ($(file-size $(source)),-1)
747 ifneq ($(strip $(shell $(SED) -f $(KBUILD_PATH)/units/qt-Q_OBJECT.sed $(source))),)
748 $(eval $(target)_QT_MOCSRCS += $(source))
749 endif
750endif
[1684]751endef # def_unit_qt3_target_pre_cpp_source
[1671]752
[1684]753
[1671]754##
755# Invoked early in the processing of a target that uses the Qt unit.
756#
757# It will append the qt source handlers to the target (.h, .ui, .ts,
758# .png, .bmp, .gif).
759#
760# It will then check all the C++ sources and check which needs
761# a .moc files and generate rules and dependencies fofor these
762#
[1684]763define def_unit_qt3_target_pre
[1671]764
[1675]765# Make QTTOOL the default for the specific Qt tools instead of TOOL.
766ifneq ($($(target)_QTTOOL),)
767 ifeq ($($(target)_MOCTOOL),)
[1684]768 $(target)_MOCTOOL := $($(target)_QTTOOL)
[1675]769 endif
770 ifeq ($($(target)_UICTOOL),)
[1684]771 $(target)_UICTOOL := $($(target)_QTTOOL)
[1675]772 endif
773 ifeq ($($(target)_LRCTOOL),)
[1684]774 $(target)_LRCTOOL := $($(target)_QTTOOL)
[1675]775 endif
776endif
777
[1677]778# Deal with QT_MODULES and QT_PREFIX.
779local qt_prefix := $(firstword \
[1761]780 $($(target)_QT_PREFIX.$(bld_trg)) \
781 $($(target)_QT_PREFIX.$(bld_trg_arch)) \
782 $($(target)_QT_PREFIX.$(bld_trg).$(bld_trg_arch)) \
783 $($(target)_QT_PREFIX.$(bld_trg_cpu)) \
784 $($(target)_QT_PREFIX.$(bld_type)) \
[1677]785 $($(target)_QT_PREFIX))
[1684]786ifeq ($(bld_trg),win)
[1756]787 local qt_lib := $(firstword $(wildcard \
[1761]788 $(PATH_SDK_QT3_LIB)/dynamic/$(qt_prefix)qt-mt3*$(SUFF_LIB) \
789 $(PATH_SDK_QT3_LIB)/$(qt_prefix)qt-mt3*$(SUFF_LIB) \
[1756]790 $(PATH_SDK_QT3_LIB)/dynamic/$(qt_prefix)qt-mt$(SUFF_LIB) \
791 $(PATH_SDK_QT3_LIB)/$(qt_prefix)qt-mt$(SUFF_LIB) \
[1761]792 $(PATH_SDK_QT3_LIB)/dynamic/$(qt_prefix)Qt3*$(SUFF_LIB) \
793 $(PATH_SDK_QT3_LIB)/$(qt_prefix)Qt3*$(SUFF_LIB) \
794 $(PATH_SDK_QT3_LIB)/dynamic/$(qt_prefix)Qt*$(SUFF_LIB) \
795 $(PATH_SDK_QT3_LIB)/$(qt_prefix)Qt*$(SUFF_LIB) \
[1756]796 ) $(PATH_SDK_QT3_LIB)/$(qt_prefix)qt-mt$(SUFF_LIB) )
797 $(eval $(target)_LIBS += $(qt_lib) )
[1684]798 ifeq ($(tool_do),LINK_PROGRAM)
[1756]799 local qt_main_lib := $(firstword $(wildcard \
800 $(PATH_SDK_QT3_LIB)/$(qt_prefix)qtmain$(SUFF_LIB) \
[1760]801 $(PATH_SDK_QT3_LIB)/qtmain$(SUFF_LIB) \
[1756]802 ) $(PATH_SDK_QT3_LIB)/$(qt_prefix)qtmain$(SUFF_LIB) )
803 $(eval $(target)_LIBS += $(qt_main_lib) )
[1684]804 endif
[2221]805else ifeq ($(bld_trg),os2)
[2219]806 # This is a real PITA since the dll/lib can be called (almost) anything. :-(
807 local qt_lib := $(firstword $(wildcard \
808 $(PATH_SDK_QT3_LIB)/$(qt_prefix)*qt3*$(SUFF_LIB) \
809 $(PATH_SDK_QT3_LIB)/$(qt_prefix)*qt*$(SUFF_LIB) \
810 ))
811 ifeq ($(qt_lib),)
812 local qt_prls := $(basename $(wildcard $(PATH_SDK_QT3_LIB)/$(qt_prefix)*.prl))
813 local qt_defs := $(basename $(wildcard $(PATH_SDK_QT3_LIB)/$(qt_prefix)*.def))
814 local qt_dlls := $(basename $(wildcard $(PATH_SDK_QT3_LIB)/$(qt_prefix)*.dll))
815 local qt_libs := $(basename $(wildcard $(PATH_SDK_QT3_LIB)/$(qt_prefix)*.lib))
816 local qt_lib := $(firstword \
817 $(addsuffix .lib,$(filter $(qt_prls), $(filter $(qt_defs), $(filter $(qt_dlls), $(qt_libs))))) \
818 $(PATH_SDK_QT3_LIB)/myqt.lib )
819 endif
820 $(eval $(target)_LIBS += $(qt_lib) )
[1677]821else
[1770]822 local qt_lib := $(PATH_SDK_QT3_LIB)/lib$(qt_prefix)qt-mt$(SUFF_DLL)
823 $(eval $(target)_LIBS += $(qt_lib) )
[1677]824endif
[1684]825$(eval $(target)_INCS += $(PATH_SDK_QT3_INC) )
[1677]826
[1770]827# On Qt3 we will try pickup the QMAKE_PRL_DEFINES listed in the .prl file (in libs).
828local qt_prl := $(firstword $(wildcard \
829 $(patsubst %$(SUFF_DLL),%,$(patsubst %$(SUFF_LIB),%,$(qt_lib))).prl \
830 $(dir $(qt_lib))/$(qt_prefix)qt-mt.prl \
831 $(dir $(qt_lib))/*qt-mt*.prl \
832 $(dir $(qt_lib))/*qt*.prl \
833 ))
834ifneq ($(qt_prl),)
835 include $(qt_prl)
836 $(eval $(target)_DEFS += $(QMAKE_PRL_DEFINES))
837endif
838
[1671]839# Autodetect source files with Q_OBJECT references if QT_MOCSRCS is undefined. (slow)
840# Tip: Use target_QT_MOCSRCS = $(NO_SUCH_VARIABLE) to avoid this.
841ifndef $(target)_QT_MOCSRCS
842 $(foreach source, $(filter %.cxx %.CXX %.cpp %.CPP %.cc %.CC,\
[1761]843 $($(target)_SOURCES.$(bld_trg)) \
844 $($(target)_SOURCES.$(bld_trg_arch)) \
845 $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
846 $($(target)_SOURCES.$(bld_trg_cpu)) \
847 $($(target)_SOURCES.$(bld_type)) \
[1671]848 $($(target)_SOURCES) \
[1684]849 ), $(evalval def_unit_qt3_target_pre_cpp_source))
[1671]850endif
851
852# Install source handlers for .ui files.
853$(target)_SRC_HANDLERS += \
[1684]854 .ui:def_unit_qt3_src_handler_ui \
855 .UI:def_unit_qt3_src_handler_ui
[1671]856
857# Calc the MOC and UI output directories and add them to BLDDIRS and INCS.
[2239]858local qtmocdir := $($(target)_0_OUTDIR)/qtmoc
859local qtuicdir := $($(target)_0_OUTDIR)/qtuic
860local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
[1684]861$(eval $(target)_BLDDIRS += $(qtmocdir) $(qtuicdir) $(qtnlsdir) )
862$(eval $(target)_INCS += $(qtmocdir) $(qtuicdir) )
[1671]863
[1684]864# Calc .ui sources so we can add them to the QT_MOCSRCS and QT_MOCHDRS.
865local ui_sources := $(notdir $(basename $(filter %.ui %.UI, \
[1761]866 $($(target)_SOURCES.$(bld_trg)) \
867 $($(target)_SOURCES.$(bld_trg_arch)) \
868 $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
869 $($(target)_SOURCES.$(bld_trg_cpu)) \
870 $($(target)_SOURCES.$(bld_type)) \
[1684]871 $($(target)_SOURCES) \
872 )))
873#$(error ui_sources:=$(ui_sources))
874
[1671]875# Deal with QT_MOCSRCS.
876$(foreach source, \
[1761]877 $($(target)_QT_MOCSRCS.$(bld_trg)) \
878 $($(target)_QT_MOCSRCS.$(bld_trg_arch)) \
879 $($(target)_QT_MOCSRCS.$(bld_trg).$(bld_trg_arch)) \
880 $($(target)_QT_MOCSRCS.$(bld_trg_cpu)) \
881 $($(target)_QT_MOCSRCS.$(bld_type)) \
[1671]882 $($(target)_QT_MOCSRCS) \
[1684]883 $(addsuffix .h,$(addprefix $(qtuicdir)/,$(notdir $(basename $(ui_sources))))) \
884 , $(evalvalctx def_unit_qt3_target_pre_handle_moc_src))
[1671]885
886# Deal with QT_MOCHDRS.
887$(foreach source, \
[1761]888 $($(target)_QT_MOCHDRS.$(bld_trg)) \
889 $($(target)_QT_MOCHDRS.$(bld_trg_arch)) \
890 $($(target)_QT_MOCHDRS.$(bld_trg).$(bld_trg_arch)) \
891 $($(target)_QT_MOCHDRS.$(bld_trg_cpu)) \
892 $($(target)_QT_MOCHDRS.$(bld_type)) \
[1671]893 $($(target)_QT_MOCHDRS) \
[1684]894 $(addsuffix .h,$(addprefix $(qtuicdir)/,$(notdir $(basename $(ui_sources))))) \
895 , $(evalvalctx def_unit_qt3_target_pre_handle_moc_hdr))
[1671]896
[1675]897# Deal with QT_TRANSLATIONS.
898# ASSUMES (_ALL_)INSTALLS is processed after the targets using this unit.
899local translations := \
[1761]900 $($(target)_QT_TRANSLATIONS.$(bld_trg)) \
901 $($(target)_QT_TRANSLATIONS.$(bld_trg_arch)) \
902 $($(target)_QT_TRANSLATIONS.$(bld_trg).$(bld_trg_arch)) \
903 $($(target)_QT_TRANSLATIONS.$(bld_trg_cpu)) \
904 $($(target)_QT_TRANSLATIONS.$(bld_type)) \
[1675]905 $($(target)_QT_TRANSLATIONS)
906ifneq ($(strip $(translations)),)
907 local expr := _ALL_INSTALLS += $(target)-inst-nls
908 $(eval $(expr))
909 ifdef $(target)_QT_TRANSLATIONS_TEMPLATE
910 $(target)-inst-nls_TEMPLATE := $($(target)_QT_TRANSLATIONS_TEMPLATE)
[1688]911 else
912 $(target)-inst-nls_MODE := 0644
[1675]913 endif
914 ifdef $(target)_QT_TRANSLATIONS_INST
915 $(target)-inst-nls_INST := $($(target)_QT_TRANSLATIONS_INST)
916 endif
917 $(target)-inst-nls_SOURCES :=
918 $(foreach source, $(translations)\
[1684]919 , $(evalvalctx def_unit_qt3_target_pre_handle_translation))
[1675]920endif
921
[1684]922endef # def_unit_qt3_target_pre
[1671]923
[1766]924
925#
926# Rule for debugging.
927#
928unit-qt3-show-vars:
929 @$(ECHO) 'The Qt3 SDK variables:'
930 @$(ECHO) ' PATH_SDK_QT3 = "$(PATH_SDK_QT3)"'
931 @$(ECHO) ' PATH_SDK_QT3_INC = "$(PATH_SDK_QT3_INC)"'
932 @$(ECHO) ' PATH_SDK_QT3_LIB = "$(PATH_SDK_QT3_LIB)"'
933 @$(ECHO) ' PATH_SDK_QT3_LIB.amd64 = "$(PATH_SDK_QT3_LIB.amd64)"'
934 @$(ECHO) ' PATH_SDK_QT3_LIB.x86 = "$(PATH_SDK_QT3_LIB.x86)"'
935 @$(ECHO) 'The Qt3 TOOL variables:'
936 @$(ECHO) ' PATH_TOOL_QT3_BIN = "$(PATH_TOOL_QT3_BIN)"'
937 @$(ECHO) ' TOOL_QT3_BIN_SUFF = "$(TOOL_QT3_BIN_SUFF)"'
938 @$(ECHO) ' TOOL_QT3_MOC = "$(TOOL_QT3_MOC)"'
939 @$(ECHO) ' TOOL_QT3_UIC = "$(TOOL_QT3_UIC)"'
940 @$(ECHO) ' TOOL_QT3_LRC = "$(TOOL_QT3_LRC)"'
941 @$(ECHO) ' TOOL_QT3_LUPDATE = "$(TOOL_QT3_LUPDATE)"'
942
Note: See TracBrowser for help on using the repository browser.