Makefile.kmk revision 23eb2c553a4eede4f244e510a7a8c64c79596195
# $Id$
## @file
# Sub-Makefile for the Windows USB drivers.
#
#
# 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
LIBRARIES.win += usbd
SYSMODS.win += VBoxUSB VBoxUSBMon
PROGRAMS.win += USBInstall USBUninstall USBTest
INSTALLS.win += install-infs
#
# usbd
#
usbd_TEMPLATE = VBOXR0DRV
usbd_SOURCES = usbd/usbd.def
#
# VBoxUSB
#
VBoxUSB_TEMPLATE = VBOXR0DRV
ifdef VBOX_SIGNING_MODE
VBoxUSB_NOINST = true
endif
VBoxUSB_SDKS = W2K3DDK WINPSDKINCS
VBoxUSB_DEFS = IN_RT_R0 IN_SUP_R0
VBoxUSB_LDFLAGS.x86 = -Entry:DriverEntry@8
VBoxUSB_LDFLAGS.amd64 = -Entry:DriverEntry
VBoxUSB_SOURCES = \
VBoxUSB_LIBS = \
$(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
$(PATH_SDK_W2K3DDK_LIB)/hal.lib \
$(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
$(TARGET_usbd)
#
# VBoxUSBFlt
#
VBoxUSBFlt_TEMPLATE = VBOXR0DRV
VBoxUSBFlt_SDKS = W2K3DDK WINPSDKINCS
VBoxUSBFlt_DEFS = IN_SUP_R0 i386=1 STD_CALL CONDITION_HANDLING=1 NT_INST=0 \
WIN32=100 _NT1X_=100 WINNT=1 _WIN32_WINNT=0x0501 WINVER=0x0501 _WIN32_IE=0x0600 WIN32_LEAN_AND_MEAN=1
VBoxUSBFlt_LDFLAGS.x86 = -Entry:DriverEntry@8
VBoxUSBFlt_LDFLAGS.amd64 = -Entry:DriverEntry
VBoxUSBFlt_SOURCES = \
VBoxUSBFlt_LIBS = \
$(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
$(PATH_SDK_W2K3DDK_LIB)/hal.lib \
$(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
$(TARGET_usbd)
#
# VBoxUSBMon
#
VBoxUSBMon_TEMPLATE = VBOXR0DRV
ifdef VBOX_SIGNING_MODE
VBoxUSBMon_NOINST = true
endif
VBoxUSBMon_INCS := $(PATH_SUB_CURRENT)/..
VBoxUSBMon_SDKS = W2K3DDK WINPSDKINCS
VBoxUSBMon_DEFS = IN_RT_R0 IN_SUP_R0 i386=1 STD_CALL CONDITION_HANDLING=1 NT_INST=0 \
WIN32=100 _NT1X_=100 WINNT=1 _WIN32_WINNT=0x0501 WINVER=0x0501 _WIN32_IE=0x0600 WIN32_LEAN_AND_MEAN=1 \
VBOXUSBFILTERMGR_USB_SPINLOCK
VBoxUSBMon_LDFLAGS.x86 = -Entry:DriverEntry@8
VBoxUSBMon_LDFLAGS.amd64 = -Entry:DriverEntry
VBoxUSBMon_SOURCES = \
../USBFilter.cpp \
../VBoxUSBFilterMgr.cpp \
VBoxUSBMon_LIBS = \
$(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
$(PATH_SDK_W2K3DDK_LIB)/hal.lib \
$(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
$(TARGET_usbd)
#
# USBInstall
#
USBInstall_TEMPLATE = VBOXR3EXE
USBInstall_DEFS = IN_RT_R3
USBInstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
USBInstall_CXXFLAGS = -Gz
USBInstall_CFLAGS = -Gz
USBInstall_SOURCES = \
USBInstall_LIBS = \
$(PATH_SDK_W2K3DDK_LIB)/newdev.lib \
$(LIB_RUNTIME) \
$(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB)
#
# USBUninstall
#
USBUninstall_TEMPLATE = VBOXR3EXE
USBUninstall_DEFS = IN_RT_R3
USBUninstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
USBUninstall_CXXFLAGS = -Gz
USBUninstall_CFLAGS = -Gz
USBUninstall_SOURCES = \
USBUninstall_LIBS = \
$(PATH_SDK_W2K3DDK_LIB)/newdev.lib \
$(LIB_RUNTIME) \
$(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB)
#
# USBTest
#
USBTest_TEMPLATE = VBOXR3EXE
USBTest_DEFS = IN_RT_R3
USBTest_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
USBTest_CXXFLAGS = -Gz
USBTest_CFLAGS = -Gz
USBTest_SOURCES = \
USBTest_LIBS = \
$(PATH_SDK_W2K3DDK_LIB)/newdev.lib \
$(LIB_RUNTIME) \
$(PATH_LIB)/SUPR3$(VBOX_SUFF_LIB)
#
# Install the INF files.
#
install-infs_INST = bin/
install-infs_MODE = a+r,u+w
install-infs_SOURCES = \
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf
install-infs_CLEAN = $(install-infs_SOURCES)
install-infs_BLDDIRS = \
$(PATH_TARGET)/VBoxUSBCat.dir \
$(PATH_TARGET)/VBoxUSBMonCat.dir
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf: $(PATH_SUB_CURRENT)/Device/VBoxUSB.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
$(call MSG_GENERATE,install-infs,$@,$<)
$(call VBOX_EDIT_INF_FN,$<,$@)
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf: $(PATH_SUB_CURRENT)/Monitor/VBoxUSBMon.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
$(call MSG_GENERATE,install-infs,$@,$<)
$(call VBOX_EDIT_INF_FN,$<,$@)
$(PATH_TARGET)/VBoxUSBFltCat.dir/VBoxUSBFlt.inf: $(PATH_SUB_CURRENT)/Filter/VBoxUSBFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
$(call MSG_GENERATE,install-infs,$@,$<)
$(call VBOX_EDIT_INF_FN,$<,$@)
ifdef VBOX_SIGNING_MODE
install-infs_SOURCES += \
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat \
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys \
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat \
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys: $$(TARGET_VBoxUSB) | $$(dir $$@)
$(INSTALL) -m 644 $< $(@D)
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat: \
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys
$(call MSG_TOOL,Inf2Cat,VBoxUSB-inf,$@,$<)
$(call VBOX_MAKE_CAT_FN, $(@D),$@)
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys: $$(TARGET_VBoxUSBMon) | $$(dir $$@)
$(INSTALL) -m 644 $< $(@D)
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat: \
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf \
$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
$(call MSG_TOOL,Inf2Cat,VBoxUSBMon-inf,$@,$<)
$(call VBOX_MAKE_CAT_FN, $(@D),$@)
endif # signing
# generate rules
include $(KBUILD_PATH)/subfooter.kmk