1 | # $Id: Makefile.kmk 8467 2008-04-29 15:09:52Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the VirtualBox Qt GUI.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | # additional information or have any questions.
|
---|
20 | #
|
---|
21 |
|
---|
22 | # include qmake project file
|
---|
23 | include VBoxUI.pro
|
---|
24 |
|
---|
25 | # Import QDesigner UI sources
|
---|
26 | VirtualBox_QT_UISRCS := $(FORMS)
|
---|
27 | # Import translation sources
|
---|
28 | VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
|
---|
29 | # Import images
|
---|
30 | VirtualBox_QT_IMAGES := $(IMAGES)
|
---|
31 |
|
---|
32 | # reset things to avoid possible conflicts with kBuild
|
---|
33 | TEMPLATE :=
|
---|
34 | LANGUAGE :=
|
---|
35 | FORMS :=
|
---|
36 | TRANSLATIONS :=
|
---|
37 | IMAGES :=
|
---|
38 |
|
---|
39 | VBOX_WITH_REGISTRATION := 1
|
---|
40 | VBOX_WITH_REGISTRATION_REQUEST := 1
|
---|
41 |
|
---|
42 | DEPTH = ../../../..
|
---|
43 | include $(PATH_KBUILD)/header.kmk
|
---|
44 |
|
---|
45 |
|
---|
46 | #
|
---|
47 | # Additional images that depend on the version type
|
---|
48 | #
|
---|
49 | ifdef VBOX_OSE
|
---|
50 | VirtualBox_QT_IMAGES += \
|
---|
51 | images/OSE/about.png \
|
---|
52 | images/OSE/about_tile.png \
|
---|
53 | images/OSE/about_16px.png \
|
---|
54 | images/OSE/VirtualBox_16px.png \
|
---|
55 | images/OSE/VirtualBox_20px.png \
|
---|
56 | images/OSE/VirtualBox_32px.png \
|
---|
57 | images/OSE/VirtualBox_40px.png \
|
---|
58 | images/OSE/VirtualBox_48px.png \
|
---|
59 | images/OSE/VirtualBox_64px.png \
|
---|
60 | images/OSE/VirtualBox_cube_42px.png
|
---|
61 | else
|
---|
62 | VirtualBox_QT_IMAGES += \
|
---|
63 | images/NonOSE/about.png \
|
---|
64 | images/NonOSE/about_16px.png \
|
---|
65 | images/NonOSE/VirtualBox_16px.png \
|
---|
66 | images/NonOSE/VirtualBox_20px.png \
|
---|
67 | images/NonOSE/VirtualBox_32px.png \
|
---|
68 | images/NonOSE/VirtualBox_40px.png \
|
---|
69 | images/NonOSE/VirtualBox_48px.png \
|
---|
70 | images/NonOSE/VirtualBox_64px.png \
|
---|
71 | images/NonOSE/VirtualBox_cube_42px.png
|
---|
72 | endif
|
---|
73 |
|
---|
74 |
|
---|
75 | #
|
---|
76 | # exclude inappropriate UI content
|
---|
77 | #
|
---|
78 | ifndef VBOX_WITH_REGISTRATION
|
---|
79 | VirtualBox_QT_UISRCS := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS))
|
---|
80 | endif
|
---|
81 |
|
---|
82 |
|
---|
83 | #
|
---|
84 | # The targets.
|
---|
85 | #
|
---|
86 | PROGRAMS = VirtualBox
|
---|
87 | ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
88 | DLLS = VBoxKeyboard
|
---|
89 | OTHERS = $(PATH_BIN)/vboxkeyboard.tar.gz
|
---|
90 | endif
|
---|
91 | INSTALLS = VirtualBox.nls
|
---|
92 |
|
---|
93 | ifeq ($(BUILD_TARGET),os2)
|
---|
94 | DLLS += VBoxHlp
|
---|
95 | ifneq ($(strip $(VBOX_DLL_QT)),)
|
---|
96 | INSTALLS += qt.dll
|
---|
97 | qt.dll_INST = $(INST_BIN)
|
---|
98 | qt.dll_SOURCES += \
|
---|
99 | $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
|
---|
100 | endif
|
---|
101 | endif
|
---|
102 |
|
---|
103 |
|
---|
104 | #
|
---|
105 | # VBoxHlp - helper DLL for OS/2.
|
---|
106 | #
|
---|
107 | VBoxHlp_ASTOOL = NASM
|
---|
108 | VBoxHlp_ASFLAGS = -f obj
|
---|
109 | VBoxHlp_DEFS = IN_RING3 IN_VBOXHLP
|
---|
110 | VBoxHlp_CXXFLAGS = -fno-exceptions
|
---|
111 | VBoxHlp_LDFLAGS = -nostdlib -los2
|
---|
112 | VBoxHlp_LDFLAGS += -Zlinker option -Zlinker manyautodata
|
---|
113 | VBoxHlp_SOURCES = \
|
---|
114 | src/os2/VBoxHlp.asm \
|
---|
115 | src/os2/VBoxHlp.cpp
|
---|
116 |
|
---|
117 |
|
---|
118 | #
|
---|
119 | # VBoxKeyboard - keyboard library for X11.
|
---|
120 | #
|
---|
121 | VBoxKeyboard_TEMPLATE = VBOXR3
|
---|
122 | VBoxKeyboard_SOURCES = \
|
---|
123 | src/linux/keyboard-new.c
|
---|
124 | VBoxKeyboard_TARSOURCES = \
|
---|
125 | $(VBoxKeyboard_SOURCES) \
|
---|
126 | src/linux/COPYING.LIB \
|
---|
127 | src/linux/keyboard.h \
|
---|
128 | src/linux/keyboard-layouts.h \
|
---|
129 | src/linux/keyboard-list.h \
|
---|
130 | src/linux/keyboard-tables.h \
|
---|
131 | src/linux/Makefile
|
---|
132 | VBoxKeyboard_LIBS = X11
|
---|
133 | VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
|
---|
134 |
|
---|
135 |
|
---|
136 | #
|
---|
137 | # vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
|
---|
138 | # redistributed with usable sources.
|
---|
139 | #
|
---|
140 | SOURCE_DIRECTORY = vboxkeyboard
|
---|
141 | DIRECTORY_PREFIX = src/linux/
|
---|
142 |
|
---|
143 | $(PATH_TARGET)/$(SOURCE_DIRECTORY):
|
---|
144 | $(MKDIR) -p $(@D)
|
---|
145 | $(LN_SYMLINK) $(abspath $(PATH_CURRENT))/$(DIRECTORY_PREFIX) $@
|
---|
146 |
|
---|
147 | $(PATH_BIN)/vboxkeyboard.tar.gz: $(VBoxKeyboard_TARSOURCES) $(PATH_TARGET)/$(SOURCE_DIRECTORY)
|
---|
148 | $(call MSG_TOOL,tar/gzip,,$@)
|
---|
149 | $(QUIET)cd $(PATH_TARGET) && tar -chf - $(addprefix $(SOURCE_DIRECTORY)/,$(subst $(DIRECTORY_PREFIX),,$(VBoxKeyboard_TARSOURCES))) | gzip - > $@
|
---|
150 |
|
---|
151 |
|
---|
152 | #
|
---|
153 | # VirtualBox - The GUI program.
|
---|
154 | #
|
---|
155 | VirtualBox_TEMPLATE = VBOXQTGUIEXE
|
---|
156 | VirtualBox_SDKS.win = WINPSDK DXSDK
|
---|
157 | #ifeq ($(filter-out freebsd linux netbsd openbsd os2 solaris,$(BUILD_TARGET)),) - later
|
---|
158 | ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(BUILD_TARGET)),) # X11 + os2
|
---|
159 | VirtualBox_SDKS += LIBSDL
|
---|
160 | endif
|
---|
161 |
|
---|
162 | ifeq ($(BUILD_TARGET),darwin)
|
---|
163 | # For the launch trick we need different inode numbers.
|
---|
164 | VirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
|
---|
165 |
|
---|
166 | # For testing iChat Theater stuff change
|
---|
167 | # the sdk path
|
---|
168 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
169 | VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
|
---|
170 | endif
|
---|
171 |
|
---|
172 | endif
|
---|
173 |
|
---|
174 | ifndef VBOX_OSE
|
---|
175 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # linux only, yea, right.
|
---|
176 | # Note: I'm doing this right here because the GUI will _not_ run
|
---|
177 | # without that file which might be annoying for developers!
|
---|
178 | $(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
|
---|
179 | $(call MSG_GENERATE,,$@)
|
---|
180 | $(QUIET)$(CP) $< $@
|
---|
181 |
|
---|
182 | $(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
|
---|
183 | endif
|
---|
184 | endif
|
---|
185 |
|
---|
186 | # Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
|
---|
187 | VirtualBox_QT_TRANSLATIONS_QT := \
|
---|
188 | $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\
|
---|
189 | $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
|
---|
190 |
|
---|
191 | # QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
|
---|
192 |
|
---|
193 | # Headers containing definitions of classes that use the Q_OBJECT macro
|
---|
194 | VirtualBox_QT_MOCHDRS = \
|
---|
195 | include/QIWidgetValidator.h \
|
---|
196 | include/QIHotKeyEdit.h \
|
---|
197 | include/QIStatusBar.h \
|
---|
198 | include/QIStateIndicator.h \
|
---|
199 | include/QIMessageBox.h \
|
---|
200 | include/QIRichLabel.h \
|
---|
201 | include/VBoxGlobalSettings.h \
|
---|
202 | include/VBoxUtils.h \
|
---|
203 | include/VBoxGlobal.h \
|
---|
204 | include/VBoxVMListBox.h \
|
---|
205 | include/VBoxMediaComboBox.h \
|
---|
206 | include/VBoxSelectorWnd.h \
|
---|
207 | include/VBoxConsoleWnd.h \
|
---|
208 | include/VBoxConsoleView.h \
|
---|
209 | include/VBoxProblemReporter.h \
|
---|
210 | include/VBoxDownloaderWgt.h \
|
---|
211 | include/VBoxNetworkFramework.h
|
---|
212 |
|
---|
213 | # Sources containing local definitions of classes that use the Q_OBJECT macro
|
---|
214 | VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
|
---|
215 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
216 | VirtualBox_QT_MOCSRCS += src/VBoxGlobal.cpp
|
---|
217 | endif
|
---|
218 | ifdef VBOX_WITH_XPCOM
|
---|
219 | VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
|
---|
220 | endif
|
---|
221 |
|
---|
222 | # UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
|
---|
223 | VirtualBox_QT_MOCUIHDRS = \
|
---|
224 | ui/VBoxVMSettingsDlg.ui.h \
|
---|
225 | ui/VBoxVMLogViewer.ui.h \
|
---|
226 | ui/VBoxSharedFoldersSettings.ui.h \
|
---|
227 | ui/VBoxHardDiskSettings.ui.h
|
---|
228 |
|
---|
229 |
|
---|
230 | # All generated sources. Note: this list MUST be in sync with Qt source
|
---|
231 | # generation rules defined somewhere below!
|
---|
232 | VirtualBox_GENSRCS = \
|
---|
233 | $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
|
---|
234 | $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
|
---|
235 | $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
|
---|
236 |
|
---|
237 | # All generated headers. Note: this list MUST be in sync with Qt source
|
---|
238 | # generation rules defined somewhere below!
|
---|
239 | VirtualBox_GENHDRS = \
|
---|
240 | $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
|
---|
241 | $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
|
---|
242 | $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).h)
|
---|
243 |
|
---|
244 | # All existing .ui.h files for known .ui sources
|
---|
245 | VirtualBox_QT_UIHDRS = \
|
---|
246 | $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS)))
|
---|
247 |
|
---|
248 | # All header files
|
---|
249 | VirtualBox_HEADERS = \
|
---|
250 | $(wildcard include/*.h) \
|
---|
251 | $(VirtualBox_GENHDRS) \
|
---|
252 | $(VirtualBox_QT_UIHDRS)
|
---|
253 |
|
---|
254 |
|
---|
255 | VirtualBox_SOURCES = \
|
---|
256 | $(VirtualBox_GENSRCS) \
|
---|
257 | src/main.cpp \
|
---|
258 | src/COMDefs.cpp \
|
---|
259 | src/QIWidgetValidator.cpp \
|
---|
260 | src/QIHotKeyEdit.cpp \
|
---|
261 | src/QIStateIndicator.cpp \
|
---|
262 | src/QIStatusBar.cpp \
|
---|
263 | src/QIMessageBox.cpp \
|
---|
264 | src/QIRichLabel.cpp \
|
---|
265 | src/VBoxDefs.cpp \
|
---|
266 | src/VBoxGlobalSettings.cpp \
|
---|
267 | src/VBoxGlobal.cpp \
|
---|
268 | src/VBoxMediaComboBox.cpp \
|
---|
269 | src/VBoxProblemReporter.cpp \
|
---|
270 | src/VBoxSelectorWnd.cpp \
|
---|
271 | src/VBoxConsoleView.cpp \
|
---|
272 | src/VBoxConsoleWnd.cpp \
|
---|
273 | src/VBoxDownloaderWgt.cpp \
|
---|
274 | src/VBoxVMListBox.cpp \
|
---|
275 | src/VBoxFrameBuffer.cpp \
|
---|
276 | src/HappyHttp.cpp \
|
---|
277 | src/VBoxNetworkFramework.cpp
|
---|
278 |
|
---|
279 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
280 | VirtualBox_SOURCES += \
|
---|
281 | src/linux/XKeyboard-new.cpp
|
---|
282 | endif
|
---|
283 |
|
---|
284 | ifdef VBOX_OSE
|
---|
285 | VirtualBox_SOURCES.win += \
|
---|
286 | src/win32/VirtualBox_OSE.rc
|
---|
287 | else
|
---|
288 | VirtualBox_SOURCES.win += \
|
---|
289 | src/win32/VirtualBox.rc
|
---|
290 | endif
|
---|
291 |
|
---|
292 | VirtualBox_SOURCES.win += \
|
---|
293 | src/VBoxFBDDRAW.cpp
|
---|
294 |
|
---|
295 | VirtualBox_SOURCES.darwin = \
|
---|
296 | src/darwin/DarwinKeyboard.cpp \
|
---|
297 | src/darwin/DarwinCursor.cpp \
|
---|
298 | src/darwin/VBoxAquaStyle.cpp \
|
---|
299 | src/darwin/VBoxUtils-darwin.cpp \
|
---|
300 | src/VBoxFBQuartz2D.cpp
|
---|
301 |
|
---|
302 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
303 | VirtualBox_SOURCES.darwin += \
|
---|
304 | src/darwin/VBoxIChatTheaterWrapper.m
|
---|
305 | endif
|
---|
306 |
|
---|
307 | ifndef VBOX_OSE
|
---|
308 | VirtualBox_SOURCES += src/VBoxAboutNonOSEDlg.cpp
|
---|
309 | VirtualBox_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
|
---|
310 | endif
|
---|
311 | # OSE version is always necessary for lupdate/lrelease
|
---|
312 | VirtualBox_QT_UISRCS += ui/VBoxAboutDlg.ui
|
---|
313 |
|
---|
314 | ifneq ($(BUILD_TARGET),win)
|
---|
315 | src/HappyHttp.cpp_CXXFLAGS += -fexceptions
|
---|
316 | src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
|
---|
317 | src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
|
---|
318 | endif
|
---|
319 | src/HappyHttp.cpp_CXXFLAGS.linux += -O2
|
---|
320 |
|
---|
321 | ## @todo how to detect what tool is used?
|
---|
322 | ## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
|
---|
323 | # more generic -Wno-extra
|
---|
324 | ifdef VBOX_WITH_XPCOM
|
---|
325 | src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
|
---|
326 | endif
|
---|
327 |
|
---|
328 | VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
|
---|
329 | VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
|
---|
330 | VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
|
---|
331 | VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
|
---|
332 | VirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
|
---|
333 | VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
|
---|
334 | VirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
|
---|
335 | VirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL
|
---|
336 | VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
|
---|
337 | VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
|
---|
338 | VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
|
---|
339 | #ifndef VBOX_OSE
|
---|
340 | VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
|
---|
341 | #endif
|
---|
342 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
343 | VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
|
---|
344 | endif
|
---|
345 | ifneq ($(BUILD_TYPE),release)
|
---|
346 | # non-release builds has some extra features.
|
---|
347 | VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
|
---|
348 | VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
|
---|
349 | endif
|
---|
350 | ifdef VBOX_WITH_REGISTRATION
|
---|
351 | VirtualBox_DEFS += VBOX_WITH_REGISTRATION
|
---|
352 | endif
|
---|
353 | ifdef VBOX_WITH_REGISTRATION_REQUEST
|
---|
354 | VirtualBox_DEFS += VBOX_WITH_REGISTRATION_REQUEST
|
---|
355 | endif
|
---|
356 | ifdef VBOX_WITH_ALSA
|
---|
357 | VirtualBox_DEFS += VBOX_WITH_ALSA
|
---|
358 | endif
|
---|
359 | ifdef VBOX_WITH_PULSE
|
---|
360 | VirtualBox_DEFS += VBOX_WITH_PULSE
|
---|
361 | endif
|
---|
362 | ifdef VBOX_OSE
|
---|
363 | VirtualBox_DEFS += VBOX_OSE
|
---|
364 | endif
|
---|
365 | ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
366 | VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
|
---|
367 | endif
|
---|
368 |
|
---|
369 | VirtualBox_INCS = \
|
---|
370 | ./include \
|
---|
371 | $(PATH_VirtualBox)/ui \
|
---|
372 | $(PATH_VirtualBox)/moc \
|
---|
373 | $(PATH_VirtualBox)/include \
|
---|
374 |
|
---|
375 |
|
---|
376 | ifeq ($(BUILD_TYPE),release)
|
---|
377 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
|
---|
378 | else
|
---|
379 | VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
|
---|
380 | ifeq ($(USERNAME),dmik)
|
---|
381 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
|
---|
382 | else
|
---|
383 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
|
---|
384 | endif
|
---|
385 | endif
|
---|
386 | VirtualBox_LDFLAGS.os2 = -Zlinker /PM:PM -Zno-fork
|
---|
387 | VirtualBox_LDFLAGS.darwin = -framework IOKit
|
---|
388 | ifdef VBOX_WITH_ICHAT_THEATER
|
---|
389 | VirtualBox_LDFLAGS.darwin += -framework Foundation -framework AppKit -framework InstantMessage -framework QuartzCore
|
---|
390 | endif
|
---|
391 | VirtualBox_LIBS.win = \
|
---|
392 | $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
|
---|
393 | $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
|
---|
394 | $(PATH_SDK_DXSDK_LIB)/dxguid.lib
|
---|
395 | VirtualBox_LIBS.os2 += $(PATH_DLL)/VBoxHlp$(VBOX_SUFF_DLL)
|
---|
396 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
|
---|
397 | VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
|
---|
398 | endif
|
---|
399 |
|
---|
400 |
|
---|
401 | ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
|
---|
402 | ifeq ($(BUILD_TARGET),win)
|
---|
403 | VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
|
---|
404 | else
|
---|
405 | VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
|
---|
406 | endif
|
---|
407 | endif
|
---|
408 |
|
---|
409 | WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
|
---|
410 | WRAPPERSINCFILE = include/COMDefs.h
|
---|
411 | WRAPPERSTEMPLATE = include/COMWrappers.xsl
|
---|
412 | XIDLFILE = ../../Main/idl/VirtualBox.xidl
|
---|
413 |
|
---|
414 |
|
---|
415 | # generated files we need to clean manually
|
---|
416 | OTHER_CLEAN = \
|
---|
417 | $(VirtualBox_GENSRCS) \
|
---|
418 | $(VirtualBox_GENHDRS) \
|
---|
419 | $(WRAPPERSFILE) \
|
---|
420 | $(PATH_BIN)/vboxkeyboard.tar.gz
|
---|
421 |
|
---|
422 |
|
---|
423 | #
|
---|
424 | # On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
|
---|
425 | #
|
---|
426 | INSTALLS.darwin += VirtualBox.app
|
---|
427 | VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
|
---|
428 | VirtualBox.app_MODE = 644
|
---|
429 | VirtualBox.app_SOURCES = \
|
---|
430 | src/darwin/PkgInfo \
|
---|
431 | $(PATH_TARGET)/Info.plist
|
---|
432 | ifdef VBOX_OSE
|
---|
433 | VirtualBox.app_SOURCES += \
|
---|
434 | images/OSE/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
435 | else
|
---|
436 | VirtualBox.app_SOURCES += \
|
---|
437 | images/NonOSE/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
438 | endif
|
---|
439 |
|
---|
440 | $(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
|
---|
441 | $(call MSG_GENERATE,VirtualBox.app,$<,$@)
|
---|
442 | $(QUIET)$(RM) -f $@
|
---|
443 | $(QUIET)$(SED) \
|
---|
444 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
445 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
446 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
447 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
448 | $< > $@
|
---|
449 |
|
---|
450 | INSTALLS.darwin += VirtualBoxVM.app
|
---|
451 | VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
|
---|
452 | VirtualBoxVM.app_MODE = 644
|
---|
453 | VirtualBoxVM.app_SOURCES = \
|
---|
454 | src/darwin/VM-PkgInfo=>PkgInfo \
|
---|
455 | $(PATH_TARGET)/VM-Info.plist=>Info.plist
|
---|
456 | ifdef VBOX_OSE
|
---|
457 | VirtualBoxVM.app_SOURCES += \
|
---|
458 | images/OSE/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
459 | else
|
---|
460 | VirtualBoxVM.app_SOURCES += \
|
---|
461 | images/NonOSE/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
462 | endif
|
---|
463 | VirtualBoxVM.app_SYMLINKS = \
|
---|
464 | MacOS=>../../../MacOS/
|
---|
465 |
|
---|
466 | $(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
|
---|
467 | $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
|
---|
468 | $(QUIET)$(RM) -f $@
|
---|
469 | $(QUIET)$(SED) \
|
---|
470 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
471 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
472 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
473 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
474 | --output $@ $<
|
---|
475 |
|
---|
476 | #
|
---|
477 | # Translation installation
|
---|
478 | #
|
---|
479 | VirtualBox.nls_INST = $(INST_BIN)nls/
|
---|
480 | VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS)))
|
---|
481 | VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT)))
|
---|
482 | VirtualBox.nls_MODE = 644
|
---|
483 |
|
---|
484 |
|
---|
485 | #
|
---|
486 | # Testcase for the darwin keyboard routines.
|
---|
487 | #
|
---|
488 | ifdef VBOX_WITH_TESTCASES
|
---|
489 | PROGRAMS.darwin += tstDarwinKeyboard
|
---|
490 | tstDarwinKeyboard_TEMPLATE = VBOXR3TSTEXE
|
---|
491 | tstDarwinKeyboard_INCS = include
|
---|
492 | tstDarwinKeyboard_SOURCES = \
|
---|
493 | src/darwin/tstDarwinKeyboard.cpp \
|
---|
494 | src/darwin/DarwinKeyboard.cpp
|
---|
495 | tstDarwinKeyboard_LDFLAGS = -framework IOKit -framework Carbon
|
---|
496 | tstDarwinKeyboard_LIBS = \
|
---|
497 | $(LIB_RUNTIME)
|
---|
498 | endif
|
---|
499 |
|
---|
500 |
|
---|
501 |
|
---|
502 | # Commit the magic.
|
---|
503 | # (note: before custom rules that make usage of generated variables!).
|
---|
504 | include $(PATH_KBUILD)/footer.kmk
|
---|
505 |
|
---|
506 |
|
---|
507 |
|
---|
508 | #
|
---|
509 | # Qt source file generation rules
|
---|
510 | #
|
---|
511 |
|
---|
512 | ## @todo move QT source generation macros to kBuild
|
---|
513 |
|
---|
514 | ## Generate a rule to create a MOC source file from a header containing
|
---|
515 | # classes that use the Q_OBJECT macro.
|
---|
516 | # @param $mochdr header file with Q_OBJECT
|
---|
517 | define def_qt_gen_src_moc
|
---|
518 |
|
---|
519 | $(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
|
---|
520 |
|
---|
521 | $(target)_GENSRCS_REAL += $(mocsrc)
|
---|
522 |
|
---|
523 | $(mocsrc): $(mochdr)
|
---|
524 | $$(call MSG_TOOL,moc,$(target),$(mochdr),$$@)
|
---|
525 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
526 | $$(QUIET)$$(VBOX_MOC) $(mochdr) -o $$@
|
---|
527 |
|
---|
528 | endef
|
---|
529 |
|
---|
530 | ## Generate a rule to create a MOC include file from a source containing
|
---|
531 | # local classes that use the Q_OBJECT macro. This include is then included
|
---|
532 | # by that source, so it must be generated before the source gets compiled.
|
---|
533 | # @param $mocsrc source file with Q_OBJECT
|
---|
534 | define def_qt_gen_inc_moc
|
---|
535 |
|
---|
536 | $(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
|
---|
537 | $(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
|
---|
538 |
|
---|
539 | $(target)_GENHDRS_REAL += $(mocinc)
|
---|
540 |
|
---|
541 | $(mocobj): $(mocinc)
|
---|
542 |
|
---|
543 | .NOTPARALLEL: $(mocinc)
|
---|
544 | $(mocinc): $(mocsrc)
|
---|
545 | $$(call MSG_TOOL,moc,$(target),$(mocsrc),$$@)
|
---|
546 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
547 | $$(QUIET)$$(VBOX_MOC) -i $(mocsrc) -o $$@
|
---|
548 |
|
---|
549 | endef
|
---|
550 |
|
---|
551 | ## Generate a rule to create a MOC include file from a UI header (ui.h) containing
|
---|
552 | # local classes that use the Q_OBJECT macro. This include is then included
|
---|
553 | # by that header, so it must be generated before the UI source gets compiled.
|
---|
554 | # @param $mocuihdr UI header file with Q_OBJECT
|
---|
555 | define def_qt_gen_inc_mocuihdr
|
---|
556 |
|
---|
557 | $(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
|
---|
558 | $(eval uiobj := $(PATH_$(target)_$$(uisrc))/$(notdir $(basename $$(uisrc)))$(VBOX_SUFF_OBJ))
|
---|
559 | $(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
|
---|
560 |
|
---|
561 | $(target)_GENHDRS_REAL += $(mocuiinc)
|
---|
562 |
|
---|
563 | .NOTPARALLEL: $(mocuiinc)
|
---|
564 | $(uisrc): $(mocuiinc)
|
---|
565 | $(mocuiinc): $(mocuihdr)
|
---|
566 | $$(call MSG_TOOL,moc,$(target),$(mocuihdr),$$@)
|
---|
567 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
568 | $$(QUIET)$$(VBOX_MOC) -i $(mocuihdr) -o $$@
|
---|
569 |
|
---|
570 | endef
|
---|
571 |
|
---|
572 | ## Generate a rule to create a header and source files from an UI
|
---|
573 | # definition source (.ui).
|
---|
574 | # @param $uifile UI definintion source file
|
---|
575 | define def_qt_gen_src_ui
|
---|
576 |
|
---|
577 | $(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
|
---|
578 | $(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
|
---|
579 | $(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
|
---|
580 |
|
---|
581 | $(target)_GENSRCS_REAL += $(uisrc) $(mocsrc)
|
---|
582 | $(target)_GENHDRS_REAL += $(uihdr)
|
---|
583 |
|
---|
584 | .NOTPARALLEL: $(uihdr)
|
---|
585 | $(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
|
---|
586 | $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
|
---|
587 | $$(QUIET)$$(VBOX_UIC) $(uifile) -o $$@
|
---|
588 |
|
---|
589 | $(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $$(call DIRDEP,$(dir $(uisrc)))
|
---|
590 | $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
|
---|
591 | $$(QUIET)$$(VBOX_UIC) $(uifile) -i $(uihdr) -o $$@
|
---|
592 |
|
---|
593 | $(mocsrc): $(uihdr) | $$(call DIRDEP,$(dir $(mocsrc)))
|
---|
594 | $$(call MSG_TOOL,moc,$(target),$(uihdr),$$@)
|
---|
595 | $$(QUIET)$$(VBOX_MOC) $(uihdr) -o $$@
|
---|
596 |
|
---|
597 | endef
|
---|
598 |
|
---|
599 | ## Generate a rule to create a .qm file from a NLS translation
|
---|
600 | # source (.ts).
|
---|
601 | # @param $tsfile Translation source file
|
---|
602 | define def_qt_gen_nls
|
---|
603 |
|
---|
604 | $(eval qmfile := $(PATH_$(target))/nls/$(notdir $(basename $(tsfile))).qm)
|
---|
605 |
|
---|
606 | OTHER_CLEAN += $(qmfile)
|
---|
607 |
|
---|
608 | # Note that we use -nocompress in lrelease to avoid stripping comments and
|
---|
609 | # other information from .qm files. If we don't do that, we get .qm files two
|
---|
610 | # times smaller, but QTranslator::findMessage() will start searching for
|
---|
611 | # translations in all existing contexts in case if it cannot find it in the
|
---|
612 | # original context (which is of course not acceptable, no matter if it's a
|
---|
613 | # special Qt "feature" or just a bug).
|
---|
614 |
|
---|
615 | $(qmfile): $(tsfile) | $$(call DIRDEP,$(dir $(qmfile)))
|
---|
616 | $$(call MSG_TOOLS,lrelease,$(target),$(tsfile),$$@)
|
---|
617 | $$(QUIET)$$(VBOX_LRELEASE) -nocompress $(tsfile) -qm $$@
|
---|
618 |
|
---|
619 | endef
|
---|
620 |
|
---|
621 | ## Generate rules for generating the Qt source for a target.
|
---|
622 | # @param $target Target name.
|
---|
623 | define def_qt_gen_src
|
---|
624 |
|
---|
625 | # moc srcs from hdrs with Q_OBJECT
|
---|
626 | $(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
|
---|
627 | # moc includes from srcs with Q_OBJECT
|
---|
628 | $(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
|
---|
629 | # moc includes from UI headers with Q_OBJECT
|
---|
630 | $(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
|
---|
631 | # UI sources
|
---|
632 | $(foreach uifile,$($(target)_QT_UISRCS),$(eval $(def_qt_gen_src_ui)))
|
---|
633 | # NLS files
|
---|
634 | $(foreach tsfile,$($(target)_QT_TRANSLATIONS),$(eval $(def_qt_gen_nls)))
|
---|
635 | $(foreach tsfile,$($(target)_QT_TRANSLATIONS_QT),$(eval $(def_qt_gen_nls)))
|
---|
636 | # dirs
|
---|
637 | $$(call DIRDEP,$(PATH_$(target))/ui/) \
|
---|
638 | $$(call DIRDEP,$(PATH_$(target))/moc/) \
|
---|
639 | $$(call DIRDEP,$(PATH_$(target))/nls/):
|
---|
640 | $$(call MSG_MKDIR,$$@)
|
---|
641 | $$(QUIET)$$(MKDIR) -p $$@
|
---|
642 |
|
---|
643 | endef
|
---|
644 |
|
---|
645 | # Generate Qt source rules.
|
---|
646 | $(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
|
---|
647 |
|
---|
648 |
|
---|
649 | # Generate COM Wrappers
|
---|
650 | .NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
|
---|
651 |
|
---|
652 | $(WRAPPERSINCFILE): $(WRAPPERSFILE)
|
---|
653 |
|
---|
654 | $(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
|
---|
655 | $(call MSG_TOOL,xsltproc,VirtualBox,$<,$@)
|
---|
656 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
|
---|
657 |
|
---|
658 | $(call DIRDEP,$(PATH_VirtualBox)/include/):
|
---|
659 | $(call MSG_MKDIR,$@)
|
---|
660 | $(QUIET)$(MKDIR) -p $@
|
---|
661 |
|
---|
662 | # this is actually necessary only for Win32 target with disabled dependencies
|
---|
663 | define def_wrapper_deps
|
---|
664 | $(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
|
---|
665 | endef
|
---|
666 |
|
---|
667 | $(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
|
---|
668 |
|
---|
669 | # static images imported from VBoxUI.pro as VirtualBox_QT_IMAGES
|
---|
670 |
|
---|
671 | $(PATH_VirtualBox)/ui/vbox_image_collection.txt: VBoxUI.pro $(VirtualBox_QT_IMAGES)
|
---|
672 | $(RM) -f $@
|
---|
673 | $(APPEND) -v $@ VirtualBox_QT_IMAGES
|
---|
674 |
|
---|
675 | $(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $(PATH_VirtualBox)/ui/vbox_image_collection.txt
|
---|
676 | $(call MSG_TOOL,uic,VirtualBox,$<,$@)
|
---|
677 | $(QUIET)$(VBOX_UIC) -o $@ -embed VBoxGUI -f $<
|
---|
678 |
|
---|
679 | VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
|
---|
680 | OTHER_CLEAN += $(PATH_VirtualBox)/ui/vbox_image_collection.txt
|
---|
681 |
|
---|
682 |
|
---|
683 | #
|
---|
684 | # Hand made dependencies go here.
|
---|
685 | # Basically, here are dependencies for generated UI source files that
|
---|
686 | # include generated headers in turn.
|
---|
687 | #
|
---|
688 |
|
---|
689 | $(PATH_VirtualBox)/ui/VBoxDiskImageManagerDlg.cpp: \
|
---|
690 | $(PATH_VirtualBox)/ui/VBoxNewHDWzd.h
|
---|
691 |
|
---|
692 | # Make all generated UI sources dependent on all generated headers (since they
|
---|
693 | # may include them). This is safer than indifidual dependencies above but
|
---|
694 | # currently disabled, because will cause all UI sources to be rebuilt one a
|
---|
695 | # single one changes.
|
---|
696 | #$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS)))) : $(VirtualBox_GENHDRS)
|
---|
697 |
|
---|
698 |
|
---|
699 | #
|
---|
700 | # Custom targets
|
---|
701 | #
|
---|
702 |
|
---|
703 | # Update all known NLS translation (.ts) files in the nls/ subdirectory.
|
---|
704 | # NOTE: This target is intened to be run only by the GUI maintainer shortly
|
---|
705 | # before a new product release. VirtualBox_xx_YY.ts is a template for new
|
---|
706 | # languages and should never be actually translated or installed.
|
---|
707 | updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
|
---|
708 | $(call MSG_L1,lupdate all languages (nls/*.ts))
|
---|
709 | $(QUIET)$(VBOX_LUPDATE) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
|
---|
710 |
|
---|
711 |
|
---|
712 | #
|
---|
713 | # Test targets
|
---|
714 | #
|
---|
715 |
|
---|
716 | test:
|
---|
717 | @echo ====================
|
---|
718 | @echo $(VirtualBox_GENSRCS) | $(SED) -e "s/ /\n/g"
|
---|
719 | @echo --------------------
|
---|
720 | @echo $(VirtualBox_GENSRCS_REAL) | $(SED) -e "s/ /\n/g"
|
---|
721 | @echo ====================
|
---|
722 | @echo $(VirtualBox_GENHDRS) | $(SED) -e "s/ /\n/g"
|
---|
723 | @echo --------------------
|
---|
724 | @echo $(VirtualBox_GENHDRS_REAL) | $(SED) -e "s/ /\n/g"
|
---|
725 | @echo ====================
|
---|
726 |
|
---|
727 | test2:
|
---|
728 | @echo $(OTHER_CLEAN) | $(SED) -e "s/ /\n/g"
|
---|
729 |
|
---|
730 | test3:
|
---|
731 | @echo $(VirtualBox_HEADERS) | $(SED) -e "s/ /\n/g"
|
---|
732 |
|
---|
733 | testwrappers: $(WRAPPERSFILE)
|
---|
734 |
|
---|