VirtualBox

Changeset 10293 in vbox


Ignore:
Timestamp:
Jul 7, 2008 1:15:50 AM (16 years ago)
Author:
vboxsync
Message:

Some reorg (work on integrating qt into kBuild is finally underway).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk

    r10245 r10293  
    1919# additional information or have any questions.
    2020#
    21 
    22 # include qmake project file
    23 include VBoxUI.pro
    24 
    25 # Import QDesigner UI sources
    26 VirtualBox_QT_UISRCS := $(FORMS)
    27 # Import translation sources
    28 VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
    29 
    30 # reset things to avoid possible conflicts with kBuild
    31 TEMPLATE :=
    32 LANGUAGE :=
    33 FORMS :=
    34 TRANSLATIONS :=
    35 IMAGES :=
    3621
    3722VBOX_WITH_REGISTRATION := 1
     
    171156  # Create the targets of the form
    172157  # @executable_path/../Frameworks/Qt???.framework/Versions/4/Qt???
    173   QT_LIB_INSTALL=$(foreach mod, $(VBOX_MODULE_QT4), $(join $(join $(PATH_BIN)/../Frameworks/, $(mod)), .framework/Versions/4/$(mod)))
     158  QT_LIB_INSTALL = $(foreach mod, $(VBOX_MODULE_QT4), $(join $(join $(PATH_BIN)/../Frameworks/, $(mod)), .framework/Versions/4/$(mod)))
    174159  # The target for the libs. This is a special target cause is creates the
    175160  # necessary directory structure. @Bird: is there something for this in
    176161  # kBuild already? Todo: What about uninstall?
     162  ## @todo bird: a qt4-framework install target with a source list like this:
     163  # QtCore.framework/Versions/4/QtCore=>QtCore.framework/Versions/4/QtCore \
     164  # QtGui.framework/Versions/4/QtGui=>QtGui.framework/Versions/4/QtGui
    177165  $(QT_LIB_INSTALL): $(PATH_BIN)/../Frameworks/%: $(VBOX_PATH_QT4_FRAMEWORKS)/%
    178166        $(call MSG_INST_FILE,$<,$@)
     
    183171 endif
    184172else
    185  # The Qt DLLs (move to the root Makefile.kmk, and remove bin from INSTALLS below).
    186  bin_SOURCES += $(VBOX_QT4_RUNTIME)
    187  bin_INST = $(INST_BIN)
    188  bin_MODE = 644
     173 # The Qt DLLs
     174 ## @todo move to the root Makefile.kmk, and remove qt4-bin from INSTALLS below.
     175 qt4-bin_SOURCES += $(VBOX_QT4_RUNTIME)
     176 qt4-bin_INST = $(INST_BIN)
     177 qt4-bin_MODE = 644
    189178endif
    190179
     
    197186
    198187TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
     188ifdef USE_KBUILD_QT_UNIT
     189 TEMPLATE_VBOXQT4GUIEXE_USES = qt
     190 TEMPLATE_VBOXQT4GUIEXE_MOCTOOL = QT4
     191 TEMPLATE_VBOXQT4GUIEXE_UITOOL = QT4
     192 TEMPLATE_VBOXQT4GUIEXE_RCCTOOL = QT4
     193 TEMPLATE_VBOXQT4GUIEXE_SDKS = QT4
     194endif # USE_KBUILD_QT_UNIT
    199195TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS) $(VBOX_DEFS_QT4)
    200196TEMPLATE_VBOXQT4GUIEXE_INCS = \
    201197        $(VBOX_PATH_SDK)/include \
    202     $(VBOX_INCS_QT4)
     198        $(VBOX_INCS_QT4)
    203199
    204200ifeq ($(KBUILD_TARGET),win)
     
    223219        /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
    224220        /DELAYLOAD:oleaut32.dll
    225  TEMPLATE_VBOXQT4GUIEXE_SDKS = WINPSDK
     221 TEMPLATE_VBOXQT4GUIEXE_SDKS += WINPSDK
    226222 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
    227223        $(VBOX_LIBS_QT4) \
     
    342338
    343339#
    344 # exclude inappropriate UI content
    345 #
    346 ifndef VBOX_WITH_REGISTRATION
    347 VirtualBox_QT_UISRCS := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS))
    348 endif
    349 
    350 #
    351340# The targets.
    352341#
    353 PROGRAMS = VirtualBox
     342PROGRAMS += VirtualBox
    354343ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
    355 DLLS = VBoxKeyboard4
    356 OTHERS = $(PATH_BIN)/vboxkeyboard4.tar.gz
    357 endif
    358 INSTALLS = VirtualBox.nls bin
     344DLLS += VBoxKeyboard4
     345## @todo convert to install target.
     346OTHERS += $(PATH_BIN)/vboxkeyboard4.tar.gz
     347endif
     348INSTALLS += VirtualBox.nls qt4-bin
    359349
    360350#
     
    393383
    394384
     385# Include Qt project file, we'll use FORMS and TRANSLATIONS in
     386# the VirtualBox setup below.
     387SAVED_TEMPLATE := $(TEMPLATE)
     388include $(PATH_SUB_CURRENT)/VBoxUI.pro
     389
     390
    395391#
    396392# VirtualBox - The GUI program.
     
    408404VirtualBox_INST = $(INST_BIN)VirtualBox4 $(INST_BIN)VirtualBoxVM4
    409405
    410  # For testing iChat Theater stuff change
    411  # the sdk path
     406 # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
    412407 ifdef VBOX_WITH_ICHAT_THEATER
    413408  VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
    414409 endif
    415 
    416 endif
    417 
    418 ifndef VBOX_OSE
    419 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # linux only, yea, right.
    420 # Note: I'm doing this right here because the GUI will _not_ run
    421 #       without that file which might be annoying for developers!
    422 $(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
    423         $(call MSG_GENERATE,,$@)
    424         $(QUIET)$(CP) $< $@
    425 
    426 $(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
    427 endif
    428 endif
    429 
    430 # Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
    431 VirtualBox_QT_TRANSLATIONS_QT := \
    432         $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\
    433                 $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
    434 
    435 # QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
    436 
    437 # Headers containing definitions of classes that use the Q_OBJECT macro
     410endif # darwin
     411
     412# Headers containing definitions of classes that use the Q_OBJECT macro.
    438413VirtualBox_QT_MOCHDRS = \
    439414        include/QIWidgetValidator.h \
     
    491466        include/VBoxSettingsPage.h
    492467
    493 # Sources containing local definitions of classes that use the Q_OBJECT macro
     468# Sources containing local definitions of classes that use the Q_OBJECT macro.
    494469VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
    495470ifdef VBOX_WITH_XPCOM
    496 VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
    497 endif
    498 
    499 # All generated sources. Note: this list MUST be in sync with Qt source
    500 # generation rules defined somewhere below!
    501 VirtualBox_GENSRCS = \
    502         $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp)
    503 
    504 # All generated headers. Note: this list MUST be in sync with Qt source
    505 # generation rules defined somewhere below!
    506 VirtualBox_GENHDRS = \
    507         $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
    508         $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).gen.h)
    509 
    510 # All header files
    511 VirtualBox_HEADERS = \
    512         $(wildcard include/*.h) \
    513         $(VirtualBox_GENHDRS)
     471 VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
     472endif
    514473
    515474VirtualBox_SOURCES = \
    516         $(VirtualBox_GENSRCS) \
    517475        src/main.cpp \
    518476        src/COMDefs.cpp \
     
    600558endif
    601559
    602 ifneq ($(KBUILD_TARGET),win)
    603 src/HappyHttp.cpp_CXXFLAGS += -fexceptions
    604 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
    605 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
    606 endif
    607 src/HappyHttp.cpp_CXXFLAGS.linux += -O2
    608 
    609 ## @todo how to detect what tool is used?
    610 ## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
    611 #  more generic -Wno-extra
    612 ifdef VBOX_WITH_XPCOM
    613 src/COMDefs.cpp_CXXFLAGS  = $(VBOX_GCC_Wno-extra)
    614 endif
    615 
    616560VirtualBox_DEFS           = VBOX_GUI_SEPARATE_VM_PROCESS
    617561VirtualBox_DEFS.debug     = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
     
    695639endif
    696640
     641ifdef USE_KBUILD_QT_UNIT
     642 ## @todo Move to the appropriate places.
     643
     644 # Import QDesigner UI sources and translations from VBoxUI.pro.
     645 # Note that the OSE about dialog is always required by lupdate/lrelease.
     646 ifndef VBOX_WITH_REGISTRATION
     647  FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
     648 endif
     649 VirtualBox_SOURCES := \
     650        $(VirtualBox_SOURCES) \
     651        $(FORMS) \
     652        ui/VBoxAboutDlg.ui \
     653        $(TRANSLATIONS)
     654
     655 # Resource files with some OSE differences.
     656 ifdef VBOX_OSE
     657  VirtualBox_SOURCES += VirtualBox_OSE.qrc
     658 else
     659  VirtualBox_SOURCES += VirtualBox_NonOSE.qrc
     660  VirtualBox_SOURCES += src/VBoxAboutNonOSEDlg.cpp
     661  VirtualBox_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
     662 endif
     663
     664else # !USE_KBUILD_QT_UNIT
     665
     666 # Import QDesigner UI sources from VBoxUI.pro.
     667 VirtualBox_QT_UISRCS := $(FORMS)
     668 ifndef VBOX_WITH_REGISTRATION
     669  VirtualBox_QT_UISRCS := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS))
     670 endif
     671
     672 # Import translation sources from VBoxUI.pro.
     673 VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
     674
     675 # Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
     676 VirtualBox_QT_TRANSLATIONS_QT := \
     677        $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\
     678                $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
     679
     680 # All generated sources. Note: this list MUST be in sync with Qt source
     681 # generation rules defined somewhere below!
     682 VirtualBox_GENSRCS = \
     683        $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp)
     684
     685 VirtualBox_SOURCES += $(VirtualBox_GENSRCS)
     686
     687
     688 # All generated headers. Note: this list MUST be in sync with Qt source
     689 # generation rules defined somewhere below!
     690 VirtualBox_GENHDRS = \
     691        $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
     692        $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).gen.h)
     693
     694 # grep the images out of the resource file for dependency tracking
     695 VirtualBox_QT_RC += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox.qrc)
     696 VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application.cpp
     697
     698 # We have different about dialogs in OSE and PUEL. Therefor two independent
     699 # resource files exists.
     700 ifdef VBOX_OSE
     701  VirtualBox_QT_RC_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox_OSE.qrc)
     702  VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_ose.cpp
     703 else
     704  VirtualBox_QT_RC_NON_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox_NonOSE.qrc)
     705  VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_non_ose.cpp
     706  VirtualBox_SOURCES += src/VBoxAboutNonOSEDlg.cpp
     707  VirtualBox_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
     708 endif
     709
     710 # OSE version is always necessary for lupdate/lrelease
     711 VirtualBox_QT_UISRCS += ui/VBoxAboutDlg.ui
     712
     713 # All header files
     714 VirtualBox_HEADERS = \
     715        $(wildcard include/*.h) \
     716        $(VirtualBox_GENHDRS)
     717
     718endif # !USE_KBUILD_QT_UNIT
     719
     720# Some flag hacks (should go away).
     721ifneq ($(KBUILD_TARGET),win)
     722 src/HappyHttp.cpp_CXXFLAGS += -fexceptions
     723 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
     724 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
     725endif
     726src/HappyHttp.cpp_CXXFLAGS.linux += -O2
     727
     728## @todo how to detect what tool is used?
     729## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
     730#  more generic -Wno-extra
     731# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
     732ifdef VBOX_WITH_XPCOM
     733 src/COMDefs.cpp_CXXFLAGS  = $(VBOX_GCC_Wno-extra)
     734endif
     735
     736
     737
     738#
     739# On Windows we'll have to generate/edit the resource file.
     740# The IDI_ICON1 name is Qt specific.
     741#
     742$(PATH_TARGET)/VirtualBox4.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
     743        $(RM) -f $@
     744        $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
     745        $(CAT) $@
     746
     747OTHER_CLEAN.win += $(PATH_TARGET)/VirtualBox4.rc
     748
     749
     750#
     751# Other stuff.
     752#
     753
    697754WRAPPERSFILE        = $(PATH_VirtualBox)/include/COMWrappers.h
    698755WRAPPERSINCFILE     = include/COMDefs.h
     
    710767        $(PATH_BIN)/vboxkeyboard.tar.gz
    711768
    712 #
    713 # On Windows we'll have to generate/edit the resource file.
    714 # The IDI_ICON1 name is Qt specific.
    715 #
    716 $(PATH_TARGET)/VirtualBox4.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
    717         $(RM) -f $@
    718         $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
    719         $(CAT) $@
    720 
    721 OTHER_CLEAN.win += $(PATH_TARGET)/VirtualBox4.rc
    722 
    723 
    724 #
    725 # On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
     769
     770#
     771# On OS X (darwin) we need to install icon resources and compusory bundle contents.
     772# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
    726773#
    727774INSTALLS.darwin += VirtualBox.app
     
    787834endif
    788835
    789 # grep the images out of the resource file for dependency tracking
    790 VirtualBox_QT_RC += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox.qrc)
    791 VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application.cpp
    792 
    793 # We have different about dialogs in OSE and PUEL. Therefor two independent
    794 # resource files exists.
    795 ifdef VBOX_OSE
    796 VirtualBox_QT_RC_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox_OSE.qrc)
    797 VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_ose.cpp
    798 else
    799 VirtualBox_QT_RC_NON_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox_NonOSE.qrc)
    800 VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_non_ose.cpp
    801 VirtualBox_SOURCES += src/VBoxAboutNonOSEDlg.cpp
    802 VirtualBox_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
    803 endif
    804 
    805 # OSE version is always necessary for lupdate/lrelease
    806 VirtualBox_QT_UISRCS += ui/VBoxAboutDlg.ui
     836
     837#
     838# Install the license file. Belongs in the root makefile really.
     839#
     840# Note: I'm doing this right here because the GUI will _not_ run
     841#       without that file which might be annoying for developers!
     842#
     843ifndef VBOX_OSE
     844ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),)
     845$(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
     846        $(call MSG_GENERATE,,$@)
     847        $(QUIET)$(CP) $< $@
     848
     849$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
     850endif
     851endif
     852
     853
     854
     855# Unset everything that was loaded from VBoxUI.pro.
     856TEMPLATE := $(SAVED_TEMPLATE)
     857SAVED_TEMPLATE :=
     858LANGUAGE :=
     859FORMS :=
     860TRANSLATIONS :=
     861IMAGES :=
     862
    807863
    808864# Commit the magic.
     
    9511007endef
    9521008
     1009
     1010ifndef USE_KBUILD_QT_UNIT
    9531011# Generate Qt source rules.
    9541012$(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
     1013endif
    9551014
    9561015
     
    10001059# before a new product release. VirtualBox_xx_YY.ts is a template for new
    10011060# languages and should never be actually translated or installed.
    1002 updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
     1061updatenls:: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
    10031062        $(call MSG_L1,lupdate all languages (nls/*.ts))
    10041063        $(QUIET)$(VBOX_LUPDATE4) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
    10051064
    10061065
     1066ifndef USE_KBUILD_QT_UNIT
    10071067#
    10081068# Test targets
     
    10251085test3:
    10261086        @echo $(VirtualBox_HEADERS) | $(SED) -e "s/ /\n/g"
    1027 
    1028 testwrappers: $(WRAPPERSFILE)
    1029 
     1087endif # USE_KBUILD_QT_UNIT
     1088
     1089# alias for generating the COM Wrappers file.
     1090testwrappers:: $(WRAPPERSFILE)
     1091
     1092
     1093ifdef USE_KBUILD_QT_UNIT
     1094
     1095 include $(KBUILD_PATH)/units/qt.kmk
     1096 $(foreach target,VirtualBox,$(evalval def_unit_qt_target_pre))
     1097
     1098endif # USE_KBUILD_QT_UNIT
     1099
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette