1 | # $Id: Makefile.kmk 7223 2008-02-29 17:01:17Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the VirtualBox Qt GUI.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 innotek GmbH
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | # include qmake project file
|
---|
19 | include VBoxUI.pro
|
---|
20 |
|
---|
21 | # Import QDesigner UI sources
|
---|
22 | VirtualBox_QT_UISRCS := $(FORMS)
|
---|
23 | # Import translation sources
|
---|
24 | VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
|
---|
25 | # Import images
|
---|
26 | VirtualBox_QT_IMAGES := $(IMAGES)
|
---|
27 |
|
---|
28 | # reset things to avoid possible conflicts with kBuild
|
---|
29 | TEMPLATE :=
|
---|
30 | LANGUAGE :=
|
---|
31 | FORMS :=
|
---|
32 | TRANSLATIONS :=
|
---|
33 | IMAGES :=
|
---|
34 |
|
---|
35 | VBOX_WITH_REGISTRATION := 1
|
---|
36 | VBOX_WITH_REGISTRATION_REQUEST := 1
|
---|
37 |
|
---|
38 | DEPTH = ../../../..
|
---|
39 | include $(PATH_KBUILD)/header.kmk
|
---|
40 |
|
---|
41 | # Disable the debugger for now, this is another story.
|
---|
42 | VBOX_WITH_DEBUGGER_GUI :=
|
---|
43 | DEFS := $(filter-out VBOX_WITH_DEBUGGER_GUI,$(DEFS))
|
---|
44 |
|
---|
45 | # Handmade configuration of qt4
|
---|
46 | VBOX_PATH_QT4 ?= /usr
|
---|
47 | VBOX_MODULE_QT4 = QtCore QtGui QtNetwork Qt3Support
|
---|
48 | VBOX_DEFS_QT4 = QT_CORE_LIB QT_GUI_LIB QT_NETWORK_LIB QT_QT3SUPPORT_LIB
|
---|
49 | VBOX_INCS_QT4 = $(VBOX_PATH_QT4)/share/qt4/mkspecs/linux-g++ \
|
---|
50 | $(foreach mod, $(VBOX_MODULE_QT4), $(join $(VBOX_PATH_QT4)/include/qt4/, $(mod))) \
|
---|
51 | $(VBOX_PATH_QT4)/include/qt4/Qt $(VBOX_PATH_QT4)/include/qt4
|
---|
52 | VBOX_LIBS_QT4 = $(VBOX_MODULE_QT4)
|
---|
53 | VBOX_LIBPATH_QT4 = $(VBOX_MODULE_QT4)/lib
|
---|
54 |
|
---|
55 | # Warn about all what you know about porting qt3->qt4.
|
---|
56 | # Disable this if you like to see something on your screen.
|
---|
57 | VBOX_DEFS_QT4 += QT3_SUPPORT_WARNINGS
|
---|
58 | # Some default defs
|
---|
59 | VBOX_DEFS_QT4 += QT3_SUPPORT QT_SHARED HAVE_CONFIG_H QT_NO_DEBUG
|
---|
60 |
|
---|
61 | VBOX_UIC4 := $(VBOX_PATH_QT4)/bin/uic3
|
---|
62 | VBOX_MOC4 := $(VBOX_PATH_QT4)/bin/moc-qt4
|
---|
63 | VBOX_LUPDATE4 := $(VBOX_PATH_QT4)/bin/lupdate-qt4
|
---|
64 | VBOX_LRELEASE4 := $(VBOX_PATH_QT4)/bin/lrelease-qt4
|
---|
65 |
|
---|
66 | # Template copy from the qt3 stuff. Appended a "4" on the
|
---|
67 | # relevant places.
|
---|
68 |
|
---|
69 | #
|
---|
70 | # Template for building Qt GUI executables.
|
---|
71 | #
|
---|
72 |
|
---|
73 | TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
|
---|
74 | TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS) $(VBOX_DEFS_QT4)
|
---|
75 | TEMPLATE_VBOXQT4GUIEXE_INCS = \
|
---|
76 | $(VBOX_PATH_SDK)/include \
|
---|
77 | $(VBOX_INCS_QT4)
|
---|
78 |
|
---|
79 | ifeq ($(BUILD_TARGET),win)
|
---|
80 | # drag in library configuration (we need QMAKE_PRL_DEFINES)
|
---|
81 | ifneq ($(LIB_QT_PRL),)
|
---|
82 | include $(LIB_QT_PRL)
|
---|
83 | endif
|
---|
84 | TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
85 | TEMPLATE_VBOXQT4GUIEXE_DEFS += \
|
---|
86 | _WIN32_WINNT=0x0500 UNICODE _UNICODE \
|
---|
87 | QT_DLL _CRT_SECURE_NO_DEPRECATE \
|
---|
88 | $(QMAKE_PRL_DEFINES)
|
---|
89 | ## @todo VCC70 flags?
|
---|
90 | ifdef VBOX_USE_VCC80
|
---|
91 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
|
---|
92 | -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
|
---|
93 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
|
---|
94 | else
|
---|
95 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
|
---|
96 | -nologo -Zm200 -W3 -MD -Zi -GX
|
---|
97 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
|
---|
98 | endif
|
---|
99 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
100 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
|
---|
101 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
|
---|
102 | /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
|
---|
103 | /DELAYLOAD:oleaut32.dll
|
---|
104 | TEMPLATE_VBOXQT4GUIEXE_SDKS = WINPSDK
|
---|
105 | TEMPLATE_VBOXQT4GUIEXE_LIBS = \
|
---|
106 | $(LIB_QT) \
|
---|
107 | $(LIB_QTMAIN) \
|
---|
108 | $(LIB_RUNTIME) \
|
---|
109 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
110 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
111 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
|
---|
112 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
|
---|
113 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
|
---|
114 | TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
115 |
|
---|
116 | else # the gcc guys:
|
---|
117 | TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
118 | TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
|
---|
119 |
|
---|
120 | TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
|
---|
121 |
|
---|
122 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
123 | $(LIB_SDL_INC)
|
---|
124 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
|
---|
125 | -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
|
---|
126 | -Wno-long-long -fshort-wchar -fno-strict-aliasing \
|
---|
127 | $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
128 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
|
---|
129 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
|
---|
130 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
|
---|
131 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
|
---|
132 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
|
---|
133 | TEMPLATE_VBOXQT4GUIEXE_LIBS = \
|
---|
134 | $(VBOX_LIBS_QT4) \
|
---|
135 | $(LIB_SDL) \
|
---|
136 | $(LIB_RUNTIME) \
|
---|
137 | $(LIB_REM) \
|
---|
138 | $(LIB_VMM)
|
---|
139 |
|
---|
140 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
141 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
|
---|
142 | $(VBOX_PATH_QT4)/lib64/qt4 $(VBOX_PATH_QT4)/lib/qt4
|
---|
143 | else
|
---|
144 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
|
---|
145 | $(VBOX_PATH_QT4)/lib/qt4
|
---|
146 | endif
|
---|
147 |
|
---|
148 | ifeq ($(BUILD_TARGET),linux)
|
---|
149 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
|
---|
150 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
151 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
|
---|
152 | TEMPLATE_VBOXQT4GUIEXE_LIBS +=
|
---|
153 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
|
---|
154 | else ifeq ($(BUILD_TARGET),os2)
|
---|
155 | # drag in library configuration (we need QMAKE_PRL_DEFINES)
|
---|
156 | ifneq ($(LIB_QT_PRL),)
|
---|
157 | include $(LIB_QT_PRL)
|
---|
158 | endif
|
---|
159 | TEMPLATE_VBOXQT4GUIEXE_DEFS += $(QMAKE_PRL_DEFINES)
|
---|
160 | TEMPLATE_VBOXQT4GUIEXE_LIBS +=
|
---|
161 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
|
---|
162 | else
|
---|
163 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
164 | $(VBOX_XCURSOR_INCS)
|
---|
165 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
166 | $(VBOX_XCURSOR_LIBS) \
|
---|
167 | Xext \
|
---|
168 | X11 \
|
---|
169 | m \
|
---|
170 | $(LIB_PTHREAD)
|
---|
171 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
|
---|
172 | $(VBOX_LIBPATH_X11)
|
---|
173 | ifeq ($(BUILD_TARGET),freebsd)
|
---|
174 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
175 | /usr/include \
|
---|
176 | /usr/X11R6/include \
|
---|
177 | /usr/local/include
|
---|
178 | endif
|
---|
179 | ifeq ($(BUILD_TARGET),solaris)
|
---|
180 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '-R$$(VBOX_ORIGIN):$$(VBOX_ORIGIN)/qtgcc/lib'
|
---|
181 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
182 | rt socket nsl
|
---|
183 | endif
|
---|
184 | endif
|
---|
185 |
|
---|
186 | endif
|
---|
187 |
|
---|
188 | # Add COM/XPCOM stuff
|
---|
189 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
190 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
191 | ifdef VBOX_WITH_XPCOM
|
---|
192 | ## @todo may be worth creating the VBOX_XPCOM SDK def
|
---|
193 | TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
|
---|
194 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
195 | $(VBOX_XPCOM_INCS)
|
---|
196 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
197 | $(LIB_XPCOM)
|
---|
198 | endif
|
---|
199 |
|
---|
200 | #
|
---|
201 | # Template for building Qt GUI components.
|
---|
202 | #
|
---|
203 | TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
|
---|
204 | TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQTGUIEXE
|
---|
205 | TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
|
---|
206 | ifeq ($(BUILD_TARGET),darwin)
|
---|
207 | TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS))
|
---|
208 | endif
|
---|
209 | ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
210 | ifneq ($(BUILD_TARGET),win)
|
---|
211 | TEMPLATE_VBOXQT4GUI_DEFS = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
|
---|
212 | TEMPLATE_VBOXQT4GUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
|
---|
213 | TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
|
---|
214 | TEMPLATE_VBOXQT4GUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
|
---|
215 | endif
|
---|
216 | endif
|
---|
217 |
|
---|
218 |
|
---|
219 | #
|
---|
220 | # exclude inappropriate UI content
|
---|
221 | #
|
---|
222 | ifndef VBOX_WITH_REGISTRATION
|
---|
223 | VirtualBox_QT_UISRCS := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS))
|
---|
224 | endif
|
---|
225 |
|
---|
226 |
|
---|
227 | #
|
---|
228 | # The targets.
|
---|
229 | #
|
---|
230 | PROGRAMS = VirtualBox
|
---|
231 | ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
232 | DLLS = VBoxKeyboard
|
---|
233 | OTHERS = $(PATH_BIN)/vboxkeyboard.tar.gz
|
---|
234 | endif
|
---|
235 | INSTALLS = VirtualBox.nls
|
---|
236 |
|
---|
237 | ifeq ($(BUILD_TARGET),os2)
|
---|
238 | DLLS += VBoxHlp
|
---|
239 | ifneq ($(strip $(VBOX_DLL_QT)),)
|
---|
240 | INSTALLS += qt.dll
|
---|
241 | qt.dll_INST = $(INST_BIN)
|
---|
242 | qt.dll_SOURCES += \
|
---|
243 | $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
|
---|
244 | endif
|
---|
245 | endif
|
---|
246 |
|
---|
247 |
|
---|
248 | #
|
---|
249 | # VBoxHlp - helper DLL for OS/2.
|
---|
250 | #
|
---|
251 | VBoxHlp_ASTOOL = NASM
|
---|
252 | VBoxHlp_ASFLAGS = -f obj
|
---|
253 | VBoxHlp_DEFS = IN_RING3 IN_VBOXHLP
|
---|
254 | VBoxHlp_CXXFLAGS = -fno-exceptions
|
---|
255 | VBoxHlp_LDFLAGS = -nostdlib -los2
|
---|
256 | VBoxHlp_LDFLAGS += -Zlinker option -Zlinker manyautodata
|
---|
257 | VBoxHlp_SOURCES = \
|
---|
258 | src/os2/VBoxHlp.asm \
|
---|
259 | src/os2/VBoxHlp.cpp
|
---|
260 |
|
---|
261 |
|
---|
262 | #
|
---|
263 | # VBoxKeyboard - keyboard library for X11.
|
---|
264 | #
|
---|
265 | VBoxKeyboard_TEMPLATE = VBOXR3
|
---|
266 | VBoxKeyboard_SOURCES = \
|
---|
267 | src/linux/keyboard-new.c
|
---|
268 | VBoxKeyboard_TARSOURCES = \
|
---|
269 | $(VBoxKeyboard_SOURCES) \
|
---|
270 | src/linux/COPYING.LIB \
|
---|
271 | src/linux/keyboard.h \
|
---|
272 | src/linux/keyboard-layouts.h \
|
---|
273 | src/linux/keyboard-list.h \
|
---|
274 | src/linux/keyboard-tables.h \
|
---|
275 | src/linux/Makefile
|
---|
276 | VBoxKeyboard_LIBS = X11
|
---|
277 | VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
|
---|
278 |
|
---|
279 |
|
---|
280 | #
|
---|
281 | # vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
|
---|
282 | # redistributed with usable sources.
|
---|
283 | #
|
---|
284 | SOURCE_DIRECTORY = vboxkeyboard
|
---|
285 | DIRECTORY_PREFIX = src/linux/
|
---|
286 |
|
---|
287 | $(PATH_TARGET)/$(SOURCE_DIRECTORY):
|
---|
288 | $(MKDIR) -p $(@D)
|
---|
289 | $(LN_SYMLINK) $(abspath $(PATH_CURRENT))/$(DIRECTORY_PREFIX) $@
|
---|
290 |
|
---|
291 | $(PATH_BIN)/vboxkeyboard.tar.gz: $(VBoxKeyboard_TARSOURCES) $(PATH_TARGET)/$(SOURCE_DIRECTORY)
|
---|
292 | $(call MSG_TOOL,tar/gzip,,$@)
|
---|
293 | $(QUIET)cd $(PATH_TARGET) && tar -chf - $(addprefix $(SOURCE_DIRECTORY)/,$(subst $(DIRECTORY_PREFIX),,$(VBoxKeyboard_TARSOURCES))) | gzip - > $@
|
---|
294 |
|
---|
295 |
|
---|
296 | #
|
---|
297 | # VirtualBox - The GUI program.
|
---|
298 | #
|
---|
299 | VirtualBox_TEMPLATE = VBOXQT4GUIEXE
|
---|
300 | VirtualBox_SDKS.win = WINPSDK DXSDK
|
---|
301 | #ifeq ($(filter-out freebsd linux netbsd openbsd os2 solaris,$(BUILD_TARGET)),) - later
|
---|
302 | ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(BUILD_TARGET)),) # X11 + os2
|
---|
303 | VirtualBox_SDKS += LIBSDL
|
---|
304 | endif
|
---|
305 |
|
---|
306 | ifeq ($(BUILD_TARGET),darwin)
|
---|
307 | # For the launch trick we need different inode numbers.
|
---|
308 | VirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
|
---|
309 |
|
---|
310 | # For testing iChat Theater stuff change
|
---|
311 | # the sdk path
|
---|
312 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
313 | VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
|
---|
314 | endif
|
---|
315 |
|
---|
316 | endif
|
---|
317 |
|
---|
318 | ifndef VBOX_OSE
|
---|
319 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # linux only, yea, right.
|
---|
320 | # Note: I'm doing this right here because the GUI will _not_ run
|
---|
321 | # without that file which might be annoying for developers!
|
---|
322 | $(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
|
---|
323 | $(call MSG_GENERATE,,$@)
|
---|
324 | $(QUIET)$(CP) $< $@
|
---|
325 |
|
---|
326 | $(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
|
---|
327 | endif
|
---|
328 | endif
|
---|
329 |
|
---|
330 | # Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
|
---|
331 | VirtualBox_QT_TRANSLATIONS_QT := \
|
---|
332 | $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\
|
---|
333 | $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
|
---|
334 |
|
---|
335 | # QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
|
---|
336 |
|
---|
337 | # Headers containing definitions of classes that use the Q_OBJECT macro
|
---|
338 | VirtualBox_QT_MOCHDRS = \
|
---|
339 | include/QIWidgetValidator.h \
|
---|
340 | include/QIHotKeyEdit.h \
|
---|
341 | include/QIStatusBar.h \
|
---|
342 | include/QIStateIndicator.h \
|
---|
343 | include/QIMessageBox.h \
|
---|
344 | include/QIRichLabel.h \
|
---|
345 | include/VBoxGlobalSettings.h \
|
---|
346 | include/VBoxUtils.h \
|
---|
347 | include/VBoxGlobal.h \
|
---|
348 | include/VBoxVMListBox.h \
|
---|
349 | include/VBoxMediaComboBox.h \
|
---|
350 | include/VBoxSelectorWnd.h \
|
---|
351 | include/VBoxConsoleWnd.h \
|
---|
352 | include/VBoxConsoleView.h \
|
---|
353 | include/VBoxProblemReporter.h \
|
---|
354 | include/VBoxDownloaderWgt.h \
|
---|
355 | include/VBoxNetworkFramework.h
|
---|
356 |
|
---|
357 | # Sources containing local definitions of classes that use the Q_OBJECT macro
|
---|
358 | VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
|
---|
359 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
360 | VirtualBox_QT_MOCSRCS += src/VBoxGlobal.cpp
|
---|
361 | endif
|
---|
362 | ifdef VBOX_WITH_XPCOM
|
---|
363 | VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
|
---|
364 | endif
|
---|
365 |
|
---|
366 | # UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
|
---|
367 | VirtualBox_QT_MOCUIHDRS = \
|
---|
368 | ui/VBoxVMSettingsDlg.ui.h \
|
---|
369 | ui/VBoxVMLogViewer.ui.h \
|
---|
370 | ui/VBoxSharedFoldersSettings.ui.h
|
---|
371 |
|
---|
372 |
|
---|
373 | # All generated sources. Note: this list MUST be in sync with Qt source
|
---|
374 | # generation rules defined somewhere below!
|
---|
375 | VirtualBox_GENSRCS = \
|
---|
376 | $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
|
---|
377 | $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
|
---|
378 | # $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
|
---|
379 |
|
---|
380 | # All generated headers. Note: this list MUST be in sync with Qt source
|
---|
381 | # generation rules defined somewhere below!
|
---|
382 | VirtualBox_GENHDRS = \
|
---|
383 | $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
|
---|
384 | $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
|
---|
385 | $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).h)
|
---|
386 |
|
---|
387 | # All existing .ui.h files for known .ui sources
|
---|
388 | VirtualBox_QT_UIHDRS = \
|
---|
389 | $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS)))
|
---|
390 |
|
---|
391 | # All header files
|
---|
392 | VirtualBox_HEADERS = \
|
---|
393 | $(wildcard include/*.h) \
|
---|
394 | $(VirtualBox_GENHDRS) \
|
---|
395 | $(VirtualBox_QT_UIHDRS)
|
---|
396 |
|
---|
397 |
|
---|
398 | VirtualBox_SOURCES = \
|
---|
399 | $(VirtualBox_GENSRCS) \
|
---|
400 | src/main.cpp \
|
---|
401 | src/COMDefs.cpp \
|
---|
402 | src/QIWidgetValidator.cpp \
|
---|
403 | src/QIHotKeyEdit.cpp \
|
---|
404 | src/QIStateIndicator.cpp \
|
---|
405 | src/QIStatusBar.cpp \
|
---|
406 | src/QIMessageBox.cpp \
|
---|
407 | src/QIRichLabel.cpp \
|
---|
408 | src/VBoxDefs.cpp \
|
---|
409 | src/VBoxGlobalSettings.cpp \
|
---|
410 | src/VBoxGlobal.cpp \
|
---|
411 | src/VBoxMediaComboBox.cpp \
|
---|
412 | src/VBoxProblemReporter.cpp \
|
---|
413 | src/VBoxSelectorWnd.cpp \
|
---|
414 | src/VBoxConsoleView.cpp \
|
---|
415 | src/VBoxConsoleWnd.cpp \
|
---|
416 | src/VBoxDownloaderWgt.cpp \
|
---|
417 | src/VBoxVMListBox.cpp \
|
---|
418 | src/VBoxFrameBuffer.cpp \
|
---|
419 | src/HappyHttp.cpp \
|
---|
420 | src/VBoxNetworkFramework.cpp
|
---|
421 |
|
---|
422 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
423 | VirtualBox_SOURCES += \
|
---|
424 | src/linux/XKeyboard-new.cpp
|
---|
425 | endif
|
---|
426 |
|
---|
427 | VirtualBox_SOURCES.win += \
|
---|
428 | src/win32/VirtualBox.rc
|
---|
429 |
|
---|
430 | VirtualBox_SOURCES.win += \
|
---|
431 | src/VBoxFBDDRAW.cpp
|
---|
432 |
|
---|
433 | VirtualBox_SOURCES.darwin = \
|
---|
434 | src/darwin/DarwinKeyboard.cpp \
|
---|
435 | src/darwin/DarwinCursor.cpp \
|
---|
436 | src/darwin/VBoxAquaStyle.cpp \
|
---|
437 | src/darwin/VBoxUtils-darwin.cpp \
|
---|
438 | src/VBoxFBQuartz2D.cpp
|
---|
439 |
|
---|
440 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
441 | VirtualBox_SOURCES.darwin += \
|
---|
442 | src/darwin/VBoxIChatTheaterWrapper.m
|
---|
443 | endif
|
---|
444 |
|
---|
445 | ifneq ($(BUILD_TARGET),win)
|
---|
446 | src/HappyHttp.cpp_CXXFLAGS += -fexceptions
|
---|
447 | src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
|
---|
448 | src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
|
---|
449 | endif
|
---|
450 | src/HappyHttp.cpp_CXXFLAGS.linux += -O2
|
---|
451 |
|
---|
452 | ## @todo how to detect what tool is used?
|
---|
453 | ## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
|
---|
454 | # more generic -Wno-extra
|
---|
455 | ifdef VBOX_WITH_XPCOM
|
---|
456 | src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
|
---|
457 | endif
|
---|
458 |
|
---|
459 | VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
|
---|
460 | VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
|
---|
461 | VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
|
---|
462 | VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
|
---|
463 | VirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
|
---|
464 | VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
|
---|
465 | VirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
|
---|
466 | VirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL
|
---|
467 | VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
|
---|
468 | VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
|
---|
469 | VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
|
---|
470 | #ifndef VBOX_OSE
|
---|
471 | VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
|
---|
472 | #endif
|
---|
473 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
474 | VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
|
---|
475 | endif
|
---|
476 | ifneq ($(BUILD_TYPE),release)
|
---|
477 | # non-release builds has some extra features.
|
---|
478 | VirtualBox_DEFS += VBOX_GUI_USE_REFRESH_TIMER
|
---|
479 | VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
|
---|
480 | VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
|
---|
481 | endif
|
---|
482 | ifdef VBOX_WITH_REGISTRATION
|
---|
483 | VirtualBox_DEFS += VBOX_WITH_REGISTRATION
|
---|
484 | endif
|
---|
485 | ifdef VBOX_WITH_REGISTRATION_REQUEST
|
---|
486 | VirtualBox_DEFS += VBOX_WITH_REGISTRATION_REQUEST
|
---|
487 | endif
|
---|
488 | ifdef VBOX_WITH_ALSA
|
---|
489 | VirtualBox_DEFS += VBOX_WITH_ALSA
|
---|
490 | endif
|
---|
491 | ifdef VBOX_WITH_PULSE
|
---|
492 | VirtualBox_DEFS += VBOX_WITH_PULSE
|
---|
493 | endif
|
---|
494 | ifdef VBOX_OSE
|
---|
495 | VirtualBox_DEFS += VBOX_OSE
|
---|
496 | endif
|
---|
497 | ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
498 | VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
|
---|
499 | endif
|
---|
500 |
|
---|
501 | VirtualBox_INCS = \
|
---|
502 | ./include \
|
---|
503 | $(PATH_VirtualBox)/ui \
|
---|
504 | $(PATH_VirtualBox)/moc \
|
---|
505 | $(PATH_VirtualBox)/include \
|
---|
506 |
|
---|
507 |
|
---|
508 | ifeq ($(BUILD_TYPE),release)
|
---|
509 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
|
---|
510 | else
|
---|
511 | VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
|
---|
512 | ifeq ($(USERNAME),dmik)
|
---|
513 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
|
---|
514 | else
|
---|
515 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
|
---|
516 | endif
|
---|
517 | endif
|
---|
518 | VirtualBox_LDFLAGS.os2 = -Zlinker /PM:PM -Zno-fork
|
---|
519 | VirtualBox_LDFLAGS.darwin = -framework IOKit
|
---|
520 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
521 | VirtualBox_LDFLAGS.darwin += -framework Foundation -framework AppKit -framework InstantMessage -framework QuartzCore
|
---|
522 | endif
|
---|
523 | VirtualBox_LIBS.win = \
|
---|
524 | $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
|
---|
525 | $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
|
---|
526 | $(PATH_SDK_DXSDK_LIB)/dxguid.lib
|
---|
527 | VirtualBox_LIBS.os2 += $(PATH_DLL)/VBoxHlp$(VBOX_SUFF_DLL)
|
---|
528 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
529 | VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
|
---|
530 | endif
|
---|
531 |
|
---|
532 |
|
---|
533 | ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
|
---|
534 | ifeq ($(BUILD_TARGET),win)
|
---|
535 | VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
|
---|
536 | else
|
---|
537 | VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
|
---|
538 | endif
|
---|
539 | endif
|
---|
540 |
|
---|
541 | WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
|
---|
542 | WRAPPERSINCFILE = include/COMDefs.h
|
---|
543 | WRAPPERSTEMPLATE = include/COMWrappers.xsl
|
---|
544 | XIDLFILE = ../../Main/idl/VirtualBox.xidl
|
---|
545 |
|
---|
546 |
|
---|
547 | # generated files we need to clean manually
|
---|
548 | OTHER_CLEAN = \
|
---|
549 | $(VirtualBox_GENSRCS) \
|
---|
550 | $(VirtualBox_GENHDRS) \
|
---|
551 | $(WRAPPERSFILE) \
|
---|
552 | $(PATH_BIN)/vboxkeyboard.tar.gz
|
---|
553 |
|
---|
554 |
|
---|
555 | #
|
---|
556 | # On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
|
---|
557 | #
|
---|
558 | INSTALLS.darwin += VirtualBox.app
|
---|
559 | VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
|
---|
560 | VirtualBox.app_MODE = 644
|
---|
561 | VirtualBox.app_SOURCES = \
|
---|
562 | src/darwin/PkgInfo \
|
---|
563 | $(PATH_TARGET)/Info.plist \
|
---|
564 | images/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
565 |
|
---|
566 | $(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
|
---|
567 | $(call MSG_GENERATE,VirtualBox.app,$<,$@)
|
---|
568 | $(QUIET)$(RM) -f $@
|
---|
569 | $(QUIET)$(SED) \
|
---|
570 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
571 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
572 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
573 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
574 | $< > $@
|
---|
575 |
|
---|
576 | INSTALLS.darwin += VirtualBoxVM.app
|
---|
577 | VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
|
---|
578 | VirtualBoxVM.app_MODE = 644
|
---|
579 | VirtualBoxVM.app_SOURCES = \
|
---|
580 | src/darwin/VM-PkgInfo=>PkgInfo \
|
---|
581 | $(PATH_TARGET)/VM-Info.plist=>Info.plist \
|
---|
582 | images/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
583 | VirtualBoxVM.app_SYMLINKS = \
|
---|
584 | MacOS=>../../../MacOS/
|
---|
585 |
|
---|
586 | $(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
|
---|
587 | $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
|
---|
588 | $(QUIET)$(RM) -f $@
|
---|
589 | $(QUIET)$(SED) \
|
---|
590 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
591 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
592 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
593 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
594 | --output $@ $<
|
---|
595 |
|
---|
596 | #
|
---|
597 | # Translation installation
|
---|
598 | #
|
---|
599 | VirtualBox.nls_INST = $(INST_BIN)nls/
|
---|
600 | VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS)))
|
---|
601 | VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT)))
|
---|
602 | VirtualBox.nls_MODE = 644
|
---|
603 |
|
---|
604 |
|
---|
605 | #
|
---|
606 | # Testcase for the darwin keyboard routines.
|
---|
607 | #
|
---|
608 | ifdef VBOX_WITH_TESTCASES
|
---|
609 | PROGRAMS.darwin += tstDarwinKeyboard
|
---|
610 | tstDarwinKeyboard_TEMPLATE = VBOXR3TSTEXE
|
---|
611 | tstDarwinKeyboard_INCS = include
|
---|
612 | tstDarwinKeyboard_SOURCES = \
|
---|
613 | src/darwin/tstDarwinKeyboard.cpp \
|
---|
614 | src/darwin/DarwinKeyboard.cpp
|
---|
615 | tstDarwinKeyboard_LDFLAGS = -framework IOKit -framework Carbon
|
---|
616 | tstDarwinKeyboard_LIBS = \
|
---|
617 | $(LIB_RUNTIME)
|
---|
618 | endif
|
---|
619 |
|
---|
620 |
|
---|
621 |
|
---|
622 | # Commit the magic.
|
---|
623 | # (note: before custom rules that make usage of generated variables!).
|
---|
624 | include $(PATH_KBUILD)/footer.kmk
|
---|
625 |
|
---|
626 |
|
---|
627 |
|
---|
628 | #
|
---|
629 | # Qt source file generation rules
|
---|
630 | #
|
---|
631 |
|
---|
632 | ## @todo move QT source generation macros to kBuild
|
---|
633 |
|
---|
634 | ## Generate a rule to create a MOC source file from a header containing
|
---|
635 | # classes that use the Q_OBJECT macro.
|
---|
636 | # @param $mochdr header file with Q_OBJECT
|
---|
637 | define def_qt_gen_src_moc
|
---|
638 |
|
---|
639 | $(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
|
---|
640 |
|
---|
641 | $(target)_GENSRCS_REAL += $(mocsrc)
|
---|
642 |
|
---|
643 | $(mocsrc): $(mochdr)
|
---|
644 | $$(call MSG_TOOL,moc,$(target),$(mochdr),$$@)
|
---|
645 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
646 | $$(QUIET)$$(VBOX_MOC4) $($(target)_DEFS) $(mochdr) -o $$@
|
---|
647 |
|
---|
648 | endef
|
---|
649 |
|
---|
650 | ## Generate a rule to create a MOC include file from a source containing
|
---|
651 | # local classes that use the Q_OBJECT macro. This include is then included
|
---|
652 | # by that source, so it must be generated before the source gets compiled.
|
---|
653 | # @param $mocsrc source file with Q_OBJECT
|
---|
654 | define def_qt_gen_inc_moc
|
---|
655 |
|
---|
656 | $(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
|
---|
657 | $(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
|
---|
658 |
|
---|
659 | $(target)_GENHDRS_REAL += $(mocinc)
|
---|
660 |
|
---|
661 | $(mocobj): $(mocinc)
|
---|
662 |
|
---|
663 | .NOTPARALLEL: $(mocinc)
|
---|
664 | $(mocinc): $(mocsrc)
|
---|
665 | $$(call MSG_TOOL,moc,$(target),$(mocsrc),$$@)
|
---|
666 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
667 | $$(QUIET)$$(VBOX_MOC4) $($(target)_DEFS) -i $(mocsrc) -o $$@
|
---|
668 |
|
---|
669 | endef
|
---|
670 |
|
---|
671 | ## Generate a rule to create a MOC include file from a UI header (ui.h) containing
|
---|
672 | # local classes that use the Q_OBJECT macro. This include is then included
|
---|
673 | # by that header, so it must be generated before the UI source gets compiled.
|
---|
674 | # @param $mocuihdr UI header file with Q_OBJECT
|
---|
675 | define def_qt_gen_inc_mocuihdr
|
---|
676 |
|
---|
677 | $(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
|
---|
678 | $(eval uiobj := $(PATH_$(target)_$$(uisrc))/$(notdir $(basename $$(uisrc)))$(VBOX_SUFF_OBJ))
|
---|
679 | $(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
|
---|
680 |
|
---|
681 | $(target)_GENHDRS_REAL += $(mocuiinc)
|
---|
682 |
|
---|
683 | .NOTPARALLEL: $(mocuiinc)
|
---|
684 | $(uisrc): $(mocuiinc)
|
---|
685 | $(mocuiinc): $(mocuihdr)
|
---|
686 | $$(call MSG_TOOL,moc,$(target),$(mocuihdr),$$@)
|
---|
687 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
688 | $$(QUIET)$$(VBOX_MOC4) $($(target)_DEFS) -i $(mocuihdr) -o $$@
|
---|
689 |
|
---|
690 | endef
|
---|
691 |
|
---|
692 | ## Generate a rule to create a header and source files from an UI
|
---|
693 | # definition source (.ui).
|
---|
694 | # @param $uifile UI definintion source file
|
---|
695 | define def_qt_gen_src_ui
|
---|
696 |
|
---|
697 | $(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
|
---|
698 | $(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
|
---|
699 | $(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
|
---|
700 |
|
---|
701 | $(target)_GENSRCS_REAL += $(uisrc) $(mocsrc)
|
---|
702 | $(target)_GENHDRS_REAL += $(uihdr)
|
---|
703 |
|
---|
704 | .NOTPARALLEL: $(uihdr)
|
---|
705 | $(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
|
---|
706 | $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
|
---|
707 | $$(QUIET)$$(VBOX_UIC4) $(uifile) -o $$@
|
---|
708 |
|
---|
709 | $(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $$(call DIRDEP,$(dir $(uisrc)))
|
---|
710 | $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
|
---|
711 | $$(QUIET)$$(VBOX_UIC4) -impl $(uihdr) $(uifile) -o $$@
|
---|
712 |
|
---|
713 | #$$(QUIET)$$(VBOX_UIC4) $(uifile) -i $(uihdr) -o $$@
|
---|
714 |
|
---|
715 | $(mocsrc): $(uihdr) | $$(call DIRDEP,$(dir $(mocsrc)))
|
---|
716 | $$(call MSG_TOOL,moc,$(target),$(uihdr),$$@)
|
---|
717 | $$(QUIET)$$(VBOX_MOC4) $($(target)_DEFS) $(uihdr) -o $$@
|
---|
718 |
|
---|
719 | endef
|
---|
720 |
|
---|
721 | ## Generate a rule to create a .qm file from a NLS translation
|
---|
722 | # source (.ts).
|
---|
723 | # @param $tsfile Translation source file
|
---|
724 | define def_qt_gen_nls
|
---|
725 |
|
---|
726 | $(eval qmfile := $(PATH_$(target))/nls/$(notdir $(basename $(tsfile))).qm)
|
---|
727 |
|
---|
728 | OTHER_CLEAN += $(qmfile)
|
---|
729 |
|
---|
730 | # Note that we use -nocompress in lrelease to avoid stripping comments and
|
---|
731 | # other information from .qm files. If we don't do that, we get .qm files two
|
---|
732 | # times smaller, but QTranslator::findMessage() will start searching for
|
---|
733 | # translations in all existing contexts in case if it cannot find it in the
|
---|
734 | # original context (which is of course not acceptable, no matter if it's a
|
---|
735 | # special Qt "feature" or just a bug).
|
---|
736 |
|
---|
737 | $(qmfile): $(tsfile) | $$(call DIRDEP,$(dir $(qmfile)))
|
---|
738 | $$(call MSG_TOOLS,lrelease,$(target),$(tsfile),$$@)
|
---|
739 | $$(QUIET)$$(VBOX_LRELEASE4) -nocompress $(tsfile) -qm $$@
|
---|
740 |
|
---|
741 | endef
|
---|
742 |
|
---|
743 | ## Generate rules for generating the Qt source for a target.
|
---|
744 | # @param $target Target name.
|
---|
745 | define def_qt_gen_src
|
---|
746 |
|
---|
747 | # moc srcs from hdrs with Q_OBJECT
|
---|
748 | $(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
|
---|
749 | # moc includes from srcs with Q_OBJECT
|
---|
750 | $(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
|
---|
751 | # moc includes from UI headers with Q_OBJECT
|
---|
752 | $(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
|
---|
753 | # UI sources
|
---|
754 | $(foreach uifile,$($(target)_QT_UISRCS),$(eval $(def_qt_gen_src_ui)))
|
---|
755 | # NLS files
|
---|
756 | $(foreach tsfile,$($(target)_QT_TRANSLATIONS),$(eval $(def_qt_gen_nls)))
|
---|
757 | $(foreach tsfile,$($(target)_QT_TRANSLATIONS_QT),$(eval $(def_qt_gen_nls)))
|
---|
758 | # dirs
|
---|
759 | $$(call DIRDEP,$(PATH_$(target))/ui/) \
|
---|
760 | $$(call DIRDEP,$(PATH_$(target))/moc/) \
|
---|
761 | $$(call DIRDEP,$(PATH_$(target))/nls/):
|
---|
762 | $$(call MSG_MKDIR,$$@)
|
---|
763 | $$(QUIET)$$(MKDIR) -p $$@
|
---|
764 |
|
---|
765 | endef
|
---|
766 |
|
---|
767 | # Generate Qt source rules.
|
---|
768 | $(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
|
---|
769 |
|
---|
770 |
|
---|
771 | # Generate COM Wrappers
|
---|
772 | .NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
|
---|
773 |
|
---|
774 | $(WRAPPERSINCFILE): $(WRAPPERSFILE)
|
---|
775 |
|
---|
776 | $(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
|
---|
777 | $(call MSG_TOOL,xsltproc,VirtualBox,$<,$@)
|
---|
778 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
|
---|
779 |
|
---|
780 | $(call DIRDEP,$(PATH_VirtualBox)/include/):
|
---|
781 | $(call MSG_MKDIR,$@)
|
---|
782 | $(QUIET)$(MKDIR) -p $@
|
---|
783 |
|
---|
784 | # this is actually necessary only for Win32 target with disabled dependencies
|
---|
785 | define def_wrapper_deps
|
---|
786 | $(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
|
---|
787 | endef
|
---|
788 |
|
---|
789 | $(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
|
---|
790 |
|
---|
791 | # static images imported from VBoxUI.pro as VirtualBox_QT_IMAGES
|
---|
792 |
|
---|
793 | #$(PATH_VirtualBox)/ui/vbox_image_collection.txt: VBoxUI.pro $(VirtualBox_QT_IMAGES)
|
---|
794 | # $(RM) -f $@
|
---|
795 | # $(APPEND) -v $@ VirtualBox_QT_IMAGES
|
---|
796 | #
|
---|
797 | #$(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $(PATH_VirtualBox)/ui/vbox_image_collection.txt
|
---|
798 | # $(call MSG_TOOL,uic,VirtualBox,$<,$@)
|
---|
799 | # $(QUIET)$(VBOX_UIC4) -o $@ -embed VBoxGUI -f $<
|
---|
800 | #
|
---|
801 | #VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
|
---|
802 | #OTHER_CLEAN += $(PATH_VirtualBox)/ui/vbox_image_collection.txt
|
---|
803 |
|
---|
804 |
|
---|
805 | #
|
---|
806 | # Hand made dependencies go here.
|
---|
807 | # Basically, here are dependencies for generated UI source files that
|
---|
808 | # include generated headers in turn.
|
---|
809 | #
|
---|
810 |
|
---|
811 | $(PATH_VirtualBox)/ui/VBoxDiskImageManagerDlg.cpp: \
|
---|
812 | $(PATH_VirtualBox)/ui/VBoxNewHDWzd.h
|
---|
813 |
|
---|
814 | # Make all generated UI sources dependent on all generated headers (since they
|
---|
815 | # may include them). This is safer than indifidual dependencies above but
|
---|
816 | # currently disabled, because will cause all UI sources to be rebuilt one a
|
---|
817 | # single one changes.
|
---|
818 | #$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS)))) : $(VirtualBox_GENHDRS)
|
---|
819 |
|
---|
820 |
|
---|
821 | #
|
---|
822 | # Custom targets
|
---|
823 | #
|
---|
824 |
|
---|
825 | # Update all known NLS translation (.ts) files in the nls/ subdirectory.
|
---|
826 | # NOTE: This target is intened to be run only by the GUI maintainer shortly
|
---|
827 | # before a new product release. VirtualBox_xx_YY.ts is a template for new
|
---|
828 | # languages and should never be actually translated or installed.
|
---|
829 | updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
|
---|
830 | $(call MSG_L1,lupdate all languages (nls/*.ts))
|
---|
831 | $(QUIET)$(VBOX_LUPDATE4) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
|
---|
832 |
|
---|
833 |
|
---|
834 | #
|
---|
835 | # Test targets
|
---|
836 | #
|
---|
837 |
|
---|
838 | test:
|
---|
839 | @echo ====================
|
---|
840 | @echo $(VirtualBox_GENSRCS) | $(SED) -e "s/ /\n/g"
|
---|
841 | @echo --------------------
|
---|
842 | @echo $(VirtualBox_GENSRCS_REAL) | $(SED) -e "s/ /\n/g"
|
---|
843 | @echo ====================
|
---|
844 | @echo $(VirtualBox_GENHDRS) | $(SED) -e "s/ /\n/g"
|
---|
845 | @echo --------------------
|
---|
846 | @echo $(VirtualBox_GENHDRS_REAL) | $(SED) -e "s/ /\n/g"
|
---|
847 | @echo ====================
|
---|
848 |
|
---|
849 | test2:
|
---|
850 | @echo $(OTHER_CLEAN) | $(SED) -e "s/ /\n/g"
|
---|
851 |
|
---|
852 | test3:
|
---|
853 | @echo $(VirtualBox_HEADERS) | $(SED) -e "s/ /\n/g"
|
---|
854 |
|
---|
855 | testwrappers: $(WRAPPERSFILE)
|
---|
856 |
|
---|