# $Id: Makefile.kmk 14728 2008-11-27 18:01:16Z vboxsync $ ## @file # Makefile for the VirtualBox Qt3 GUI. # # # Copyright (C) 2006-2007 Sun Microsystems, Inc. # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa # Clara, CA 95054 USA or visit http://www.sun.com if you need # additional information or have any questions. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk # # Globals. # VBOX_PATH_VIRTUALBOX3_SRC := $(PATH_SUB_CURRENT) VBOX_WITH_REGISTRATION := 1 VBOX_WITH_REGISTRATION_REQUEST := 1 # # The targets. # ifdef VBOX_WITH_HARDENING PROGRAMS += VirtualBox3Hardened DLLS += VirtualBox else PROGRAMS += VirtualBox endif ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11 DLLS += VBoxKeyboard3 OTHERS += $(PATH_BIN)/vboxkeyboard3.tar.gz endif DLLS.os2 += VBoxHlp ifeq ($(KBUILD_TARGET),os2) # # VBoxHlp - helper DLL for OS/2. # VBoxHlp_ASTOOL = NASM VBoxHlp_ASFLAGS = -f obj VBoxHlp_DEFS = IN_RING3 IN_VBOXHLP VBoxHlp_CXXFLAGS = -fno-exceptions VBoxHlp_LDFLAGS = -nostdlib -los2 VBoxHlp_LDFLAGS += -Zlinker option -Zlinker manyautodata VBoxHlp_SOURCES = \ src/os2/VBoxHlp.asm \ src/os2/VBoxHlp.cpp # # Hack for installing the qt.dll when building for OS/2. # ifneq ($(strip $(DLL_SDK_QT3_QT)),) INSTALLS.os2 += qt.dll qt.dll_INST = $(INST_BIN) qt.dll_SOURCES += \ $(DLL_SDK_QT3_QT)=>$(not-dir $(DLL_SDK_QT3_QT)) endif endif # OS/2 # # VBoxKeyboard3 - keyboard library for X11. # VBoxKeyboard3_TEMPLATE = VBOXR3 VBoxKeyboard3_SOURCES = \ src/linux/keyboard-new.c VBoxKeyboard3_TARSOURCES = \ $(VBoxKeyboard3_SOURCES) \ src/linux/COPYING.LIB \ src/linux/keyboard.h \ src/linux/keyboard-layouts.h \ src/linux/keyboard-list.h \ src/linux/keyboard-tables.h \ src/linux/keyboard-types.h \ src/linux/Makefile VBoxKeyboard3_LIBS = X11 VBoxKeyboard3_LIBPATH = $(VBOX_LIBPATH_X11) # # vboxkeyboard3.tar.gz - the LGPLed keyboard library must always be # redistributed with usable sources. # SOURCE_DIRECTORY = vboxkeyboard3 DIRECTORY_PREFIX = src/linux/ $(PATH_TARGET)/$(SOURCE_DIRECTORY): | $$(dir $@) $(LN_SYMLINK) $(abspath $(VBOX_PATH_VIRTUALBOX3_SRC))/$(DIRECTORY_PREFIX) $@ $(PATH_BIN)/vboxkeyboard3.tar.gz: $(abspathex $(VBoxKeyboard3_TARSOURCES),$(PATH_SUB_CURRENT)) $(PATH_TARGET)/$(SOURCE_DIRECTORY) $(call MSG_TOOL,tar/gzip,,$@) $(QUIET)cd $(PATH_TARGET) \ && tar -cvhf - $(addprefix $(SOURCE_DIRECTORY)/,$(subst $(DIRECTORY_PREFIX),,$(VBoxKeyboard3_TARSOURCES))) \ | gzip - > $@ OTHER_CLEAN += \ $(PATH_BIN)/vboxkeyboard3.tar.gz \ $(PATH_TARGET)/$(SOURCE_DIRECTORY) # # Hardened VirtualBox3. # VirtualBox3Hardened_TEMPLATE = VBOXR3HARDENEDEXE VirtualBox3Hardened_SOURCES = src/hardenedmain.cpp VirtualBox3Hardened_NAME = VirtualBox3 ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed. #VirtualBox3Hardened_INST.darwin = $(INST_BIN)VirtualBox3 $(INST_BIN)VirtualBoxVM3 VirtualBox3Hardened_INST = $(INST_BIN)VirtualBox3 $(INST_BIN)VirtualBoxVM3 endif # # Include Qt project file, we'll use FORMS, TRANSLATIONS and IMAGES # in the VirtualBox(3) setup below. # SAVED_TEMPLATE := $(TEMPLATE) include $(PATH_SUB_CURRENT)/VBoxUI.pro # Import images from VBoxUI.pro and add some additional ones # that differs between OSE and PEUL. VirtualBox_QT_IMAGES := $(IMAGES) ifdef VBOX_OSE VirtualBox_QT_IMAGES += \ images/OSE/about.png \ images/OSE/about_tile.png \ images/OSE/about_16px.png \ images/OSE/VirtualBox_16px.png \ images/OSE/VirtualBox_20px.png \ images/OSE/VirtualBox_32px.png \ images/OSE/VirtualBox_40px.png \ images/OSE/VirtualBox_48px.png \ images/OSE/VirtualBox_64px.png \ images/OSE/VirtualBox_cube_42px.png else VirtualBox_QT_IMAGES += \ images/NonOSE/about.png \ images/NonOSE/about_16px.png \ images/NonOSE/VirtualBox_16px.png \ images/NonOSE/VirtualBox_20px.png \ images/NonOSE/VirtualBox_32px.png \ images/NonOSE/VirtualBox_40px.png \ images/NonOSE/VirtualBox_48px.png \ images/NonOSE/VirtualBox_64px.png \ images/NonOSE/VirtualBox_cube_42px.png endif VirtualBox_QT_IMAGES := $(abspathex $(VirtualBox_QT_IMAGES),$(PATH_SUB_CURRENT)) # # VirtualBox - The GUI program. # VirtualBox_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXQTGUI,VBOXQTGUIEXE) VirtualBox_NAME = VirtualBox3 ifndef VBOX_WITH_HARDENING # For the launch trick we need different inode numbers. ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed. #VirtualBox_INST.darwin = $(INST_BIN)VirtualBox3 $(INST_BIN)VirtualBoxVM3 VirtualBox_INST = $(INST_BIN)VirtualBox3 $(INST_BIN)VirtualBoxVM3 endif endif USES += qt3 VirtualBox_USES = qt3 VirtualBox_SDKS += QT3 VirtualBox_QTTOOL = QT3 VirtualBox_SDKS.win = WINPSDK DXSDK #ifeq ($(filter-out freebsd linux netbsd openbsd os2 solaris,$(KBUILD_TARGET)),) - later ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 VirtualBox_SDKS += LIBSDL endif # For testing iChat Theater stuff change the sdk path (HACK ALERT) ifdef VBOX_WITH_ICHAT_THEATER VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk endif # Import translation sources VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS) \ $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS))) VirtualBox_LRCFLAGS = -nocompress VirtualBox_QT_TRANSLATIONS_INST = $(INST_BIN)nls3/ # QDesigner UI sources are imported from VBoxUI.pro. ## @todo move down. ifndef VBOX_WITH_REGISTRATION FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS)) endif # OSE version is always necessary for lupdate/lrelease FORMS += ui/VBoxAboutDlg.ui $(eval VirtualBox_SOURCES += $(FORMS) ) # Headers containing definitions of classes that use the Q_OBJECT macro VirtualBox_QT_MOCHDRS = \ include/QIWidgetValidator.h \ include/QIHotKeyEdit.h \ include/QIStatusBar.h \ include/QIStateIndicator.h \ include/QIMessageBox.h \ include/QIRichLabel.h \ include/VBoxGlobalSettings.h \ include/VBoxUtils.h \ include/VBoxGlobal.h \ include/VBoxVMListBox.h \ include/VBoxMediaComboBox.h \ include/VBoxSelectorWnd.h \ include/VBoxConsoleWnd.h \ include/VBoxConsoleView.h \ include/VBoxProblemReporter.h \ include/VBoxDownloaderWgt.h \ include/VBoxNetworkFramework.h # Sources containing local definitions of classes that use the Q_OBJECT macro VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 VirtualBox_QT_MOCSRCS += src/VBoxGlobal.cpp endif ifdef VBOX_WITH_XPCOM VirtualBox_QT_MOCSRCS += src/COMDefs.cpp endif # UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro ## @todo move up VirtualBox_QT_MOCSRCS += \ ui/VBoxVMSettingsDlg.ui.h \ ui/VBoxVMLogViewer.ui.h \ ui/VBoxSharedFoldersSettings.ui.h \ ui/VBoxHardDiskSettings.ui.h VirtualBox_SOURCES += \ src/main.cpp \ src/COMDefs.cpp \ src/QIWidgetValidator.cpp \ src/QIHotKeyEdit.cpp \ src/QIStateIndicator.cpp \ src/QIStatusBar.cpp \ src/QIMessageBox.cpp \ src/QIRichLabel.cpp \ src/VBoxDefs.cpp \ src/VBoxGlobalSettings.cpp \ src/VBoxGlobal.cpp \ src/VBoxMediaComboBox.cpp \ src/VBoxProblemReporter.cpp \ src/VBoxSelectorWnd.cpp \ src/VBoxConsoleView.cpp \ src/VBoxConsoleWnd.cpp \ src/VBoxDownloaderWgt.cpp \ src/VBoxVMListBox.cpp \ src/VBoxFrameBuffer.cpp \ src/HappyHttp.cpp \ src/VBoxNetworkFramework.cpp ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 VirtualBox_SOURCES += \ src/linux/XKeyboard-new.cpp endif VirtualBox_SOURCES.win += \ src/VBoxFBDDRAW.cpp \ $(PATH_VirtualBox)/VirtualBox.rc VirtualBox_SOURCES.darwin = \ src/darwin/DarwinKeyboard.cpp \ src/darwin/DarwinCursor.cpp \ src/darwin/VBoxAquaStyle.cpp \ src/darwin/VBoxUtils-darwin.cpp \ src/VBoxFBQuartz2D.cpp ifdef VBOX_WITH_ICHAT_THEATER VirtualBox_SOURCES.darwin += \ src/darwin/VBoxIChatTheaterWrapper.m endif ifndef VBOX_OSE VirtualBox_SOURCES += src/VBoxAboutNonOSEDlg.cpp VirtualBox_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h endif VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL VirtualBox_DEFS.linux = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL VirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL VirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP #ifndef VBOX_OSE VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT #endif ifdef VBOX_WITH_ICHAT_THEATER VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER endif ifneq ($(KBUILD_TYPE),release) # non-release builds has some extra features. VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE endif ifdef VBOX_WITH_REGISTRATION VirtualBox_DEFS += VBOX_WITH_REGISTRATION endif ifdef VBOX_WITH_REGISTRATION_REQUEST VirtualBox_DEFS += VBOX_WITH_REGISTRATION_REQUEST endif ifdef VBOX_WITH_ALSA VirtualBox_DEFS += VBOX_WITH_ALSA endif ifdef VBOX_WITH_PULSE VirtualBox_DEFS += VBOX_WITH_PULSE endif ifdef VBOX_WITH_E1000 VirtualBox_DEFS += VBOX_WITH_E1000 endif ifdef VBOX_WITH_DEBUGGER_GUI VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU endif ifdef VBOX_WITH_NETFLT VirtualBox_DEFS += VBOX_WITH_NETFLT endif VirtualBox_INCS = \ . \ ./include \ $(PATH_VirtualBox)/include ifeq ($(KBUILD_TYPE),release) VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows else VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols() ifeq ($(USERNAME),dmik) VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows else VirtualBox_LDFLAGS.win += /SUBSYSTEM:console endif endif VirtualBox_LDFLAGS.os2 = -Zlinker /PM:PM -Zno-fork VirtualBox_LDFLAGS.darwin = \ -framework IOKit -framework Carbon -framework QuickTime \ $(if $(VBOX_WITH_HARDENING),-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VirtualBox3.dylib) ifdef VBOX_WITH_ICHAT_THEATER VirtualBox_LDFLAGS.darwin += -framework Foundation -framework AppKit -framework InstantMessage -framework QuartzCore endif VirtualBox_LIBS.win = \ $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \ $(PATH_SDK_DXSDK_LIB)/ddraw.lib \ $(PATH_SDK_DXSDK_LIB)/dxguid.lib VirtualBox_LIBS.os2 += $(PATH_DLL)/VBoxHlp$(VBOX_SUFF_DLL) ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard3$(VBOX_SUFF_DLL) endif ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too. ifeq ($(KBUILD_TARGET),win) VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg3$(VBOX_SUFF_LIB) else VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg3$(VBOX_SUFF_DLL) endif endif # Some flag hacks (should go away). ifneq ($(KBUILD_TARGET),win) VirtualBox_src/HappyHttp.cpp_CXXFLAGS += -fexceptions VirtualBox_src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions VirtualBox_src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions endif VirtualBox_src/HappyHttp.cpp_CXXFLAGS.linux += -O2 ## @todo how to detect what tool is used? ## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use more generic -Wno-extra ## @todo r=bird: see VirtualBox4. ifdef VBOX_WITH_XPCOM VirtualBox_src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra) endif # # static images imported from VBoxUI.pro as VirtualBox_QT_IMAGES # VirtualBox_BLDDIRS += $(PATH_VirtualBox)/ui VirtualBox_SOURCES += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp VirtualBox_CLEAN += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp $(PATH_VirtualBox)/ui/vbox_image_collection.txt $$(PATH_VirtualBox)/ui/vbox_image_collection.txt: $(PATH_SUB_CURRENT)/VBoxUI.pro $$(VirtualBox_QT_IMAGES) | $$(dir $$@) $(RM) -f $@ $(APPEND) -v $@ VirtualBox_QT_IMAGES $$(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $$(PATH_VirtualBox)/ui/vbox_image_collection.txt | $$(dir $$@) $(call MSG_TOOL,uic,VirtualBox,$<,$@) $(QUIET)$(VBOX_UIC) -o $@ -embed VBoxGUI -f $< # # Generate COM Wrappers # VirtualBox_BLDDIRS += $(PATH_VirtualBox)/include VirtualBox_CLEAN += $(PATH_VirtualBox)/include/COMWrappers.h VirtualBox_INTERMEDIATES += $(PATH_VirtualBox)/include/COMWrappers.h $$(PATH_VirtualBox)/include/COMWrappers.h: \ $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl \ $(VBOX_PATH_VIRTUALBOX3_SRC)/include/COMWrappers.xsl \ | $$(dir $$@) $(call MSG_GENERATE,VirtualBox,$<,$@) $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_VIRTUALBOX3_SRC)/include/COMWrappers.xsl $< # alias for generating the COM Wrappers file. testwrappers:: $$(PATH_VirtualBox)/include/COMWrappers.h ifeq ($(KBUILD_TARGET),win) # # On Windows we'll have to generate/edit the resource file. # The IDI_ICON1 name is Qt specific. # $$(PATH_VirtualBox)/VirtualBox.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@) $(RM) -f $@ $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"' $(CAT) $@ VirtualBox_CLEAN.win += $(PATH_VirtualBox)/VirtualBox.rc endif # win if "$(KBUILD_TARGET)" == "darwin" && !defined(VBOX_WITH_QT4GUI) # don't conflict the qt4 gui # # On Mac OS X (darwin) we need to install icon resources and compulsory bundle contents. # $(warning The qt3 gui will not work right on it own after we renamed it to *3..) INSTALLS.darwin += VirtualBox3.app VirtualBox3.app_INST = $(INST_VIRTUALBOX)Contents/ VirtualBox3.app_MODE = 644 VirtualBox3.app_SOURCES = \ src/darwin/PkgInfo \ $(PATH_VirtualBox3.app)/Info.plist \ $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns $$(PATH_VirtualBox3.app)/Info.plist: $(PATH_SUB_CURRENT)/src/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@) $(call MSG_GENERATE,VirtualBox3.app,$<,$@) $(QUIET)$(RM) -f $@ $(QUIET)$(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ $< > $@ INSTALLS.darwin += VirtualBoxVM3.app VirtualBoxVM3.app_INST = $(VirtualBox3.app_INST)Resources/VirtualBoxVM.app/Contents/ VirtualBoxVM3.app_MODE = 644 VirtualBoxVM3.app_SOURCES = \ src/darwin/VM-PkgInfo=>PkgInfo \ $(PATH_VirtualBoxVM3.app)/VM-Info.plist=>Info.plist \ $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns VirtualBoxVM3.app_SYMLINKS = \ MacOS=>../../../MacOS/ $$(PATH_VirtualBoxVM3.app)/VM-Info.plist: $(PATH_SUB_CURRENT)/src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $$(dir $$@) $(call MSG_GENERATE,VirtualBoxVM3.app,$<,$@) $(QUIET)$(RM) -f $@ $(QUIET)$(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ --output $@ \ $< endif # darwin && !qt4gui ifdef VBOX_WITH_TESTCASES # # Testcase for the darwin keyboard routines. # PROGRAMS.darwin += tstDarwinKeyboard tstDarwinKeyboard_TEMPLATE = VBOXR3TSTEXE tstDarwinKeyboard_NAME = tstDarwinKeyboard3 tstDarwinKeyboard_INCS = include tstDarwinKeyboard_SOURCES = \ src/darwin/tstDarwinKeyboard.cpp \ src/darwin/DarwinKeyboard.cpp tstDarwinKeyboard_LDFLAGS = -framework IOKit -framework Carbon tstDarwinKeyboard_LIBS = \ $(LIB_RUNTIME) endif # # Restore / reset things to avoid possible conflicts with kBuild (VBoxUI.pro). # TEMPLATE := $(SAVED_TEMPLATE) LANGUAGE := FORMS := TRANSLATIONS := IMAGES := # Commit the magic. include $(KBUILD_PATH)/subfooter.kmk # # Update all known NLS translation (.ts) files in the nls/ subdirectory. # # NOTE: This target is intended to be run only by the GUI maintainer shortly # before a new product release. VirtualBox_xx_YY.ts is a template for new # languages and should never be actually translated or installed. # updatenls:: \ $(VirtualBox_SOURCES) \ $(wildcard include/*.h) $(call MSG_L1,lupdate all languages (nls/*.ts)) $(QUIET)$(TOOL_QT3_LUPDATE) \ $^ \ -ts \ $(filter-out nls/qt_%.ts,$(VirtualBox_QT_TRANSLATIONS)) \ nls/VirtualBox_xx_YY.ts