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