VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/VBoxUSB/win/Makefile.kmk@ 92968

Last change on this file since 92968 was 92968, checked in by vboxsync, 3 years ago

VBoxUSB/win/Makefile.kmk: Use a template for the USB* programs, switching them to VBoxR3Static and applying VBOX_WIN_NEWDEV. bugref:10116

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.9 KB
Line 
1# $Id: Makefile.kmk 92968 2021-12-16 10:03:45Z vboxsync $
2## @file
3# Sub-Makefile for the Windows USB drivers.
4#
5
6#
7# Copyright (C) 2006-2020 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27SUB_DEPTH = ../../../../..
28include $(KBUILD_PATH)/subheader.kmk
29
30LIBRARIES.win += usbd
31SYSMODS.win += VBoxUSB VBoxUSBMon
32PROGRAMS.win += USBInstall USBUninstall USBTest
33INSTALLS.win += install-infs
34
35#
36# usbd
37#
38usbd_TEMPLATE = VBOXR0DRV
39usbd_SOURCES = usbd/usbd.def
40
41#
42# VBoxUSB
43#
44VBoxUSB_TEMPLATE = VBOXR0DRV
45ifdef VBOX_SIGNING_MODE
46 VBoxUSB_INSTTYPE = none
47 VBoxUSB_DEBUG_INSTTYPE = both
48endif
49VBoxUSB_SDKS = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK_INCS)
50ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
51 VBoxUSB_DEFS := IN_RT_R0 IN_SUP_R0 VBOX_DBG_LOG_NAME="USBDev"
52else
53 VBoxUSB_DEFS := IN_RT_R0 IN_SUP_R0 VBOX_DBG_LOG_NAME=\"USBDev\"
54endif
55VBoxUSB_LDFLAGS.x86 = -Entry:DriverEntry@8
56VBoxUSB_LDFLAGS.amd64 = -Entry:DriverEntry
57VBoxUSB_SOURCES = \
58 dev/VBoxUsbDev.cpp \
59 dev/VBoxUsbRt.cpp \
60 dev/VBoxUsbPnP.cpp \
61 dev/VBoxUsbPwr.cpp \
62 cmn/VBoxUsbTool.cpp \
63 cmn/VBoxDrvTool.cpp \
64 dev/VBoxUsbDev.rc
65VBoxUSB_LIBS = \
66 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
67 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
68 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
69 $(usbd_1_TARGET)
70
71#
72# VBoxUSBMon
73#
74VBoxUSBMon_TEMPLATE = VBOXR0DRV
75ifdef VBOX_SIGNING_MODE
76 VBoxUSBMon_INSTTYPE = none
77 VBoxUSBMon_DEBUG_INSTTYPE = both
78endif
79VBoxUSBMon_INCS := $(PATH_SUB_CURRENT)/..
80VBoxUSBMon_SDKS = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK_INCS)
81VBoxUSBMon_DEFS = IN_RT_R0 IN_SUP_R0 NTDDI_WINNT=_NTDDI_VISTA VBOXUSBFILTERMGR_USB_SPINLOCK
82ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
83 VBoxUSBMon_DEFS += VBOX_DBG_LOG_NAME="USBMon"
84else
85 VBoxUSBMon_DEFS += VBOX_DBG_LOG_NAME=\"USBMon\"
86endif
87VBoxUSBMon_LDFLAGS.x86 = -Entry:DriverEntry@8
88VBoxUSBMon_LDFLAGS.amd64 = -Entry:DriverEntry
89ifdef VBOX_USBMON_WITH_FILTER_AUTOAPPLY
90 VBoxUSBMon_DEFS += VBOX_USBMON_WITH_FILTER_AUTOAPPLY
91endif
92VBoxUSBMon_SOURCES = \
93 mon/VBoxUsbMon.cpp \
94 mon/VBoxUsbFlt.cpp \
95 mon/VBoxUsbHook.cpp \
96 cmn/VBoxUsbTool.cpp \
97 cmn/VBoxDrvTool.cpp \
98 ../USBFilter.cpp \
99 ../VBoxUSBFilterMgr.cpp \
100 mon/VBoxUsbMon.rc
101VBoxUSBMon_LIBS = \
102 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
103 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
104 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
105 $(usbd_1_TARGET)
106if1of ($(KBUILD_TYPE), debug)
107VBoxUSBMon_DEFS += LOG_ENABLED VBOX_USB_WITH_VERBOSE_LOGGING
108endif
109
110#
111# Template for USBInstalls and friends.
112#
113TEMPLATE_VBoxUsbR3 = Template for USBInstalls, USBUninstall and USBTest
114TEMPLATE_VBoxUsbR3_EXTENDS = VBoxR3Static
115TEMPLATE_VBoxUsbR3_SDKS = $(TEMPLATE_VBoxR3Static_SDKS) ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_WIN_NEWDEV
116TEMPLATE_VBoxUsbR3_CXXFLAGS = $(TEMPLATE_VBoxR3Static_CXXFLAGS) -Gz
117TEMPLATE_VBoxUsbR3_CFLAGS = $(TEMPLATE_VBoxR3Static_CFLAGS) -Gz
118TEMPLATE_VBoxUsbR3_LIBS = $(TEMPLATE_VBoxR3Static_LIBS) \
119 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB)
120
121#
122# USBInstall
123#
124USBInstall_TEMPLATE = VBoxUsbR3
125USBInstall_SOURCES = Install/USBInstall.cpp
126
127#
128# USBUninstall
129#
130USBUninstall_TEMPLATE = VBoxUsbR3
131USBUninstall_SOURCES = Install/USBUninstall.cpp
132
133#
134# USBTest
135#
136USBTest_TEMPLATE = VBoxUsbR3
137USBTest_DEFS = IN_USBLIB
138USBTest_SOURCES = \
139 testcase/USBTest.cpp \
140 ../USBFilter.cpp
141
142#
143# Install the INF files.
144#
145install-infs_TEMPLATE = VBoxR0DrvInfCat
146install-infs_SOURCES = \
147 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
148 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf
149install-infs_CLEAN = $(install-infs_SOURCES)
150install-infs_BLDDIRS = \
151 $(PATH_TARGET)/VBoxUSBCat.dir \
152 $(PATH_TARGET)/VBoxUSBMonCat.dir
153
154$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf: $(PATH_SUB_CURRENT)/dev/VBoxUSB.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
155 $(call MSG_GENERATE,install-infs,$@,$<)
156 $(call VBOX_EDIT_INF_FN,$<,$@)
157
158$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf: $(PATH_SUB_CURRENT)/mon/VBoxUSBMon.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
159 $(call MSG_GENERATE,install-infs,$@,$<)
160 $(call VBOX_EDIT_INF_FN,$<,$@)
161
162ifdef VBOX_SIGNING_MODE
163install-infs_SOURCES += \
164 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat \
165 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat=>VBoxUSB-PreW10.cat \
166 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys \
167 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat \
168 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat=>VBoxUSBMon-PreW10.cat \
169 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
170
171$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys: $$(VBoxUSB_1_TARGET) | $$(dir $$@)
172 $(INSTALL) -m 644 $< $(@D)
173
174$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat: \
175 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
176 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys
177 $(call MSG_TOOL,Inf2Cat,VBoxUSB-inf,$@,$<)
178 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
179
180$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys: $$(VBoxUSBMon_1_TARGET) | $$(dir $$@)
181 $(INSTALL) -m 644 $< $(@D)
182
183$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat: \
184 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf \
185 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
186 $(call MSG_TOOL,Inf2Cat,VBoxUSBMon-inf,$@,$<)
187 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
188
189endif # signing
190
191# generate rules
192include $(FILE_KBUILD_SUB_FOOTER)
193
Note: See TracBrowser for help on using the repository browser.

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