Makefile.kmk revision 37b496c57b08e8ae755f0a31e964ae16accc56d9
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd# Makefile for the VirtualBox Qt GUI.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Copyright (C) 2006-2007 innotek GmbH
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# This file is part of VirtualBox Open Source Edition (OSE), as
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc# available from http://www.virtualbox.org. This file is free software;
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# you can redistribute it and/or modify it under the terms of the GNU
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# General Public License as published by the Free Software Foundation,
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
2e545ce2450a9953665f701bb05350f0d3f26275nd# distribution. VirtualBox OSE is distributed in the hope that it will
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# be useful, but WITHOUT ANY WARRANTY of any kind.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# include qmake project file
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# Import QDesigner UI sources
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_UISRCS := $(FORMS)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Import translation sources
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# Import images
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_IMAGES := $(IMAGES)
253547fb9cc7986e84ff68aef076f664fc4169dctakashi# reset things to avoid possible conflicts with kBuild
a78048ccbdb6256da15e6b0e7e95355e480c2301ndLANGUAGE :=
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluemTRANSLATIONS :=
a78048ccbdb6256da15e6b0e7e95355e480c2301ndDEPTH = ../../../..
a78048ccbdb6256da15e6b0e7e95355e480c2301ndinclude $(PATH_KBUILD)/header.kmk
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# The targets.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndPROGRAMS = VirtualBox
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(BUILD_TARGET)),) # X11
a78048ccbdb6256da15e6b0e7e95355e480c2301ndDLLS = VBoxKeyboard
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# VBoxKeyboard - keyboard library for X11.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBoxKeyboard_TEMPLATE = VBOXR3
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBoxKeyboard_SOURCES = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /usr/local/include ## @todo should probably be in the VBOXR3 template...
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# VirtualBox - The GUI program.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_TEMPLATE = VBOXQTGUIEXE
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_SDKS.win = WINPSDK DXSDK
a78048ccbdb6256da15e6b0e7e95355e480c2301nd#ifeq ($(filter-out freebsd linux netbsd openbsd os2 solaris,$(BUILD_TARGET)),) - later
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohifeq ($(filter-out freebsd linux netbsd openbsd os2,$(BUILD_TARGET)),) # X11 + os2
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_SDKS += LIBSDL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(BUILD_TARGET),darwin)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# For the launch trick we need different inode numbers.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifndef VBOX_OSE
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # linux only, yea, right.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Note: I'm doing this right here because the GUI will _not_ run
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# without that file which might be annoying for developers!
a78048ccbdb6256da15e6b0e7e95355e480c2301nd$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_TRANSLATIONS_QT := \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Headers containing definitions of classes that use the Q_OBJECT macro
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_MOCHDRS = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Sources containing local definitions of classes that use the Q_OBJECT macro
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_MOCSRCS += src/VBoxGlobal.cpp
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifdef VBOX_WITH_XPCOM
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_MOCSRCS += src/COMDefs.cpp
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_MOCUIHDRS = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# All generated sources. Note: this list MUST be in sync with Qt source
d05e31513e1ed1df255774920b11ccad0262ad9cnd# generation rules defined somewhere below!
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_GENSRCS = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# All generated headers. Note: this list MUST be in sync with Qt source
5652dbe450e4fcfdf36d4cfb42d7f2345ded29a4maczniak# generation rules defined somewhere below!
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_GENHDRS = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
d05e31513e1ed1df255774920b11ccad0262ad9cnd $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).h)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# All existing .ui.h files for known .ui sources
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_QT_UIHDRS = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS)))
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# All header files
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_HEADERS = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(wildcard include/*.h) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(VirtualBox_GENHDRS) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(VirtualBox_QT_UIHDRS)
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_SOURCES = \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(VirtualBox_GENSRCS) \
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_SOURCES += \
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifneq ($(BUILD_TARGET),win)
727872d18412fc021f03969b8641810d8896820bhumbedooh## @todo how to detect what tool is used?
0d0ba3a410038e179b695446bb149cce6264e0abnd## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
727872d18412fc021f03969b8641810d8896820bhumbedooh# more generic -Wno-extra
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedoohifdef VBOX_WITH_XPCOM
0d0ba3a410038e179b695446bb149cce6264e0abndsrc/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS.darwin = VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedoohVirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
727872d18412fc021f03969b8641810d8896820bhumbedoohVirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_XCURSOR #VBOX_GUI_USE_SDL
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohVirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
205f749042ed530040a4f0080dbcb47ceae8a374rjung#ifndef VBOX_OSE
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
7fec19672a491661b2fe4b29f685bc7f4efa64d4ndifneq ($(BUILD_TYPE),release)
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd # non-release builds has some extra features.
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd VirtualBox_DEFS += VBOX_GUI_USE_REFRESH_TIMER
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
VirtualBox_LDFLAGS.darwin = -framework IOKit
$(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
$(PATH_SDK_DXSDK_LIB)/ddraw.lib \
$(PATH_SDK_DXSDK_LIB)/dxguid.lib
ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
WRAPPERSINCFILE = include/COMDefs.h
WRAPPERSTEMPLATE = include/COMWrappers.xsl
XIDLFILE = ../../Main/idl/VirtualBox.xidl
VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
VirtualBox.app_MODE = 644
$(PATH_TARGET)/Info.plist \
$(call MSG_GENERATE,VirtualBox.app,$<,$@)
VirtualBoxVM.app_MODE = 644
src/darwin/VM-PkgInfo=>PkgInfo \
$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
$(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
VirtualBox.nls_INST = $(INST_BIN)nls/
VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS)))
VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT)))
VirtualBox.nls_MODE = 644
PROGRAMS.darwin += tstDarwinKeyboard
include $(PATH_KBUILD)/footer.kmk
$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
## Generate a rule to create a MOC include file from a UI header (ui.h) containing
$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
# static images imported from VBoxUI.pro as VirtualBox_QT_IMAGES
VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
OTHER_CLEAN += $(PATH_VirtualBox)/ui/vbox_image_collection.txt
$(PATH_VirtualBox)/ui/VBoxDiskImageManagerDlg.cpp: \
$(PATH_VirtualBox)/ui/VBoxNewHDWzd.h
#$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS)))) : $(VirtualBox_GENHDRS)
# before a new product release. VirtualBox_xx_YY.ts is a template for new
$(QUIET)$(VBOX_LUPDATE) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts