VirtualBox

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

Last change on this file since 96407 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

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