1 | # $Id: qt3.kmk 2479 2011-07-20 14:16:19Z bird $
|
---|
2 | ## @file
|
---|
3 | # Qt 3.3.x unit.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2008-2010 knut st. osmundsen <bird-kBuild-spamx@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_qt3
|
---|
36 | $(error kBuild: The qt3 unit was included twice!)
|
---|
37 | endif
|
---|
38 | UNIT_qt3 = qt3
|
---|
39 |
|
---|
40 |
|
---|
41 | ifndef 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
|
---|
45 | endif
|
---|
46 | PROPS_SINGLE +=
|
---|
47 | PROPS_ACCUMULATE_R += QT_IMAGES
|
---|
48 |
|
---|
49 |
|
---|
50 | #
|
---|
51 | # The QT3 SDK.
|
---|
52 | #
|
---|
53 | # This is implemented here rather than in sdks/QT3.kmk to enforce the global USES.
|
---|
54 | # It also makes things easier to develop, with fewer files I mean.
|
---|
55 | #
|
---|
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.
|
---|
58 | SDK_QT3 = Qt3
|
---|
59 |
|
---|
60 | # SDK Specific Properties
|
---|
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.
|
---|
66 | ifndef PATH_SDK_QT3
|
---|
67 | PATH_SDK_QT3 := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v3*)))
|
---|
68 | ifeq ($(PATH_SDK_QT3),)
|
---|
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)
|
---|
72 | # No idea here yet...
|
---|
73 | else ifeq ($(KBUILD_TARGET),os2)
|
---|
74 | # No idea here yet... Check QTDIR perhaps, but for now users have toset PATH_SDK_QT3.
|
---|
75 | else ifeq ($(KBUILD_TARGET),win)
|
---|
76 | # No idea here yet... Check QTDIR perhaps, but for now users have toset PATH_SDK_QT3.
|
---|
77 | else
|
---|
78 | # The Unices. Includes and esp. libs are tricky, so override the PATH_SDK_QT3_LIB* stuff if it doesn't work.
|
---|
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.
|
---|
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 \
|
---|
85 | $(if $(QTDIR),$(QTDIR)/bin/qm2ts) \
|
---|
86 | /usr/bin/qm2ts \
|
---|
87 | /usr/local/bin/qm2ts \
|
---|
88 | /usr/share/qt3/bin/qm2ts \
|
---|
89 | )))
|
---|
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
|
---|
99 | ifneq ($(PATH_SDK_QT3),)
|
---|
100 | # Found something! Export the variable for the benefit of recursive make instances.
|
---|
101 | export PATH_SDK_QT3
|
---|
102 |
|
---|
103 | # Determin the include directory.
|
---|
104 | ifeq ($(PATH_SDK_QT3_INC),)
|
---|
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
|
---|
112 | endif
|
---|
113 |
|
---|
114 | # Determin the most likely x86 and AMD64 lib directories (only used for making PATH_SDK_QT3_LIB).
|
---|
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) \
|
---|
119 | $(PATH_SDK_QT3)/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
120 | /usr/lib32/libqt-mt$(SUFF_DLL) \
|
---|
121 | /usr/lib32/qt3/libqt-mt$(SUFF_DLL) \
|
---|
122 | /usr/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
123 | /usr/local/lib32/libqt-mt$(SUFF_DLL) \
|
---|
124 | /usr/local/lib32/qt3/libqt-mt$(SUFF_DLL) \
|
---|
125 | /usr/local/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
126 | $(PATH_SDK_QT3)/lib/libqt-mt$(SUFF_DLL) \
|
---|
127 | $(PATH_SDK_QT3)/lib/qt3/libqt-mt$(SUFF_DLL) \
|
---|
128 | $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
129 | )))
|
---|
130 | ifneq ($(PATH_SDK_QT3_LIB.x86),)
|
---|
131 | export PATH_SDK_QT3_LIB.x86
|
---|
132 | endif
|
---|
133 | endif
|
---|
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) \
|
---|
138 | $(PATH_SDK_QT3)/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
139 | $(PATH_SDK_QT3)/lib/amd64/libqt-mt$(SUFF_DLL) \
|
---|
140 | $(PATH_SDK_QT3)/lib/64/libqt-mt$(SUFF_DLL) \
|
---|
141 | /usr/lib64/libqt-mt$(SUFF_DLL) \
|
---|
142 | /usr/lib64/qt3/libqt-mt$(SUFF_DLL) \
|
---|
143 | /usr/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
144 | /usr/lib/amd64/libqt-mt$(SUFF_DLL) \
|
---|
145 | /usr/lib/64/libqt-mt$(SUFF_DLL) \
|
---|
146 | /usr/local/lib64/libqt-mt$(SUFF_DLL) \
|
---|
147 | /usr/local/lib64/qt3/libqt-mt$(SUFF_DLL) \
|
---|
148 | /usr/local/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
149 | /usr/local/lib/amd64/libqt-mt$(SUFF_DLL) \
|
---|
150 | /usr/local/lib/64/libqt-mt$(SUFF_DLL) \
|
---|
151 | $(PATH_SDK_QT3)/lib/libqt-mt$(SUFF_DLL) \
|
---|
152 | $(PATH_SDK_QT3)/lib/qt3/libqt-mt$(SUFF_DLL) \
|
---|
153 | $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
154 | )))
|
---|
155 | ifneq ($(PATH_SDK_QT3_LIB.amd64),)
|
---|
156 | export PATH_SDK_QT3_LIB.amd64
|
---|
157 | endif
|
---|
158 | endif
|
---|
159 |
|
---|
160 | # Determin the KBUILD_TARGET lib directory.
|
---|
161 | ifeq ($(PATH_SDK_QT3_LIB),)
|
---|
162 | PATH_SDK_QT3_LIB := $(PATH_SDK_QT3_LIB.$(KBUILD_TARGET_ARCH))
|
---|
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) \
|
---|
167 | $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
168 | /usr/lib/libqt-mt$(SUFF_DLL) \
|
---|
169 | /usr/lib/qt3/libqt-mt$(SUFF_DLL) \
|
---|
170 | /usr/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
171 | /usr/local/lib/libqt-mt$(SUFF_DLL) \
|
---|
172 | /usr/local/lib/qt3/libqt-mt$(SUFF_DLL) \
|
---|
173 | /usr/local/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \
|
---|
174 | )))
|
---|
175 | ifneq ($(PATH_SDK_QT3_LIB),)
|
---|
176 | export PATH_SDK_QT3_LIB
|
---|
177 | endif
|
---|
178 | endif
|
---|
179 | endif
|
---|
180 |
|
---|
181 | endif
|
---|
182 | endif # Unices
|
---|
183 | endif
|
---|
184 | # Found it?
|
---|
185 | ifeq ($(PATH_SDK_QT3),)
|
---|
186 | $(warning kBuild: Couldn't find the Qt3 headers and libaries...)
|
---|
187 | PATH_SDK_QT3 := $(PATH_DEVTOOLS_TRG)/qt/not-found
|
---|
188 | endif
|
---|
189 | endif
|
---|
190 | else
|
---|
191 | # Resolve any fancy stuff once and for all.
|
---|
192 | PATH_SDK_QT3 := $(PATH_SDK_QT3)
|
---|
193 | endif
|
---|
194 |
|
---|
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.
|
---|
197 | PATH_SDK_QT3_LIB ?= $(PATH_SDK_QT3)/lib
|
---|
198 | PATH_SDK_QT3_INC ?= $(PATH_SDK_QT3)/include
|
---|
199 |
|
---|
200 | # The bits that kBuild picks up.
|
---|
201 | # (nothing here)
|
---|
202 |
|
---|
203 |
|
---|
204 | #
|
---|
205 | # The QT3 tool.
|
---|
206 | #
|
---|
207 | # This is implemented here rather than in tools/QT3.kmk to enforce the global USES.
|
---|
208 | # It also makes things easier to develop, with fewer files I mean.
|
---|
209 | #
|
---|
210 | TOOL_QT3 = Qt3
|
---|
211 |
|
---|
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.
|
---|
215 | ifndef 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)
|
---|
219 | # Sorry, no joy here. Check QTDIR perhaps, but for now users have to set PATH_TOOL_QT3_BIN.
|
---|
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),)
|
---|
234 | # If we couldn't find the qt3 specific tool qm2ts, debian and other skip
|
---|
235 | # this (thanks a bundle). Try with look for 'moc' with a '-qt3' extension,
|
---|
236 | # then for just moc. In the latter case don't search /usr[/local]/bin to
|
---|
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
|
---|
264 | endif
|
---|
265 | endif
|
---|
266 | # If not found, we'll enter the 'pathless' mode.
|
---|
267 | else
|
---|
268 | # Resolve any fancy stuff once and for all.
|
---|
269 | PATH_TOOL_QT3_BIN := $(PATH_TOOL_QT3_BIN)
|
---|
270 | TOOL_QT3_BIN_SUFF := $(TOOL_QT3_BIN_SUFF)
|
---|
271 | endif
|
---|
272 | ifneq ($(PATH_TOOL_QT3_BIN),)
|
---|
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)
|
---|
280 | else
|
---|
281 | # Pathless, relies on the environment.
|
---|
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)
|
---|
286 | endif
|
---|
287 |
|
---|
288 | # General Properties used by kBuild and/or units/qt.kmk
|
---|
289 | TOOL_QT3_MOCFLAGS ?=
|
---|
290 | TOOL_QT3_UICFLAGS ?=
|
---|
291 | TOOL_QT3_LRCFLAGS ?=
|
---|
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 | #
|
---|
302 | TOOL_QT3_MOC_CPP_DEPEND =
|
---|
303 | TOOL_QT3_MOC_CPP_DEPORD =
|
---|
304 | TOOL_QT3_MOC_CPP_OUTPUT =
|
---|
305 | TOOL_QT3_MOC_CPP_OUTPUT_MAYBE =
|
---|
306 | define TOOL_QT3_MOC_CPP_CMDS
|
---|
307 | $(QUIET)$(TOOL_QT3_MOC)\
|
---|
308 | $(flags)\
|
---|
309 | -o $(out)\
|
---|
310 | -i \
|
---|
311 | $(source)
|
---|
312 | endef
|
---|
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 | #
|
---|
322 | TOOL_QT3_MOC_HPP_DEPEND =
|
---|
323 | TOOL_QT3_MOC_HPP_DEPORD =
|
---|
324 | TOOL_QT3_MOC_HPP_OUTPUT =
|
---|
325 | TOOL_QT3_MOC_HPP_OUTPUT_MAYBE =
|
---|
326 | define TOOL_QT3_MOC_HPP_CMDS
|
---|
327 | $(QUIET)$(TOOL_QT3_MOC)\
|
---|
328 | $(flags)\
|
---|
329 | -o $(out)\
|
---|
330 | $(source)
|
---|
331 | endef
|
---|
332 |
|
---|
333 | ## Compile a Qt user interface file (.ui).
|
---|
334 | # @param $(target) Normalized main target name.
|
---|
335 | # @param $(source) Source filename (relative).
|
---|
336 | # @param $(out.cpp) The C++ source file to be generated.
|
---|
337 | # @param $(out.h) The C++ header file to be generated.
|
---|
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 | #
|
---|
342 | TOOL_QT3_UIC_UI_DEPEND =
|
---|
343 | TOOL_QT3_UIC_UI_DEPORD =
|
---|
344 | TOOL_QT3_UIC_UI_OUTPUT =
|
---|
345 | TOOL_QT3_UIC_UI_OUTPUT_MAYBE =
|
---|
346 | define TOOL_QT3_UIC_UI_CMDS
|
---|
347 | $(QUIET)$(TOOL_QT3_UIC)\
|
---|
348 | $(flags)\
|
---|
349 | -o $(out.h)\
|
---|
350 | $(source)
|
---|
351 | $(QUIET)$(TOOL_QT3_UIC)\
|
---|
352 | $(flags)\
|
---|
353 | -i $(out.h) \
|
---|
354 | -o $(out.cpp)\
|
---|
355 | $(source)
|
---|
356 | endef
|
---|
357 |
|
---|
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 | #
|
---|
368 | TOOL_QT3_LRC_TS_DEPEND =
|
---|
369 | TOOL_QT3_LRC_TS_DEPORD =
|
---|
370 | TOOL_QT3_LRC_TS_OUTPUT =
|
---|
371 | TOOL_QT3_LRC_TS_OUTPUT_MAYBE =
|
---|
372 | define TOOL_QT3_LRC_TS_CMDS
|
---|
373 | $(QUIET)$(TOOL_QT3_LRC)\
|
---|
374 | $(flags)\
|
---|
375 | $(source)\
|
---|
376 | -qm $(out)
|
---|
377 | endef
|
---|
378 |
|
---|
379 |
|
---|
380 |
|
---|
381 | #
|
---|
382 | #
|
---|
383 | # Back to the Qt3 unit.
|
---|
384 | #
|
---|
385 | #
|
---|
386 |
|
---|
387 |
|
---|
388 | ## wrapper for the lrelease (LRC) command dependencies.
|
---|
389 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
390 | _UNIT_QT3_LRC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT3_LRC_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
391 | else
|
---|
392 | _UNIT_QT3_LRC_CMDS_DEP =
|
---|
393 | endif
|
---|
394 |
|
---|
395 | ##
|
---|
396 | # def_unit_qt3_target_pre_handle_translation helper that is expanded before evaluation.
|
---|
397 | #
|
---|
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 | #
|
---|
402 | define def_unit_qt3_target_pre_handle_translation_dx
|
---|
403 |
|
---|
404 | $(out) + $(more_output) +| $(maybe_output): \
|
---|
405 | $(deps) \
|
---|
406 | $(value _UNIT_QT3_LRC_CMDS_DEP) \
|
---|
407 | | \
|
---|
408 | $(orderdeps)
|
---|
409 | %$$(call MSG_TOOL,lrelease,$(target),$(source),$$@)
|
---|
410 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
411 |
|
---|
412 | $(cmds)
|
---|
413 |
|
---|
414 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
415 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
416 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_LRC_CMDS_PREV_'
|
---|
417 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
418 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
419 | endif
|
---|
420 |
|
---|
421 | $(target)_CLEAN += $(out) $(more_output) $(maybe_output) $(dep)
|
---|
422 | $(target)-inst-nls_SOURCES += $(out)
|
---|
423 |
|
---|
424 | endef # def_unit_qt3_target_pre_handle_translation_dx
|
---|
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 ).
|
---|
433 | define def_unit_qt3_target_pre_handle_translation
|
---|
434 | local type := LRC
|
---|
435 |
|
---|
436 | # fetch the properties.
|
---|
437 | local tool := $(kb-src-tool dummy_var)
|
---|
438 | local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
|
---|
439 | local outbase := $(qtnlsdir)/$(notdir $(basename $(source)))
|
---|
440 | local out := $(outbase).qm
|
---|
441 | local dep := $(out).dep
|
---|
442 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
443 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
444 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
445 |
|
---|
446 | # default path + source dep.
|
---|
447 | ifneq ($(defpath),)
|
---|
448 | local source := $(abspathex $(source),$(defpath))
|
---|
449 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
450 | local incs := $(abspathex $(incs),$(defpath))
|
---|
451 | else
|
---|
452 | local deps += $(source)
|
---|
453 | endif
|
---|
454 |
|
---|
455 | # call the tool
|
---|
456 | ifndef TOOL_$(tool)_LRC_TS_CMDS
|
---|
457 | $(error kBuild: qt lrelease tool not found: TOOL_$(tool)_LRC_TS_CMDS)
|
---|
458 | endif
|
---|
459 | local cmds := $(TOOL_$(tool)_LRC_TS_CMDS)
|
---|
460 | local more_output := $(TOOL_$(tool)_LRC_TS_OUTPUT)
|
---|
461 | local maybe_output := $(TOOL_$(tool)_LRC_TS_OUTPUT_MAYBE)
|
---|
462 | local deps += $(TOOL_$(tool)_LRC_TS_DEPEND)
|
---|
463 | local orderdeps += $(TOOL_$(tool)_LRC_TS_DEPORD)
|
---|
464 |
|
---|
465 | # generate the link rule and update some source and target variables.
|
---|
466 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
467 | $(eval includedep $(dep))
|
---|
468 | endif
|
---|
469 | $(eval $(def_unit_qt3_target_pre_handle_translation_dx))
|
---|
470 |
|
---|
471 | endef # def_unit_qt3_target_pre_handle_translation
|
---|
472 |
|
---|
473 |
|
---|
474 |
|
---|
475 | ## wrapper for the UIC command dependencies.
|
---|
476 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
477 | _UNIT_QT3_UIC_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT3_UIC_CMDS_PREV_),$$(commands $(out.h)),FORCE)
|
---|
478 | else
|
---|
479 | _UNIT_QT3_UIC_CMDS_DEP =
|
---|
480 | endif
|
---|
481 |
|
---|
482 | ##
|
---|
483 | # def_unit_qt3_src_handler_ui helper that is expanded before evaluation.
|
---|
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 | #
|
---|
489 | define def_unit_qt3_target_pre_handle_ui_dx
|
---|
490 |
|
---|
491 | $(out.h) + $(out.cpp) +| $(realout.h) $(realout.cpp) $(more_output) $(maybe_output): \
|
---|
492 | $(deps) \
|
---|
493 | $(value _UNIT_QT3_UIC_CMDS_DEP) \
|
---|
494 | | \
|
---|
495 | $(orderdeps)
|
---|
496 | %$$(call MSG_TOOL,uic,$(target),$(source),$(out.h) $(out.cpp))
|
---|
497 | $(QUIET2)$(RM) -f $(out.h) $(out.cpp) $(more_output) $(maybe_output) $(dep)
|
---|
498 |
|
---|
499 | $(cmds)
|
---|
500 |
|
---|
501 | $(QUIET)$(CP) --changed -f $(out.h) $(realout.h)
|
---|
502 | $(QUIET)$(CP) --changed -f $(out.cpp) $(realout.cpp)
|
---|
503 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
504 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
505 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_UIC_CMDS_PREV_'
|
---|
506 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out.h)'
|
---|
507 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
508 | endif
|
---|
509 |
|
---|
510 | $(target)_INTERMEDIATES += $(realout.h)
|
---|
511 | $(target)_GEN_SOURCES_ += $(realout.cpp)
|
---|
512 | $(target)_CLEAN += $(out.h) $(out.cpp) $(realout.h) $(realout.cpp) $(more_output) $(maybe_output) $(dep)
|
---|
513 |
|
---|
514 | endef # def_unit_qt3_target_pre_handle_ui_dx
|
---|
515 |
|
---|
516 | ##
|
---|
517 | # Source handler for .ui sources.
|
---|
518 | #
|
---|
519 | # @remarks $(evalvalctx me).
|
---|
520 | define def_unit_qt3_src_handler_ui
|
---|
521 | local type := UIC
|
---|
522 |
|
---|
523 | # fetch the properties.
|
---|
524 | local tool := $(kb-src-tool dummy_var)
|
---|
525 | local qtuicdir := $($(target)_0_OUTDIR)/qtuic
|
---|
526 | local outbase := $(qtuicdir)/$(notdir $(basename $(source)))
|
---|
527 | local out.h := $(outbase).tmp.h
|
---|
528 | local out.cpp := $(outbase).tmp.cpp
|
---|
529 | local realout.h := $(outbase).h
|
---|
530 | local realout.cpp:=$(outbase).cpp
|
---|
531 | local dep := $(realout.h).dep
|
---|
532 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
533 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
534 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
535 |
|
---|
536 | # default path + source dep.
|
---|
537 | ifneq ($(defpath),)
|
---|
538 | local source := $(abspathex $(source),$(defpath))
|
---|
539 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
540 | local incs := $(abspathex $(incs),$(defpath))
|
---|
541 | else
|
---|
542 | local deps += $(source)
|
---|
543 | endif
|
---|
544 |
|
---|
545 | # call the tool
|
---|
546 | ifndef TOOL_$(tool)_UIC_UI_CMDS
|
---|
547 | $(error kBuild: qt uic tool not found: TOOL_$(tool)_UIC_UI_CMDS)
|
---|
548 | endif
|
---|
549 | local cmds := $(TOOL_$(tool)_UIC_UI_CMDS)
|
---|
550 | local more_output := $(TOOL_$(tool)_UIC_UI_OUTPUT)
|
---|
551 | local maybe_output := $(TOOL_$(tool)_UIC_UI_OUTPUT_MAYBE)
|
---|
552 | local deps += $(TOOL_$(tool)_UIC_UI_DEPEND)
|
---|
553 | local orderdeps += $(TOOL_$(tool)_UIC_UI_DEPORD)
|
---|
554 |
|
---|
555 | # generate the link rule and update some source and target variables.
|
---|
556 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
557 | $(eval includedep $(dep))
|
---|
558 | endif
|
---|
559 | $(eval $(def_unit_qt3_target_pre_handle_ui_dx))
|
---|
560 |
|
---|
561 | endef # def_unit_qt3_src_handler_ui
|
---|
562 |
|
---|
563 |
|
---|
564 |
|
---|
565 | ## wrapper for the MOC command dependencies.
|
---|
566 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
567 | _UNIT_QT3_MOC_HPP_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_QT3_MOC_HPP_CMDS_PREV_),$$(commands $(out)),FORCE)
|
---|
568 | else
|
---|
569 | _UNIT_QT3_MOC_HPP_CMDS_DEP =
|
---|
570 | endif
|
---|
571 |
|
---|
572 | ##
|
---|
573 | # def_unit_qt3_target_pre_handle_moc_hdr helper that is expanded before evaluation.
|
---|
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 | #
|
---|
579 | define def_unit_qt3_target_pre_handle_moc_hdr_dx
|
---|
580 |
|
---|
581 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
582 | $(deps) \
|
---|
583 | $(value _UNIT_QT3_MOC_HPP_CMDS_DEP) \
|
---|
584 | | \
|
---|
585 | $(orderdeps)
|
---|
586 | %$$(call MSG_TOOL,moc,$(target),$(source),$(realout))
|
---|
587 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
588 |
|
---|
589 | $(cmds)
|
---|
590 |
|
---|
591 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
592 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
593 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
594 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_MOC_HPP_CMDS_PREV_'
|
---|
595 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
596 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
597 | endif
|
---|
598 |
|
---|
599 | $(target)_INTERMEDIATES += $(realout)
|
---|
600 | $(target)_GEN_SOURCES_ += $(realout)
|
---|
601 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
602 |
|
---|
603 | endef
|
---|
604 |
|
---|
605 | ##
|
---|
606 | # Handle a source file listed in QT_MOCHDRS.
|
---|
607 | #
|
---|
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.)
|
---|
613 | #
|
---|
614 | # @remarks Invoked via $(evalvalctx ).
|
---|
615 | define def_unit_qt3_target_pre_handle_moc_hdr
|
---|
616 | local type := MOC
|
---|
617 |
|
---|
618 | # fetch the properties.
|
---|
619 | local tool := $(kb-src-tool dummy_var)
|
---|
620 | local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
|
---|
621 | local out := $(outbase).tmp.cpp
|
---|
622 | local realout := $(outbase).cpp
|
---|
623 | local dep := $(realout).dep
|
---|
624 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
625 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
626 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
627 |
|
---|
628 | # default path + source dep.
|
---|
629 | ifneq ($(defpath),)
|
---|
630 | local source := $(abspathex $(source),$(defpath))
|
---|
631 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
632 | else
|
---|
633 | local deps += $(source)
|
---|
634 | endif
|
---|
635 |
|
---|
636 | # call the tool
|
---|
637 | ifndef TOOL_$(tool)_MOC_HPP_CMDS
|
---|
638 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_HPP_CMDS)
|
---|
639 | endif
|
---|
640 | local cmds := $(TOOL_$(tool)_MOC_HPP_CMDS)
|
---|
641 | local more_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT)
|
---|
642 | local maybe_output := $(TOOL_$(tool)_MOC_HPP_OUTPUT_MAYBE)
|
---|
643 | local deps += $(TOOL_$(tool)_MOC_HPP_DEPEND)
|
---|
644 | local orderdeps += $(TOOL_$(tool)_MOC_HPP_DEPORD)
|
---|
645 |
|
---|
646 | # generate the link rule and update some source and target variables.
|
---|
647 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
648 | $(eval includedep $(dep))
|
---|
649 | endif
|
---|
650 | $(eval $(def_unit_qt3_target_pre_handle_moc_hdr_dx))
|
---|
651 |
|
---|
652 | endef # def_unit_qt3_target_pre_handle_moc_hdr
|
---|
653 |
|
---|
654 |
|
---|
655 |
|
---|
656 | ## wrapper for the MOC command dependencies.
|
---|
657 | ifndef 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)
|
---|
659 | else
|
---|
660 | _UNIT_QT3_MOC_CPP_CMDS_DEP =
|
---|
661 | endif
|
---|
662 |
|
---|
663 | ##
|
---|
664 | # def_unit_qt3_target_pre_handle_moc_src helper that is expanded before evaluation.
|
---|
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 | #
|
---|
670 | define def_unit_qt3_target_pre_handle_moc_src_dx
|
---|
671 |
|
---|
672 | $(out) +| $(realout) $(more_output) $(maybe_output): \
|
---|
673 | $(deps) \
|
---|
674 | $(value _UNIT_QT3_MOC_CPP_CMDS_DEP) \
|
---|
675 | | \
|
---|
676 | $(orderdeps)
|
---|
677 | %$$(call MSG_TOOL,moc,$(target),$(source),$(realout))
|
---|
678 | $(QUIET2)$(RM) -f $(out) $(more_output) $(maybe_output) $(dep)
|
---|
679 |
|
---|
680 | $(cmds)
|
---|
681 |
|
---|
682 | $(QUIET)$(CP) --changed -f $(out) $(realout)
|
---|
683 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
684 | %$$(QUIET2)$$(APPEND) '$(dep)'
|
---|
685 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT3_MOC_CPP_CMDS_PREV_'
|
---|
686 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
|
---|
687 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
688 | endif
|
---|
689 |
|
---|
690 | $(target)_INTERMEDIATES += $(realout)
|
---|
691 | $(target)_CLEAN += $(out) $(realout) $(more_output) $(maybe_output) $(dep)
|
---|
692 |
|
---|
693 | endef
|
---|
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 ).
|
---|
702 | define def_unit_qt3_target_pre_handle_moc_src
|
---|
703 | local type := MOC
|
---|
704 |
|
---|
705 | # fetch the properties.
|
---|
706 | local tool := $(kb-src-tool dummy_var)
|
---|
707 | local outbase := $(qtmocdir)/$(notdir $(basename $(source)))
|
---|
708 | local out := $(outbase).tmp.moc
|
---|
709 | local realout := $(outbase).moc
|
---|
710 | local dep := $(realout).dep
|
---|
711 | local flags := $(kb-src-prop FLAGS,dummy_var,right-to-left)
|
---|
712 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right)
|
---|
713 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
|
---|
714 |
|
---|
715 | # default path + source dep.
|
---|
716 | ifneq ($(defpath),)
|
---|
717 | local source := $(abspathex $(source),$(defpath))
|
---|
718 | local deps := $(abspathex $(deps),$(defpath)) $(source)
|
---|
719 | local incs := $(abspathex $(incs),$(defpath))
|
---|
720 | else
|
---|
721 | local deps += $(source)
|
---|
722 | endif
|
---|
723 |
|
---|
724 | # call the tool
|
---|
725 | ifndef TOOL_$(tool)_MOC_CPP_CMDS
|
---|
726 | $(error kBuild: qt moc tool not found: TOOL_$(tool)_MOC_CPP_CMDS)
|
---|
727 | endif
|
---|
728 | local cmds := $(TOOL_$(tool)_MOC_CPP_CMDS)
|
---|
729 | local more_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT)
|
---|
730 | local maybe_output := $(TOOL_$(tool)_MOC_CPP_OUTPUT_MAYBE)
|
---|
731 | local deps += $(TOOL_$(tool)_MOC_CPP_DEPEND)
|
---|
732 | local orderdeps += $(TOOL_$(tool)_MOC_CPP_DEPORD)
|
---|
733 |
|
---|
734 | # generate the link rule and update some source and target variables.
|
---|
735 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
736 | $(eval includedep $(dep))
|
---|
737 | endif
|
---|
738 | $(eval $(def_unit_qt3_target_pre_handle_moc_src_dx))
|
---|
739 |
|
---|
740 | endef # def_unit_qt3_target_pre_handle_moc_src
|
---|
741 |
|
---|
742 |
|
---|
743 | ##
|
---|
744 | # Adds sources containing Q_OBJECT to QT_MOCSRCS.
|
---|
745 | define def_unit_qt3_target_pre_cpp_source
|
---|
746 | ifneq ($(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
|
---|
750 | endif
|
---|
751 | endef # def_unit_qt3_target_pre_cpp_source
|
---|
752 |
|
---|
753 |
|
---|
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 | #
|
---|
763 | define def_unit_qt3_target_pre
|
---|
764 |
|
---|
765 | # Make QTTOOL the default for the specific Qt tools instead of TOOL.
|
---|
766 | ifneq ($($(target)_QTTOOL),)
|
---|
767 | ifeq ($($(target)_MOCTOOL),)
|
---|
768 | $(target)_MOCTOOL := $($(target)_QTTOOL)
|
---|
769 | endif
|
---|
770 | ifeq ($($(target)_UICTOOL),)
|
---|
771 | $(target)_UICTOOL := $($(target)_QTTOOL)
|
---|
772 | endif
|
---|
773 | ifeq ($($(target)_LRCTOOL),)
|
---|
774 | $(target)_LRCTOOL := $($(target)_QTTOOL)
|
---|
775 | endif
|
---|
776 | endif
|
---|
777 |
|
---|
778 | # Deal with QT_MODULES and QT_PREFIX.
|
---|
779 | local qt_prefix := $(firstword \
|
---|
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)) \
|
---|
785 | $($(target)_QT_PREFIX))
|
---|
786 | ifeq ($(bld_trg),win)
|
---|
787 | local qt_lib := $(firstword $(wildcard \
|
---|
788 | $(PATH_SDK_QT3_LIB)/dynamic/$(qt_prefix)qt-mt3*$(SUFF_LIB) \
|
---|
789 | $(PATH_SDK_QT3_LIB)/$(qt_prefix)qt-mt3*$(SUFF_LIB) \
|
---|
790 | $(PATH_SDK_QT3_LIB)/dynamic/$(qt_prefix)qt-mt$(SUFF_LIB) \
|
---|
791 | $(PATH_SDK_QT3_LIB)/$(qt_prefix)qt-mt$(SUFF_LIB) \
|
---|
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) \
|
---|
796 | ) $(PATH_SDK_QT3_LIB)/$(qt_prefix)qt-mt$(SUFF_LIB) )
|
---|
797 | $(eval $(target)_LIBS += $(qt_lib) )
|
---|
798 | ifeq ($(tool_do),LINK_PROGRAM)
|
---|
799 | local qt_main_lib := $(firstword $(wildcard \
|
---|
800 | $(PATH_SDK_QT3_LIB)/$(qt_prefix)qtmain$(SUFF_LIB) \
|
---|
801 | $(PATH_SDK_QT3_LIB)/qtmain$(SUFF_LIB) \
|
---|
802 | ) $(PATH_SDK_QT3_LIB)/$(qt_prefix)qtmain$(SUFF_LIB) )
|
---|
803 | $(eval $(target)_LIBS += $(qt_main_lib) )
|
---|
804 | endif
|
---|
805 | else ifeq ($(bld_trg),os2)
|
---|
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) )
|
---|
821 | else
|
---|
822 | local qt_lib := $(PATH_SDK_QT3_LIB)/lib$(qt_prefix)qt-mt$(SUFF_DLL)
|
---|
823 | $(eval $(target)_LIBS += $(qt_lib) )
|
---|
824 | endif
|
---|
825 | $(eval $(target)_INCS += $(PATH_SDK_QT3_INC) )
|
---|
826 |
|
---|
827 | # On Qt3 we will try pickup the QMAKE_PRL_DEFINES listed in the .prl file (in libs).
|
---|
828 | local 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 | ))
|
---|
834 | ifneq ($(qt_prl),)
|
---|
835 | include $(qt_prl)
|
---|
836 | $(eval $(target)_DEFS += $(QMAKE_PRL_DEFINES))
|
---|
837 | endif
|
---|
838 |
|
---|
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.
|
---|
841 | ifndef $(target)_QT_MOCSRCS
|
---|
842 | $(foreach source, $(filter %.cxx %.CXX %.cpp %.CPP %.cc %.CC,\
|
---|
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)) \
|
---|
848 | $($(target)_SOURCES) \
|
---|
849 | ), $(evalval def_unit_qt3_target_pre_cpp_source))
|
---|
850 | endif
|
---|
851 |
|
---|
852 | # Install source handlers for .ui files.
|
---|
853 | $(target)_SRC_HANDLERS += \
|
---|
854 | .ui:def_unit_qt3_src_handler_ui \
|
---|
855 | .UI:def_unit_qt3_src_handler_ui
|
---|
856 |
|
---|
857 | # Calc the MOC and UI output directories and add them to BLDDIRS and INCS.
|
---|
858 | local qtmocdir := $($(target)_0_OUTDIR)/qtmoc
|
---|
859 | local qtuicdir := $($(target)_0_OUTDIR)/qtuic
|
---|
860 | local qtnlsdir := $($(target)_0_OUTDIR)/qtnls
|
---|
861 | $(eval $(target)_BLDDIRS += $(qtmocdir) $(qtuicdir) $(qtnlsdir) )
|
---|
862 | $(eval $(target)_INCS += $(qtmocdir) $(qtuicdir) )
|
---|
863 |
|
---|
864 | # Calc .ui sources so we can add them to the QT_MOCSRCS and QT_MOCHDRS.
|
---|
865 | local ui_sources := $(notdir $(basename $(filter %.ui %.UI, \
|
---|
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)) \
|
---|
871 | $($(target)_SOURCES) \
|
---|
872 | )))
|
---|
873 | #$(error ui_sources:=$(ui_sources))
|
---|
874 |
|
---|
875 | # Deal with QT_MOCSRCS.
|
---|
876 | $(foreach source, \
|
---|
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)) \
|
---|
882 | $($(target)_QT_MOCSRCS) \
|
---|
883 | $(addsuffix .h,$(addprefix $(qtuicdir)/,$(notdir $(basename $(ui_sources))))) \
|
---|
884 | , $(evalvalctx def_unit_qt3_target_pre_handle_moc_src))
|
---|
885 |
|
---|
886 | # Deal with QT_MOCHDRS.
|
---|
887 | $(foreach source, \
|
---|
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)) \
|
---|
893 | $($(target)_QT_MOCHDRS) \
|
---|
894 | $(addsuffix .h,$(addprefix $(qtuicdir)/,$(notdir $(basename $(ui_sources))))) \
|
---|
895 | , $(evalvalctx def_unit_qt3_target_pre_handle_moc_hdr))
|
---|
896 |
|
---|
897 | # Deal with QT_TRANSLATIONS.
|
---|
898 | # ASSUMES (_ALL_)INSTALLS is processed after the targets using this unit.
|
---|
899 | local translations := \
|
---|
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)) \
|
---|
905 | $($(target)_QT_TRANSLATIONS)
|
---|
906 | ifneq ($(strip $(translations)),)
|
---|
907 | local expr := _ALL_INSTALLS_IMPLICIT += $(target)-inst-nls
|
---|
908 | $(eval $(expr))
|
---|
909 | ifdef $(target)_QT_TRANSLATIONS_TEMPLATE
|
---|
910 | $(target)-inst-nls_TEMPLATE := $($(target)_QT_TRANSLATIONS_TEMPLATE)
|
---|
911 | else
|
---|
912 | $(target)-inst-nls_MODE := 0644
|
---|
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)\
|
---|
919 | , $(evalvalctx def_unit_qt3_target_pre_handle_translation))
|
---|
920 | endif
|
---|
921 |
|
---|
922 | endef # def_unit_qt3_target_pre
|
---|
923 |
|
---|
924 |
|
---|
925 | #
|
---|
926 | # Rule for debugging.
|
---|
927 | #
|
---|
928 | unit-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 |
|
---|