Makefile.kmk revision 2f139cbf73f9adba01382892f33558ad7bcb40cb
# $Id$
## @file
# Sub-Makefile for the Windows Guest Additions Installer.
#
#
# Copyright (C) 2006-2007 Oracle Corporation
#
# 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.
#
SUB_DEPTH = ../../../../..
include $(KBUILD_PATH)/subheader.kmk
# Include Sub-Makefiles.
include $(PATH_SUB_CURRENT)/Loader/Makefile.kmk
# Globals
VBOX_PATH_WIN_ADD_INS_SRC := $(PATH_SUB_CURRENT)
## @todo VBOX_WIN_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/win
DLLS += VBCoInst
VBCoInst_TEMPLATE = VBOXGUESTR3DLL
ifdef VBOX_SIGN_ADDITIONS # (See the parent makefile.)
VBCoInst_NOINST = true
endif
VBCoInst_DEFS = _WIN32_WINNT=0x0400 WIN32_LEAN_AND_MEAN=1 UNICODE
VBCoInst_LDFLAGS = /subsystem:console,4.10
VBCoInst_SOURCES = \
PROGRAMS += VBoxDrvInst
VBoxDrvInst_TEMPLATE= VBOXGUESTR3EXE
VBoxDrvInst_DEFS = _WIN32_WINNT=0x0400 _UNICODE UNICODE
VBoxDrvInst_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
VBoxDrvInst_DEPS = $(VBOX_SVN_REV_KMK)
VBoxDrvInst_SDKS = WINPSDK W2K3DDK
VBoxDrvInst_LIBS = \
$(PATH_SDK_W2K3DDK_LIB)/setupapi.lib \
$(PATH_SDK_W2K3DDK_LIB)/newdev.lib
VBoxDrvInst_SOURCES = \
PROGRAMS += VBoxGuestDrvInst
VBoxGuestDrvInst_TEMPLATE= VBOXGUESTR3EXE
VBoxGuestDrvInst_DEFS = _WIN32_WINNT=0x0400 UNICODE
VBoxGuestDrvInst_SOURCES = \
PROGRAMS += RegCleanup
RegCleanup_TEMPLATE = VBOXGUESTR3EXE
RegCleanup_DEFS = _WIN32_WINNT=0x0400 UNICODE
RegCleanup_SOURCES = \
#
# The installer.
#
PACKING += $(PATH_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
OTHER_CLEAN += \
$(PATH_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe \
$(PATH_BIN)/additions/VBoxWHQLFake.exe
DRIVER_FILES := \
$(PATH_BIN)/additions/VBoxGuestDrvInst.exe \
$(PATH_BIN)/additions/RegCleanup.exe \
$(PATH_BIN)/additions/VBoxMouse.sys \
$(PATH_BIN)/additions/VBoxGuest.sys \
$(PATH_BIN)/additions/VBoxVideo.sys \
$(PATH_BIN)/additions/VBoxDisp.dll \
$(PATH_BIN)/additions/VBoxSF.sys \
$(PATH_BIN)/additions/VBoxMRXNP.dll \
$(PATH_BIN)/additions/VBoxTray.exe \
$(PATH_BIN)/additions/VBoxControl.exe \
$(PATH_BIN)/additions/VBoxWHQLFake.exe \
$(PATH_BIN)/additions/VBoxService.exe
ifeq ($(KBUILD_TARGET_ARCH),x86)
DRIVER_FILES += \
$(PATH_BIN)/additions/VBoxMouseNT.sys \
$(PATH_BIN)/additions/VBoxGuestNT.sys
endif
DRIVER_FILES += \
$(PATH_BIN)/additions/VBoxVideo.inf \
$(PATH_BIN)/additions/VBoxGuest.inf
ifdef VBOX_SIGN_ADDITIONS
DRIVER_FILES += \
$(PATH_BIN)/additions/VBoxVideo.cat \
$(PATH_BIN)/additions/VBoxGuest.cat
endif
ifdef VBOX_WITH_CROGL
DRIVER_FILES += \
$(PATH_BIN)/additions/VBoxOGLarrayspu.dll \
$(PATH_BIN)/additions/VBoxOGLcrutil.dll \
$(PATH_BIN)/additions/VBoxOGLerrorspu.dll \
$(PATH_BIN)/additions/VBoxOGLpackspu.dll \
$(PATH_BIN)/additions/VBoxOGLpassthroughspu.dll \
$(PATH_BIN)/additions/VBoxOGLfeedbackspu.dll \
$$(PATH_BIN)/additions/VBoxOGL.dll
ifeq ($(KBUILD_TARGET_ARCH),amd64)
# Also include 32-bit DLLs on 64-bit guests to enable
# running 32-bit OpenGL apps on that.
DRIVER_FILES += \
endif
endif
VB_WIN_ADD_NSIS_ENV := \
-E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
-E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \
-E 'VBOX_PATH_ADDITIONS_WIN_X86=$(subst /,\,$(VBOX_PATH_ADDITIONS.win.x86))' \
-E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
-E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
-E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
-E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
-E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
-E 'VBOX_VERSION_MAJOR=$(VBOX_VERSION_MAJOR)' \
-E 'VBOX_VERSION_MINOR=$(VBOX_VERSION_MINOR)' \
-E 'VBOX_VERSION_BUILD=$(VBOX_VERSION_BUILD)' \
-E 'VBOX_SVN_REV=$(VBOX_SVN_REV)' \
-E 'VBOX_WINDOWS_ADDITIONS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ADDITIONS_ICON_FILE))' \
-E 'VBOX_NSIS_ICON_FILE=$(subst /,\,$(VBOX_NSIS_ICON_FILE))' \
-E 'VBOX_WITH_CROGL=$(if $(VBOX_WITH_CROGL),1,0)' \
-E 'VBOX_BRAND_WIN_ADD_INST_DLGBMP=$(subst /,\,$(VBOX_BRAND_WIN_ADD_INST_DLGBMP))' \
-E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
$(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),-E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(VBOX_BRAND_$(lang)_LICENSE_RTF)') \
-E 'BUILD_TYPE=$(KBUILD_TYPE)' \
-E 'BUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)'
ifdef VBOX_SIGNING_MODE
#
# This is a hack to sign the uninstaller.
# See http://nsis.sourceforge.net/Signing_an_Uninstaller for more details.
#
OTHER_CLEAN += $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe
$(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe: \
$(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
$(DRIVER_FILES) \
$(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
$(VBOX_NSIS_ICON_FILE) \
$(VBOX_VERSION_STAMP)\
| $$(dir $$@)
$(call MSG_L1,Creating $@, from $<)
$(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
$(VB_WIN_ADD_NSIS_ENV) \
-- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
$(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
$(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
$(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
'/DUNINSTALLER_ONLY=1' \
'$(subst /,\,$<)'
OTHER_CLEAN += $(PATH_TARGET)/uninst.exe
$(PATH_TARGET)/uninst.exe: $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe | $$(dir $$@)
$(call MSG_L1,Creating $@, from $<)
$(QUIET)$(RM) -f $@
- $<
$(TEST) -f $@
$(call VBOX_SIGN_FILE_FN,$@)
endif
WHQLFAKE := $(PATH_SUB_CURRENT)/VBoxWHQLFake.au3
$(PATH_BIN)/additions/VBoxWHQLFake.exe:
$(call MSG_L1,Creating $@, from $<)
$(QUIET)$(EXEC_X86_WIN32) $(VBOX_PATH_AUTOIT3)/Aut2Exe/Aut2exe.exe \
/in $(WHQLFAKE) \
/out $(PATH_BIN)/additions/VBoxWHQLFake.exe \
/icon $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
/comp 4 \
/unicode
$(PATH_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
$(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
$(DRIVER_FILES) \
$(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
$(VBOX_NSIS_ICON_FILE) \
$(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
$(VBOX_VERSION_STAMP)
$(call MSG_L1,Creating $@, from $<)
$(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
$(VB_WIN_ADD_NSIS_ENV) \
-- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
$(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
$(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
$(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
$(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
'$(subst /,\,$<)'
$(call VBOX_SIGN_FILE_FN,$@)
include $(KBUILD_PATH)/subfooter.kmk