VirtualBox

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

Last change on this file was 98414, checked in by vboxsync, 16 months ago

HostDrivers/*.kmk: Automatic scm cleanups. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.3 KB
Line 
1# $Id: Makefile.kmk 98414 2023-02-01 16:23:38Z vboxsync $
2## @file
3# Sub-Makefile for the Windows USB drivers.
4#
5
6#
7# Copyright (C) 2006-2023 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)
117 VBoxUSBMon_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 = VBoxR3Exe
125TEMPLATE_VBoxUsbR3_SDKS = $(TEMPLATE_VBoxR3Exe_SDKS) ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBoxWinNewDevLib
126TEMPLATE_VBoxUsbR3_CXXFLAGS = $(TEMPLATE_VBoxR3Exe_CXXFLAGS) -Gz
127TEMPLATE_VBoxUsbR3_CFLAGS = $(TEMPLATE_VBoxR3Exe_CFLAGS) -Gz
128TEMPLATE_VBoxUsbR3_LIBS = $(TEMPLATE_VBoxR3Exe_LIBS) \
129 $(PATH_STAGE_LIB)/VBoxDrvCfgExe$(VBOX_SUFF_LIB) \
130 $(LIB_RUNTIME)
131
132#
133# USBInstall
134#
135USBInstall_TEMPLATE = VBoxUsbR3
136USBInstall_SOURCES = Install/USBInstall.cpp
137
138#
139# USBUninstall
140#
141USBUninstall_TEMPLATE = VBoxUsbR3
142USBUninstall_SOURCES = Install/USBUninstall.cpp
143
144#
145# USBTest
146#
147USBTest_TEMPLATE = VBoxUsbR3
148USBTest_DEFS = IN_USBLIB
149USBTest_SOURCES = \
150 testcase/USBTest.cpp \
151 ../USBFilter.cpp
152
153#
154# Install the INF files.
155#
156install-infs_TEMPLATE = VBoxR0DrvInfCat
157install-infs_SOURCES = \
158 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
159 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf
160install-infs_CLEAN = $(install-infs_SOURCES)
161install-infs_BLDDIRS = \
162 $(PATH_TARGET)/VBoxUSBCat.dir \
163 $(PATH_TARGET)/VBoxUSBMonCat.dir
164
165$(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf: $(PATH_SUB_CURRENT)/dev/VBoxUSB.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
166 $(call MSG_GENERATE,install-infs,$@,$<)
167 $(call VBOX_EDIT_INF_FN,$<,$@)
168
169$(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf: $(PATH_SUB_CURRENT)/mon/VBoxUSBMon.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
170 $(call MSG_GENERATE,install-infs,$@,$<)
171 $(call VBOX_EDIT_INF_FN,$<,$@)
172
173ifdef VBOX_SIGNING_MODE
174 install-infs_SOURCES += \
175 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat \
176 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat=>VBoxUSB-PreW10.cat \
177 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys \
178 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat \
179 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat=>VBoxUSBMon-PreW10.cat \
180 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
181
182 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys: $$(VBoxUSB_1_TARGET) | $$(dir $$@)
183 $(INSTALL) -m 644 $< $(@D)
184
185 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat: \
186 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
187 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys
188 $(call MSG_TOOL,Inf2Cat,VBoxUSB-inf,$@,$<)
189 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
190
191 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys: $$(VBoxUSBMon_1_TARGET) | $$(dir $$@)
192 $(INSTALL) -m 644 $< $(@D)
193
194 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat: \
195 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf \
196 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
197 $(call MSG_TOOL,Inf2Cat,VBoxUSBMon-inf,$@,$<)
198 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
199
200endif # signing
201
202# generate rules
203include $(FILE_KBUILD_SUB_FOOTER)
204
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use