VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk@ 11955

最後變更 在這個檔案從11955是 11849,由 vboxsync 提交於 17 年 前

Merged VBOX_WITH_NETFLT_WINDOWS into VBOX_WITH_NETFLT. Made the GUIs, Main, Devices and HostDrivers use VBOX_WITH_NETFLT.

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette