Makefile.kmk revision c91ab7d0648260621550e62e2ac5b30c8050646c
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd# Makefile for the VirtualBox Qt GUI.
6ae232055d4d8a97267517c5e50074c2c819941and# Copyright (C) 2006-2007 innotek GmbH
6ae232055d4d8a97267517c5e50074c2c819941and# This file is part of VirtualBox Open Source Edition (OSE), as
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc# available from http://www.virtualbox.org. This file is free software;
6ae232055d4d8a97267517c5e50074c2c819941and# you can redistribute it and/or modify it under the terms of the GNU
6ae232055d4d8a97267517c5e50074c2c819941and# 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.
6ae232055d4d8a97267517c5e50074c2c819941and# If you received this file as part of a commercial VirtualBox
6ae232055d4d8a97267517c5e50074c2c819941and# distribution, then only the terms of your commercial VirtualBox
6ae232055d4d8a97267517c5e50074c2c819941and# license agreement apply instead of the previous paragraph.
6ae232055d4d8a97267517c5e50074c2c819941and# include qmake project file
b43f840409794ed298e8634f6284741f193b6c4ftakashi# Import QDesigner UI sources
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_QT_UISRCS := $(FORMS)
6ae232055d4d8a97267517c5e50074c2c819941and# Import translation sources
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
b43f840409794ed298e8634f6284741f193b6c4ftakashi# Import images
053bfa8a288528fafab2b7a032c15116bb5de711ndVirtualBox_QT_IMAGES := $(IMAGES)
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung# reset things to avoid possible conflicts with kBuild
6ae232055d4d8a97267517c5e50074c2c819941andTEMPLATE :=
b43f840409794ed298e8634f6284741f193b6c4ftakashiTRANSLATIONS :=
6ae232055d4d8a97267517c5e50074c2c819941andDEPTH = ../../../..
6ae232055d4d8a97267517c5e50074c2c819941andinclude $(PATH_KBUILD)/header.kmk
6ae232055d4d8a97267517c5e50074c2c819941andPROGRAMS = VirtualBox
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_TEMPLATE = VBOXQTGUIEXE
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_SDKS.win = WINPSDK DXSDK
6ae232055d4d8a97267517c5e50074c2c819941andifeq ($(BUILD_TARGET),darwin)
6ae232055d4d8a97267517c5e50074c2c819941and# For the launch trick we need different inode numbers.
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
6ae232055d4d8a97267517c5e50074c2c819941and# Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_QT_TRANSLATIONS_QT := \
6ae232055d4d8a97267517c5e50074c2c819941and $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
6ae232055d4d8a97267517c5e50074c2c819941and# QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
6ae232055d4d8a97267517c5e50074c2c819941and# Headers containing definitions of classes that use the Q_OBJECT macro
070897b4d34cbd17fd2846289189f2a9891f9c84takashiVirtualBox_QT_MOCHDRS = \
6ae232055d4d8a97267517c5e50074c2c819941and# Sources containing local definitions of classes that use the Q_OBJECT macro
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
6ae232055d4d8a97267517c5e50074c2c819941andifdef VBOX_WITH_XPCOM
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_QT_MOCSRCS += src/COMDefs.cpp
6ae232055d4d8a97267517c5e50074c2c819941and# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_QT_MOCUIHDRS = \
6ae232055d4d8a97267517c5e50074c2c819941and# All generated sources. Note: this list MUST be in sync with Qt source
6ae232055d4d8a97267517c5e50074c2c819941and# generation rules defined somewhere below!
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_GENSRCS = \
6ae232055d4d8a97267517c5e50074c2c819941and $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
6ae232055d4d8a97267517c5e50074c2c819941and $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
6ae232055d4d8a97267517c5e50074c2c819941and $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
6ae232055d4d8a97267517c5e50074c2c819941and# All generated headers. Note: this list MUST be in sync with Qt source
6ae232055d4d8a97267517c5e50074c2c819941and# generation rules defined somewhere below!
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_GENHDRS = \
6ae232055d4d8a97267517c5e50074c2c819941and $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
6ae232055d4d8a97267517c5e50074c2c819941and $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
6ae232055d4d8a97267517c5e50074c2c819941and $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).h)
6ae232055d4d8a97267517c5e50074c2c819941and# All existing .ui.h files for known .ui sources
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_QT_UIHDRS = \
6ae232055d4d8a97267517c5e50074c2c819941and $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS)))
6ae232055d4d8a97267517c5e50074c2c819941and# All header files
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_HEADERS = \
6ae232055d4d8a97267517c5e50074c2c819941and $(wildcard include/*.h) \
6ae232055d4d8a97267517c5e50074c2c819941and $(VirtualBox_GENHDRS) \
6ae232055d4d8a97267517c5e50074c2c819941and $(VirtualBox_QT_UIHDRS)
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_SOURCES = \
6ae232055d4d8a97267517c5e50074c2c819941and $(VirtualBox_GENSRCS) \
0d0ba3a410038e179b695446bb149cce6264e0abnd## @todo how to detect what tool is used?
727872d18412fc021f03969b8641810d8896820bhumbedooh## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
0d0ba3a410038e179b695446bb149cce6264e0abnd# more generic -Wno-extra
0d0ba3a410038e179b695446bb149cce6264e0abndifdef VBOX_WITH_XPCOM
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohsrc/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
7fec19672a491661b2fe4b29f685bc7f4efa64d4ndVirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
7fec19672a491661b2fe4b29f685bc7f4efa64d4ndVirtualBox_DEFS.darwin = VBOX_GUI_USE_QIMAGE
7fec19672a491661b2fe4b29f685bc7f4efa64d4ndVirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
6ae232055d4d8a97267517c5e50074c2c819941andVirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
VirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL
VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
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
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