# $Id: Makefile.kmk 11479 2008-08-19 12:11:43Z vboxsync $ ## @file # Makefile for the VBox Main module. # # # 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. # ifdef VBOX_KBUILD_HACKING SUB_DEPTH = ../../.. else DEPTH = ../../.. endif include $(KBUILD_PATH)/subheader.kmk # Include sub-makefile(s). ifdef VBOX_WITH_WEBSERVICES include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk endif include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk # targets++ LIBRARIES += VBoxCOM DLLS += VBoxSettings VBoxC PROGRAMS += VBoxSVC OTHERS += $(VBOX_PATH_SDK)/bindings/VirtualBox.xidl VBOX_MAIN_DEFS = ifneq ($(KBUILD_TARGET),win) ifndef VBOX_WITH_XPCOM $(error "VBox: VBOX_WITH_XPCOM isn't defined") endif DLLS += VBoxSVCM ifneq ($(KBUILD_TARGET),os2) VBOX_MAIN_DEFS+= VBOX_WITH_SYS_V_IPC_SESSION_WATCHER endif ifn1of ($(KBUILD_TARGET), darwin) VBOX_MAIN_DEFS += VBOX_WITH_UNIXY_TAP_NETWORKING endif endif ifdef VBOX_WITH_GUEST_PROPS VBOX_MAIN_DEFS += VBOX_WITH_GUEST_PROPS endif if1of ($(KBUILD_TARGET), linux freebsd solaris) VBOX_MAIN_DEFS += VBOX_MAIN_USE_SEMRW #else # if1of ($(VBOX_VERSION_BUILD),1 3 5 7 9) # VBOX_MAIN_DEFS += VBOX_MAIN_AUTOLOCK_TRAP # endif endif ## @todo eliminate or expand VBOX_MAIN_DEFS. #PROGRAMS += tstCFGLdr ifeq ($(KBUILD_TARGET),win) INSTALLS += VBoxMain-com-inst IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox.idl OTHER_CLEAN += \ $(VBOX_PATH_SDK)/include/VirtualBox.h \ $(IDLFILE) \ $(VBOX_PATH_SDK)/lib/VirtualBox.tlb \ $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \ $(PATH_VBoxCOM)/VirtualBox.h \ $(PATH_VBoxCOM)/VirtualBox_i.c \ $(PATH_VBoxCOM)/VirtualBox.tlb VBOX_MAIN_PREREQS = $(PATH_VBoxCOM)/VirtualBox_i.c else # xpcom INSTALLS += xpcom-components IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox_XPCOM.idl ifeq ($(KBUILD_TARGET),linux) IDLTYPELIB = $(PATH_BIN)/VirtualBox_XPCOM.xpt else IDLTYPELIB = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt endif IDLHEADER = $(VBOX_PATH_SDK)/include/VirtualBox_XPCOM.h OTHERS += $(IDLTYPELIB) OTHER_CLEAN += \ $(IDLFILE) \ $(IDLHEADER) \ $(IDLTYPELIB) VBOX_MAIN_PREREQS = $(IDLTYPELIB) $(IDLHEADER) endif # xpcom BLDDIRS += $(VBOX_PATH_SDK)/idl VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT) # # The Main API documentation # docs: $(PATH_TARGET)/docs.Main $(PATH_TARGET)/docs.Main: \ $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \ $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \ $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl \ | $(call DIRDEP, $(PATH_TARGET)) \ $(call DIRDEP, $(PATH_OUT)/docs/Main) $(RM) -f $(wildcard $(PATH_OUT)/docs/Main/html/*) $(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl $(REDIRECT) -E 'PATH_OUT=$(PATH_OUT)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(PATH_BIN)/VirtualBoxAPI.chm)' \ -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(PATH_OUT)/docs/Main/html/index.hhp) $(APPEND) $(PATH_TARGET)/docs.Main $(call DIRDEP, $(PATH_OUT)/docs/Main): $(MKDIR) -p $@ $(VBOX_PATH_SDK)/bindings/VirtualBox.xidl: $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/bindings $(QUIET)$(CP) $< $@ # # VBoxSVC executable # VBoxSVC_TEMPLATE = VBOXMAINEXE VBoxSVC_DEFS = VBOX_MAIN_SETTINGS_ADDONS $(VBOX_MAIN_DEFS) ifdef VBOX_WITH_VRDP VBoxSVC_DEFS += VBOX_VRDP endif ifdef VBOX_WITH_HGCM VBoxSVC_DEFS += VBOX_HGCM endif ifdef VBOX_MAIN_RELEASE_LOG VBoxSVC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED endif ifdef VBOX_WITH_USB VBoxSVC_DEFS += VBOX_WITH_USB ifdef VBOX_WITH_EHCI VBoxSVC_DEFS += VBOX_WITH_EHCI endif ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN VBoxSVC_DEFS += VBOX_WITH_NEW_USB_CODE_ON_DARWIN endif endif ifdef VBOX_WITH_ALSA VBoxSVC_DEFS += VBOX_WITH_ALSA endif ifdef VBOX_WITH_PULSE VBoxSVC_DEFS += VBOX_WITH_PULSE endif ifdef VBOX_WITH_WINMM VBoxSVC_DEFS += VBOX_WITH_WINMM endif ifdef VBOX_WITH_E1000 VBoxSVC_DEFS += VBOX_WITH_E1000 endif ifdef VBOX_WITH_AHCI VBoxSVC_DEFS += VBOX_WITH_AHCI endif ifdef VBOX_WITHOUT_LINUX_COMPILER_H VBoxSVC_DEFS += VBOX_WITHOUT_LINUX_COMPILER_H endif ifdef VBOX_WITH_RESOURCE_USAGE_API VBoxSVC_DEFS += VBOX_WITH_RESOURCE_USAGE_API endif VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500 VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510 VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL VBoxSVC_INCS = \ include \ $(PATH_VBoxSVC) \ . VBoxSVC_INCS.win = \ $(PATH_VBoxCOM) ifdef VBOX_WITH_USB VBoxSVC_INCS.os2 = \ $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2 endif VBoxSVC_LIBS += \ $(LIB_DDU) \ $(LIB_SETTINGS) VBoxSVC_LIBS.darwin = \ $(LIB_VMM) \ $(LIB_REM) VBoxSVC_LIBS.solaris = \ adm ifdef VBOX_WITH_USB VBoxSVC_LIBS.solaris += \ devinfo endif VBoxSVC_INTERMEDIATES = $(VBOX_MAIN_PREREQS) VBoxSVC_SOURCES = \ Global.cpp \ Logging.cpp \ AutoLock.cpp \ Matching.cpp \ VirtualBoxBase.cpp \ VirtualBoxErrorInfoImpl.cpp \ VirtualBoxImpl.cpp \ VirtualBoxImplExtra.cpp \ MachineImpl.cpp \ SnapshotImpl.cpp \ HardDiskImpl.cpp \ HardDiskAttachmentImpl.cpp \ ProgressImpl.cpp \ DVDDriveImpl.cpp \ DVDImageImpl.cpp \ FloppyDriveImpl.cpp \ FloppyImageImpl.cpp \ HostImpl.cpp \ HostDVDDriveImpl.cpp \ HostFloppyDriveImpl.cpp \ HostNetworkInterfaceImpl.cpp \ GuestOSTypeImpl.cpp \ NetworkAdapterImpl.cpp \ SerialPortImpl.cpp \ ParallelPortImpl.cpp \ USBControllerImpl.cpp \ SATAControllerImpl.cpp \ AudioAdapterImpl.cpp \ SharedFolderImpl.cpp \ SystemPropertiesImpl.cpp \ BIOSSettingsImpl.cpp ifdef VBOX_WITH_VRDP VBoxSVC_SOURCES += VRDPServerImpl.cpp endif VBoxSVC_SOURCES.darwin = \ darwin/iokit.cpp VBoxSVC_SOURCES.win = \ win/svcmain.cpp \ win/svchlp.cpp \ win/VBoxSVC.rc VBoxSVC_SOURCES.linux = \ linux/vbox-libhal.cpp VBoxSVC_SOURCES.solaris = \ linux/vbox-libhal.cpp ifdef VBOX_WITH_XPCOM VBoxSVC_SOURCES += \ xpcom/server.cpp endif ifdef VBOX_WITH_USB VBoxSVC_SOURCES += \ USBDeviceFilterImpl.cpp \ USBProxyService.cpp \ HostUSBDeviceImpl.cpp VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp endif ifdef VBOX_WITH_RESOURCE_USAGE_API VBoxSVC_SOURCES += \ PerformanceImpl.cpp \ Performance.cpp VBoxSVC_SOURCES.darwin += darwin/PerformanceDarwin.cpp VBoxSVC_SOURCES.linux += linux/PerformanceLinux.cpp VBoxSVC_SOURCES.os2 += os2/PerformanceOs2.cpp VBoxSVC_SOURCES.solaris += solaris/PerformanceSolaris.cpp VBoxSVC_SOURCES.win += win/PerformanceWin.cpp VBoxSVC_LDFLAGS.solaris += -lkstat VBoxSVC_LDFLAGS.win += wbemuuid.lib powrprof.lib endif VBoxSVC_LDFLAGS.darwin = -framework IOKit ifeq ($(KBUILD_TYPE),debug) VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols() endif win/VBoxSVC.rc_INCS = $(PATH_TARGET) win/VBoxSVC.rc_DEPS = $(PATH_TARGET)/VBoxSVC.rgs $(PATH_TARGET)/VBoxSVC-icon.rc win/VBoxSVC.rc_CLEAN = $(PATH_TARGET)/VBoxSVC-icon.rc $(PATH_TARGET)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D)) $(RM) -f $@ $(APPEND) $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"' # # VBoxSVC wrapper module # ifdef VBOX_WITH_XPCOM VBoxSVCM_TEMPLATE = VBOXMAINDLL ifneq ($(KBUILD_TARGET),linux) VBoxSVCM_INST = $(INST_BIN)components/ endif VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS) VBoxSVCM_INCS = \ include \ $(PATH_VBoxC) \ . VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) VBoxSVCM_SOURCES = \ xpcom/server_module.cpp ifdef VBOX_WITH_ORIGIN VBoxSVCM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..' endif VBoxSVCM_LDFLAGS.darwin = \ -install_name @executable_path/components/VBoxSVCM.dylib \ -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def ifeq ($(KBUILD_TARGET),darwin) VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def $(PATH_TARGET)/VBoxSVCM.def: $(RM) -f $@ $(APPEND) $@ _NSGetModule endif VBoxSVCM_INTERMEDIATES = $(IDLHEADER) endif # VBOX_WITH_XPCOM # # VBoxC module # VBoxC_TEMPLATE = VBOXMAINDLL ifneq ($(filter-out linux win,$(KBUILD_TARGET)),) VBoxC_INST = $(INST_BIN)components/ endif VBoxC_DEFS = IN_RING3 $(VBOX_MAIN_DEFS) VBoxC_DEFS += VBOX_COM_INPROC ifdef VBOX_WITH_VRDP VBoxC_DEFS += VBOX_VRDP endif ifdef VBOX_WITH_HGCM VBoxC_DEFS += VBOX_HGCM endif ifdef VBOX_MAIN_RELEASE_LOG VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED endif ifdef VBOX_WITH_USB VBoxC_DEFS += VBOX_WITH_USB ifdef VBOX_WITH_EHCI VBoxC_DEFS += VBOX_WITH_EHCI endif endif ifdef VBOX_WITH_ALSA VBoxC_DEFS += VBOX_WITH_ALSA endif ifdef VBOX_WITH_PULSE VBoxC_DEFS += VBOX_WITH_PULSE endif ifdef VBOX_WITH_WINMM VBoxC_DEFS += VBOX_WITH_WINMM endif ifdef VBOX_WITH_CROSSBOW VBoxC_DEFS += VBOX_WITH_CROSSBOW endif ifdef VBOX_WITH_E1000 VBoxC_DEFS += VBOX_WITH_E1000 endif VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500 VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510 VBoxC_INCS = \ include \ $(PATH_VBoxC) VBoxC_INCS.win = \ $(PATH_VBoxCOM) \ . ifdef VBOX_WITH_ORIGIN VBoxC_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..' endif VBoxC_LDFLAGS.darwin = \ -install_name @executable_path/components/VBoxSVCM.dylib \ -exported_symbols_list $(PATH_TARGET)/VBoxC.def ifdef VBOX_USE_VCC80 VBoxC_LDFLAGS.win = /MANIFEST endif VBoxC_LIBS += \ $(LIB_VMM) \ $(LIB_REM) VBoxC_INTERMEDIATES = $(VBOX_MAIN_PREREQS) VBoxC_SOURCES = \ Global.cpp \ Logging.cpp \ AutoLock.cpp \ VBoxDll.cpp \ Version.cpp \ USBDeviceImpl.cpp \ RemoteUSBDeviceImpl.cpp \ VirtualBoxBase.cpp \ VirtualBoxErrorInfoImpl.cpp \ ProgressImpl.cpp \ SharedFolderImpl.cpp \ SessionImpl.cpp \ ConsoleImpl.cpp \ ConsoleImpl2.cpp \ ConsoleVRDPServer.cpp \ GuestImpl.cpp \ KeyboardImpl.cpp \ MouseImpl.cpp \ DisplayImpl.cpp \ FramebufferImpl.cpp \ MachineDebuggerImpl.cpp \ VBoxDriversRegister.cpp \ AudioSnifferInterface.cpp \ VMMDevInterface.cpp VBoxC_SOURCES.win = \ win/dllmain.cpp \ win/VBoxC.def \ win/VBoxC.rc ifdef VBOX_WITH_XPCOM VBoxC_SOURCES += \ xpcom/module.cpp endif ifdef VBOX_WITH_HGCM VBoxC_SOURCES += \ hgcm/HGCMObjects.cpp \ hgcm/HGCMThread.cpp \ hgcm/HGCM.cpp endif ifdef VBOX_WITH_USB VBoxC_SOURCES += \ RemoteUSBBackend.cpp endif ifeq ($(KBUILD_TARGET),darwin) VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def $(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT) $(RM) -f $@ $(APPEND) $@ _NSGetModule $(APPEND) $@ _VBoxDriversRegister endif # Version.cpp uses VBOX_SVN_REV. Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) Version.cpp_DEPS = $(VBOX_SVN_REV_KMK) ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" win/VBoxC.rc_DEPS = $(PATH_TARGET)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb # # VBoxSettings # VBoxSettings_TEMPLATE = VBOXMAINDLL VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS))) VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB VBoxSettings_DEFS = IN_VBOXSETTINGS_R3 VBoxSettings_INCS = \ include \ $(PATH_TARGET) VBoxSettings_SOURCES = \ xml/Settings.cpp VBoxSettings_LDFLAGS.darwin = -install_name @executable_path/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please. # # VBoxCOM - COM Abstraction Layer library # VBoxCOM_TEMPLATE = VBOXMAINLIB VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) VBoxCOM_SOURCES = \ glue/com.cpp \ glue/initterm.cpp \ glue/string.cpp \ glue/EventQueue.cpp \ glue/ErrorInfo.cpp ifeq ($(KBUILD_TARGET),win) VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510 VBoxCOM_SOURCES += \ $(PATH_VBoxCOM)/VirtualBox_i.c else VBoxCOM_INCS += \ include VBoxCOM_SOURCES += \ xpcom/helpers.cpp endif # # Embed XML Schema files to VBoxSVC # VBOX_XML_SCHEMA_H = $(PATH_TARGET)/xml_VirtualBox_settings_xsd.h VBOX_XML_SCHEMA_COMMON_H = $(PATH_TARGET)/xml_VirtualBox_settings_common_xsd.h VBOX_XML_CONVERTER_TEMPLATE_H = $(PATH_TARGET)/xml_SettingsConverter_xsl.h VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl VirtualBoxImplExtra.cpp_DEPS = \ $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H) $(VBOX_XML_SCHEMA_H): $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C) $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@) $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@ $(VBOX_XML_SCHEMA_COMMON_H): $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C) $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@) $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@ $(VBOX_XML_CONVERTER_TEMPLATE_H): $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C) $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@) $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@ OTHER_CLEAN += \ $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H) # # Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema # VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/SchemaDefs.cpp VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl VBoxC_INTERMEDIATES += $(VBOX_XML_SCHEMADEFS_H) VBoxC_INCS += $(PATH_TARGET) VBoxC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP) VBoxSVC_INTERMEDIATES += $(VBOX_XML_SCHEMADEFS_H) VBoxSVC_INCS += $(PATH_TARGET) VBoxSVC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP) OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP) $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@) $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^) $(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@) $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^) # # Creates the symlinks necessary for making XPCOM work. # ## @todo Figure out why Linux really needs this, darwin doesn't... xpcom-components_INST = $(INST_BIN)components/ ifeq ($(KBUILD_TARGET),linux) xpcom-components_SYMLINKS = \ VirtualBox_XPCOM.xpt=>../VirtualBox_XPCOM.xpt \ VBoxXPCOMBase.xpt=>../VBoxXPCOMBase.xpt \ VBoxC$(SUFF_DLL)=>../VBoxC$(SUFF_DLL) \ VBoxSVCM$(SUFF_DLL)=>../VBoxSVCM$(SUFF_DLL) \ VBoxXPCOMIPCC$(SUFF_DLL)=>../VBoxXPCOMIPCC$(SUFF_DLL) endif # # Installs com related thing(s) to bin. # VBoxMain-com-inst_INST = $(INST_BIN) VBoxMain-com-inst_SOURCES = \ win/comregister.cmd # generate rules include $(KBUILD_PATH)/subfooter.kmk # # Additions rules. # XIDLFILE = $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl ifneq ($(KBUILD_TARGET),win) ## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.) xpcom/helpers.cpp: $(IDLTYPELIB) $(IDLFILE): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(XIDLFILE) | $(call DIRDEP,$(dir $(IDLFILE))) $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@) $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(VBOX_XSLTPROC) -o $@ $^ $(IDLTYPELIB): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLTYPELIB))) $(VBOX_XPIDL) $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@) $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $< $(IDLHEADER): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLHEADER))) $(VBOX_XPIDL) $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@) $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $< else MAIN_IDL ?= $(EXEC_X86_WIN32) $(firstword $(wildcard \ $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\ $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\ $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\ ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK) IDL_DEFS = /nologo ifdef VBOX_WITH_VRDP IDL_DEFS += /D VBOX_VRDP endif $(IDLFILE): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(XIDLFILE) $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@) $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/idl $(QUIET)$(VBOX_XSLTPROC) -o $@ $^ $(PATH_TARGET)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(XIDLFILE) $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $^ $(PATH_TARGET)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(XIDLFILE) $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $^ ## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2). # This is kind of obvious when looking at the rule, because it's (a) not specifing all it output # and (b) generating more stuff *after* the maintarget has been completed. # # What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs. $(PATH_VBoxCOM)/VirtualBox_i.c \ + $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \ + $(PATH_VBoxCOM)/VirtualBox.h \ + $(VBOX_PATH_SDK)/include/VirtualBox.h \ + $(PATH_VBoxCOM)/VirtualBox.tlb \ + $(VBOX_PATH_SDK)/lib/VirtualBox.tlb: $(IDLFILE) | $(call DIRDEP,$(PATH_VBoxCOM)) $(MAIN_IDL) $(IDL_DEFS) \ /out $(subst /,\\,$(PATH_VBoxCOM)) \ /cpp_cmd $(subst /,\\,$(TOOL_$(VBOX_VCC_TOOL)_CC)) \ /I $(subst /,\\,$(PATH_SDK_WINPSDK_INC)) \ /I idl \ $(subst /,\\,$<) $(MKDIR) -p $(VBOX_PATH_SDK)/include $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/include $(MKDIR) -p $(VBOX_PATH_SDK)/lib $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/lib $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/lib endif # # Translation stuff # VBoxSVC_HEADERS = \ include/collection.h \ include/MachineImpl.h \ include/HostDVDDriveImpl.h \ include/HostFloppyDriveImpl.h VBoxC_HEADERS = \ include/ConsoleImpl.h VBoxSVC_TRANSLATIONS = \ nls/VBoxSVC_de.ts VBoxC_TRANSLATIONS = \ nls/VBoxC_de.ts updatenls: $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS) $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS) ifdef VBOX_WITH_XPCOM testidl: $(IDLFILE) $(IDLTYPELIB) testidlhdr: $(IDLHEADER) else testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c endif testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP) # Hot fix when dependencies goes bad again... #.NOTPARALLEL: $(TARGET_VBoxC) $(TARGET_VBoxSVC) $(TARGET_VBoxCOM) $(IDLHEADER) $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c