# $Id: Makefile.kmk 4410 2007-08-28 20:51:29Z vboxsync $ ## @file # Top-level makefile for the VirtualBox Guest Additions. # # This makefile and all it's sub-makefiles are involved in remote # building of additions that cannot be build locally. Typically # tools/env.sh kmk -C src/VBox/Additions build-somehost-additions # is send as a command and the source tree is accessed using an # SMB mount. # # When doing these operations BUILD_TARGET remains the same (not # yet true for linux), and it's therefore important that # Config.kmk and all the involved (sub-)makefiles doesn't make # assumptions about BUILD_TARGET being the same as the additions # target. # # To setup the remote building of an addition target, let's call it # XYZ, you need to add VBOX_REMOTE_XYZ_ADDITIONS_BUILD to your # LocalConfig.kmk. The value is the command(s) required to execute # the equivalent to you locally executing kmk -C src/VBoxAdditions # build_xyz_additions. This means BUILD_TARGET* and BUILD_TYPE needs # to be specified. # # # Copyright (C) 2006-2007 innotek GmbH # # 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 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. DEPTH = ../../.. include $(PATH_KBUILD)/subheader.kmk # # Make some indicator adjustments to keep things simple in these makefiles. # ifdef VBOX_ADDITIONS_LINUX_ONLY VBOX_ADDITIONS_XYZ_ONLY = 1 VBOX_WITH_LINUX_ADDITIONS = 1 VBOX_REMOTE_LINUX_ADDITIONS_BUILD = VBOX_WITH_WIN32_ADDITIONS = else ifdef VBOX_ADDITIONS_WIN32_ONLY VBOX_ADDITIONS_XYZ_ONLY = 1 VBOX_WITH_WIN32_ADDITIONS = 1 VBOX_REMOTE_WIN32_ADDITIONS_BUILD = VBOX_WITH_LINUX_ADDITIONS = endif # Include sub-makefiles. include $(PATH_SUB_CURRENT)/common/Makefile.kmk ifdef VBOX_WITH_WIN32_ADDITIONS ifndef VBOX_REMOTE_WIN32_ADDITIONS_BUILD include $(PATH_SUB_CURRENT)/WINNT/Makefile.kmk endif endif ifdef VBOX_WITH_LINUX_ADDITIONS SUBDIRS += linux LINUXINSTALLER = $(PATH_BIN)/additions/VBoxLinuxAdditions.run endif LINUXINSTALLER_CROSS = $(PATH_ROOT)/out/linux.x86/$(BUILD_TYPE)/bin/additions/VBoxLinuxAdditions.run ifdef VBOX_ADDITIONS_LINUX_CROSS OTHER_CLEAN += $(LINUXINSTALLER_CROSS) LINUXINSTALLER = $(LINUXINSTALLER_CROSS) endif # The packing target rule, but only if we're on the local build box. ifndef VBOX_ADDITIONS_XYZ_ONLY ifneq ($(VBOX_WITH_WIN32_ADDITIONS)$(VBOX_WITH_LINUX_ADDITIONS),) PACKING += $(if $(VBOX_OSE),,$(PATH_BIN)/additions/VBoxGuestAdditions.iso) endif endif include $(PATH_KBUILD)/subfooter.kmk ifdef VBOX_WITH_WIN32_ADDITIONS GUESTADDITIONS_WIN32_DEPS = $(PATH_BIN)/additions/VBoxGuest.sys \ ./WINNT/VBoxGuest/VBoxGuest.inf \ $(PATH_BIN)/additions/VBoxService.exe \ $(PATH_BIN)/additions/VBoxHook.dll \ $(PATH_BIN)/additions/VBoxControl.exe \ $(PATH_BIN)/additions/VBCoInst.dll \ $(PATH_BIN)/additions/VBoxMouse.sys \ ./WINNT/MouseFilter/VBoxMouse.inf \ $(PATH_BIN)/additions/VBoxVideo.sys \ ./WINNT/Graphics/Miniport/VBoxVideo.inf \ $(PATH_BIN)/additions/VBoxDisp.dll \ $(PATH_BIN)/additions/VBoxGINA.dll \ $(PATH_BIN)/additions/VBoxGuestAdditions.exe \ ./WINNT/Installer/AUTORUN.INF \ ./WINNT/Network/AMD/netamd.inf \ ./WINNT/Network/AMD/pcntpci5.cat \ ./WINNT/Network/AMD/PCNTPCI5.sys ifdef VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS GUESTADDITIONS_WIN32_DEPS += \ $(PATH_BIN)/additions/VBoxMRXNP.dll \ $(PATH_BIN)/additions/VBoxSF.sys endif GUESTADDITIONS_WIN32_FILESPEC = \ driver/VBoxGuest/VBoxGuest.sys=$(PATH_BIN)/additions/VBoxGuest.sys \ driver/VBoxGuest/VBoxGuest.inf=./WINNT/VBoxGuest/VBoxGuest.inf \ driver/VBoxGuest/VBoxService.exe=$(PATH_BIN)/additions/VBoxService.exe \ driver/VBoxGuest/VBoxHook.dll=$(PATH_BIN)/additions/VBoxHook.dll \ driver/VBoxGuest/VBoxControl.exe=$(PATH_BIN)/additions/VBoxControl.exe \ driver/VBoxGuest/VBCoInst.dll=$(PATH_BIN)/additions/VBCoInst.dll \ driver/VBoxGuest/VBoxMouse.sys=$(PATH_BIN)/additions/VBoxMouse.sys \ driver/VBoxGuest/VBoxMouse.inf=./WINNT/MouseFilter/VBoxMouse.inf \ driver/VBoxVideo/VBoxVideo.sys=$(PATH_BIN)/additions/VBoxVideo.sys \ driver/VBoxVideo/VBoxVideo.inf=./WINNT/Graphics/Miniport/VBoxVideo.inf \ driver/VBoxVideo/VBoxDisp.dll=$(PATH_BIN)/additions/VBoxDisp.dll \ driver/VBoxSF/VBoxSF.sys=$(PATH_BIN)/additions/VBoxSF.sys \ driver/VBoxSF/VBoxMRXNP.dll=$(PATH_BIN)/additions/VBoxMRXNP.dll \ gina/VBoxGINA.dll=$(PATH_BIN)/additions/VBoxGINA.dll \ AMD_PCnet/netamd.inf=./WINNT/Network/AMD/netamd.inf \ AMD_PCnet/pcntpci5.cat=./WINNT/Network/AMD/pcntpci5.cat \ AMD_PCnet/PCNTPCI5.sys=./WINNT/Network/AMD/PCNTPCI5.sys \ VBoxGuestAdditions.exe=$(PATH_BIN)/additions/VBoxGuestAdditions.exe \ AUTORUN.INF=./WINNT/Installer/AUTORUN.INF endif ifdef LINUXINSTALLER GUESTADDITIONS_LINUX_DEPS = $(LINUXINSTALLER) GUESTADDITIONS_LINUX_FILESPEC = VBoxLinuxAdditions.run=$(LINUXINSTALLER) endif ifdef VBOX_WITH_OS2_ADDITIONS_BIN GUESTADDITIONS_OS2_FILESPEC = \ os2/VBoxGuest.sys=./os2/Bin/VBoxGuest.sys \ os2/VBoxService.exe=./os2/Bin/VBoxService.exe \ os2/gengradd.dll=./os2/Bin/gengradd.dll \ os2/libc063.dll=./os2/Bin/libc063.dll \ os2/readme.txt=./os2/Bin/readme.txt \ os2/vboxmouse.sys=./os2/Bin/vboxmouse.sys endif # # Build the Guest Additions ISO image. # $(PATH_BIN)/additions/VBoxGuestAdditions.iso: \ $(GUESTADDITIONS_WIN32_DEPS) $(GUESTADDITIONS_LINUX_DEPS) $(VBOX_SVN_REV_KMK) \ Makefile.kmk $(call MSG_TOOL,mkisofs,,$@) $(QUIET)$(VBOX_MKISOFS) -rational-rock -joliet -iso-level 4 -volid "VBOXADDITIONS_$(VBOX_VERSION_STRING)_$(VBOX_SVN_REV)" -l -graft-points -o $@ \ $(GUESTADDITIONS_WIN32_FILESPEC) $(GUESTADDITIONS_LINUX_FILESPEC) $(GUESTADDITIONS_OS2_FILESPEC) # # Remote building. # ifdef VBOX_REMOTE_WIN32_ADDITIONS_BUILD OTHER_CLEAN += $(PATH_TARGET)/ts-remote-build-win32-additions $(GUESTADDITIONS_WIN32_DEPS): $(PATH_TARGET)/ts-remote-build-win32-additions $(PATH_TARGET)/ts-remote-build-win32-additions: $(RM) -f $@ $(VBOX_REMOTE_WIN32_ADDITIONS_BUILD) $(APPEND) $@ endif # VBOX_REMOTE_BUILD_WIN32_ADDITIONS build-win32-additions: ifneq ($(BUILD_TARGET),linux) # Nothing is signed here and wine is faster building it. $(KMK) VBOX_ADDITIONS_WIN32_ONLY=1 -C ../Runtime endif $(KMK) VBOX_ADDITIONS_WIN32_ONLY=1 -C . all packing # build the Linux installer on a remote machine # TODO: Move the VBOX_REMOTE_LINUX32_ADDITIONS_BUILD stuff into LocaleConfig.kmk on the x86 box. VBOX_REMOTE_LINUX32_ADDITIONS_BUILD ?= ssh vbox@$(VBOX_ADDITIONS_LINUX_CROSS_HOST) "./enter-rhel3-jail /mnt/tinderwin_vbox/w32-rel/tools/env.sh --no-wine kmk -C src/VBox/Additions build-linux32-additions BUILD_TYPE=release" $(LINUXINSTALLER_CROSS): $(VBOX_REMOTE_LINUX32_ADDITIONS_BUILD) test-build-linux32-additions: $(LINUXINSTALLER_CROSS) build-linux32-additions: $(KMK) VBOX_ADDITIONS_LINUX_ONLY=1 -C ../Runtime $(KMK) VBOX_ADDITIONS_LINUX_ONLY=1 -C common $(KMK) VBOX_ADDITIONS_LINUX_ONLY=1 -C linux all packing