Makefile revision 613026678e4ec76bdbb587f62ab3e500d4db1376
#
# Makefile for the VirtualBox Qt GUI.
#
#
# Copyright (C) 2006 InnoTek Systemberatung GmbH
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License 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.
#
# If you received this file as part of a commercial VirtualBox
# distribution, then only the terms of your commercial VirtualBox
# license agreement apply instead of the previous paragraph.
#
XKEYBOARD_NEW := 1
# include qmake project file
# Import QDesigner UI sources
VirtualBox_QT_UISRCS := $(FORMS)
# Import translation sources
# Import images
VirtualBox_QT_IMAGES := $(IMAGES)
# reset things to avoid possible conflicts with kBuild
TEMPLATE :=
LANGUAGE :=
FORMS :=
TRANSLATIONS :=
IMAGES :=
DEPTH = ../../../..
# Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
# QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
# Headers containing definitions of classes that use the Q_OBJECT macro
# Sources containing local definitions of classes that use the Q_OBJECT macro
# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
# All generated sources. Note: this list MUST be in sync with Qt source
# generation rules defined somewhere below!
$(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
$(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
# All generated headers. Note: this list MUST be in sync with Qt source
# generation rules defined somewhere below!
$(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
# All existing .ui.h files for known .ui sources
# All header files
$(VirtualBox_GENHDRS) \
$(VirtualBox_GENSRCS) \
else
## @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
#ifndef VBOX_OSE
#endif
# non-release builds has some extra features.
VirtualBox_INCS = \
./include \
$(PATH_VirtualBox)/ui \
$(PATH_VirtualBox)/moc \
$(PATH_VirtualBox)/include \
else
else
else
# generated files we need to clean manually
OTHER_CLEAN = \
$(VirtualBox_GENSRCS) \
$(VirtualBox_GENHDRS) \
$(WRAPPERSFILE)
#
# On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
#
$(PATH_TARGET)/Info.plist \
$(call MSG_L1,Generating $@)
-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' \
$< > $@
#
# Translation installation
#
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)))
# Commit the magic.
# (note: before custom rules that make usage of generated variables!).
#
# Qt source file generation rules
#
## @todo move QT source generation macros to kBuild
## Generate a rule to create a MOC source file from a header containing
# classes that use the Q_OBJECT macro.
# @param $mochdr header file with Q_OBJECT
## Generate a rule to create a MOC include file from a source containing
# local classes that use the Q_OBJECT macro. This include is then included
# by that source, so it must be generated before the source gets compiled.
# @param $mocsrc source file with Q_OBJECT
.NOTPARALLEL: $(mocinc)
## Generate a rule to create a MOC include file from a UI header (ui.h) containing
# local classes that use the Q_OBJECT macro. This include is then included
# by that header, so it must be generated before the UI source gets compiled.
# @param $mocuihdr UI header file with Q_OBJECT
.NOTPARALLEL: $(mocuiinc)
## Generate a rule to create a header and source files from an UI
# definition source (.ui).
# @param $uifile UI definintion source file
.NOTPARALLEL: $(uihdr)
## Generate a rule to create a .qm file from a NLS translation
# source (.ts).
# @param $tsfile Translation source file
OTHER_CLEAN += $(qmfile)
## Generate rules for generating the Qt source for a target.
# @param $target Target name.
# moc srcs from hdrs with Q_OBJECT
# moc includes from srcs with Q_OBJECT
# moc includes from UI headers with Q_OBJECT
# UI sources
# NLS files
# dirs
# Generate Qt source rules.
# Generate COM Wrappers
$(WRAPPERSINCFILE): $(WRAPPERSFILE)
# this is actually necessary only for Win32 target with disabled dependencies
# static images imported from VBoxUI.pro as VirtualBox_QT_IMAGES
@echo " \
" > $@
#
# Hand made dependencies go here.
# Basically, here are dependencies for generated UI source files that
# include generated headers in turn.
#
# Make all generated UI sources dependent on all generated headers (since they
# may include them). This is safer than indifidual dependencies above but
# currently disabled, because will cause all UI sources to be rebuilt one a
# single one changes.
#$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS)))) : $(VirtualBox_GENHDRS)
#
# Custom targets
#
# Update all known NLS translation (.ts) files in the nls/ subdirectory.
# NOTE: This target is intened 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.
#
# Test targets
#
test:
@echo ====================
@echo --------------------
@echo ====================
@echo --------------------
@echo ====================