Makefile.kmk revision 6af51bfa1c7d9c89f657cac458247875a191ca48
# $Id$
## @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 (GPL) 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
ifdef VBOX_WITH_WIN32_ADDITIONS
VBOX_WITH_ADDITIONS_ISO.win.x86 = 1
endif
ifneq ($(VBOX_WITH_LINUX_ADDITIONS)$(VBOX_ADDITIONS_LINUX_CROSS),)
VBOX_WITH_ADDITIONS_ISO.linux.x86 = 1
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 \
x11
LINUXINSTALLER = $(VBOX_PATH_ADDITIONS)/VBoxLinuxAdditions.run
endif
LINUXINSTALLER_CROSS = $(PATH_OUT_BASE)/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_WITHOUT_ADDITIONS_ISO
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
endif
# Solaris additions
ifeq ($(BUILD_TARGET),solaris)
SUBDIRS += x11
endif
include $(PATH_KBUILD)/subfooter.kmk
#
# The x86 Windows .iso file spec.
#
ifdef VBOX_WITH_ADDITIONS_ISO.win.x86
ifdef VBOX_ONLY_ADDITIONS
VBOX_PATH_ADDITIONS.win.x86 = $(PATH_OUT_BASE)/win.x86/$(BUILD_TYPE)/bin/additions
else
VBOX_PATH_ADDITIONS.win.x86 = $(VBOX_PATH_ADDITIONS)
endif
## @todo We're missing the .cat files and using the wrong .inf files here.
GUESTADDITIONS_FILESPEC.win.x86 = \
driver/VBoxGuest/VBoxGuest.sys=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxGuest.sys \
driver/VBoxGuest/VBoxGuest.inf=./WINNT/VBoxGuest/VBoxGuest.inf \
driver/VBoxGuest/VBoxService.exe=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxService.exe \
driver/VBoxGuest/VBoxHook.dll=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxHook.dll \
driver/VBoxGuest/VBoxControl.exe=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxControl.exe \
driver/VBoxGuest/VBCoInst.dll=$(VBOX_PATH_ADDITIONS.win.x86)/VBCoInst.dll \
driver/VBoxGuest/VBoxMouse.sys=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxMouse.sys \
driver/VBoxGuest/VBoxMouse.inf=./WINNT/MouseFilter/VBoxMouse.inf \
driver/VBoxVideo/VBoxVideo.sys=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxVideo.sys \
driver/VBoxVideo/VBoxVideo.inf=./WINNT/Graphics/Miniport/VBoxVideo.inf \
driver/VBoxVideo/VBoxDisp.dll=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxDisp.dll \
gina/VBoxGINA.dll=$(VBOX_PATH_ADDITIONS.win.x86)/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=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxGuestAdditions.exe \
AUTORUN.INF=./WINNT/Installer/AUTORUN.INF
ifdef VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS
GUESTADDITIONS_FILESPEC.win.x86 += \
driver/VBoxSF/VBoxSF.sys=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxSF.sys \
driver/VBoxSF/VBoxMRXNP.dll=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxMRXNP.dll
endif
## @todo remove GUESTADDITIONS_WIN32_DEPS when cleaning up later.
GUESTADDITIONS_WIN32_DEPS := $(filter-out %=deleteme=,,$(subst =,=deleteme= ,$(GUESTADDITIONS_FILESPEC.win.x86)))
endif
#
# The OS/2 .iso file spec.
#
ifdef VBOX_WITH_ADDITIONS_ISO.os2.x86
ifdef VBOX_ONLY_ADDITIONS
VBOX_PATH_ADDITIONS.os2.x86 = $(PATH_OUT_BASE)/os2.x86/$(BUILD_TYPE)/bin/additions
else
VBOX_PATH_ADDITIONS.os2.x86 = $(VBOX_PATH_ADDITIONS)
endif
GUESTADDITIONS_FILESPEC.os2.x86 = \
os2/VBoxGuest.sys=$(VBOX_PATH_ADDITIONS.os2.x86)/VBoxGuest.sys \
os2/VBoxService.exe=$(VBOX_PATH_ADDITIONS.os2.x86)/VBoxService.exe \
os2/gengradd.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/gengradd.dll \
os2/libc063.dll=./os2/Bin/libc063.dll \
os2/readme.txt=./os2/Bin/readme.txt \
os2/vboxmouse.sys=$(VBOX_PATH_ADDITIONS.os2.x86)/vboxmouse.sys
else ifdef VBOX_WITH_OS2_ADDITIONS_BIN
GUESTADDITIONS_FILESPEC.os2.x86 = \
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
#
# The x86 Linux .iso file spec.
#
ifdef VBOX_WITH_ADDITIONS_ISO.linux.x86
ifneq ($(VBOX_ONLY_ADDITIONS)$(VBOX_ADDITIONS_LINUX_CROSS),)
VBOX_PATH_ADDITIONS.linux.x86 = $(PATH_OUT_BASE)/linux.x86/$(BUILD_TYPE)/bin/additions
else
VBOX_PATH_ADDITIONS.linux.x86 = $(VBOX_PATH_ADDITIONS)
endif
GUESTADDITIONS_FILESPEC.linux.x86 = \
VBoxLinuxAdditions.run=$(VBOX_PATH_ADDITIONS.linux.x86)/VBoxLinuxAdditions.run
endif
#
# Build the Guest Additions ISO image.
#
ifndef VBOX_WITHOUT_ADDITIONS_ISO
$(VBOX_PATH_ADDITIONS)/VBoxGuestAdditions.iso: \
$(filter-out %=deleteme=,\
$(subst =,=deleteme= ,\
$(GUESTADDITIONS_FILESPEC.win.x86) \
$(GUESTADDITIONS_FILESPEC.linux.x86) \
$(GUESTADDITIONS_FILESPEC.os2.x86) \
)\
) \
$(VBOX_SVN_REV_KMK) \
Makefile.kmk
$(call MSG_TOOL,mkisofs,,$@)
$(QUIET)$(MKDIR) -p $(@D)
$(VBOX_MKISOFS) -rational-rock -joliet -iso-level 4 \
-volid "VBOXADDITIONS_$(VBOX_VERSION_STRING)_$(VBOX_SVN_REV)" -l -graft-points -o $@ \
$(GUESTADDITIONS_FILESPEC.win.x86) \
$(GUESTADDITIONS_FILESPEC.linux.x86) \
$(GUESTADDITIONS_FILESPEC.os2.x86)
endif
#
# Remote building (to be obsoleted).
#
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 LocalConfig.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