1 | # $Id: Makefile.kmk 84533 2020-05-26 10:43:04Z 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 |
|
---|
27 | SUB_DEPTH = ../../../../..
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 | LIBRARIES.win += usbd
|
---|
31 | SYSMODS.win += VBoxUSB VBoxUSBMon
|
---|
32 | PROGRAMS.win += USBInstall USBUninstall USBTest
|
---|
33 | INSTALLS.win += install-infs
|
---|
34 |
|
---|
35 | #
|
---|
36 | # usbd
|
---|
37 | #
|
---|
38 | usbd_TEMPLATE = VBOXR0DRV
|
---|
39 | usbd_SOURCES = usbd/usbd.def
|
---|
40 |
|
---|
41 | #
|
---|
42 | # VBoxUSB
|
---|
43 | #
|
---|
44 | VBoxUSB_TEMPLATE = VBOXR0DRV
|
---|
45 | ifdef VBOX_SIGNING_MODE
|
---|
46 | VBoxUSB_INSTTYPE = none
|
---|
47 | VBoxUSB_DEBUG_INSTTYPE = both
|
---|
48 | endif
|
---|
49 | VBoxUSB_SDKS = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS
|
---|
50 | ifdef KMK_WITH_QUOTING
|
---|
51 | VBoxUSB_DEFS := IN_RT_R0 IN_SUP_R0 VBOX_DBG_LOG_NAME="USBDev"
|
---|
52 | else
|
---|
53 | VBoxUSB_DEFS := IN_RT_R0 IN_SUP_R0 VBOX_DBG_LOG_NAME=\"USBDev\"
|
---|
54 | endif
|
---|
55 | VBoxUSB_LDFLAGS.x86 = -Entry:DriverEntry@8
|
---|
56 | VBoxUSB_LDFLAGS.amd64 = -Entry:DriverEntry
|
---|
57 | VBoxUSB_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
|
---|
65 | VBoxUSB_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 | #
|
---|
74 | VBoxUSBMon_TEMPLATE = VBOXR0DRV
|
---|
75 | ifdef VBOX_SIGNING_MODE
|
---|
76 | VBoxUSBMon_INSTTYPE = none
|
---|
77 | VBoxUSBMon_DEBUG_INSTTYPE = both
|
---|
78 | endif
|
---|
79 | VBoxUSBMon_INCS := $(PATH_SUB_CURRENT)/..
|
---|
80 | VBoxUSBMon_SDKS = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS
|
---|
81 | VBoxUSBMon_DEFS = IN_RT_R0 IN_SUP_R0 NTDDI_WINNT=_NTDDI_VISTA VBOXUSBFILTERMGR_USB_SPINLOCK
|
---|
82 | ifdef KMK_WITH_QUOTING
|
---|
83 | VBoxUSBMon_DEFS += VBOX_DBG_LOG_NAME="USBMon"
|
---|
84 | else
|
---|
85 | VBoxUSBMon_DEFS += VBOX_DBG_LOG_NAME=\"USBMon\"
|
---|
86 | endif
|
---|
87 | VBoxUSBMon_LDFLAGS.x86 = -Entry:DriverEntry@8
|
---|
88 | VBoxUSBMon_LDFLAGS.amd64 = -Entry:DriverEntry
|
---|
89 | ifdef VBOX_USBMON_WITH_FILTER_AUTOAPPLY
|
---|
90 | VBoxUSBMon_DEFS += VBOX_USBMON_WITH_FILTER_AUTOAPPLY
|
---|
91 | endif
|
---|
92 | VBoxUSBMon_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
|
---|
101 | VBoxUSBMon_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)
|
---|
106 | if1of ($(KBUILD_TYPE), debug)
|
---|
107 | VBoxUSBMon_DEFS += LOG_ENABLED VBOX_USB_WITH_VERBOSE_LOGGING
|
---|
108 | endif
|
---|
109 |
|
---|
110 | #
|
---|
111 | # USBInstall
|
---|
112 | #
|
---|
113 | USBInstall_TEMPLATE = VBOXR3EXE
|
---|
114 | USBInstall_DEFS = IN_RT_R3
|
---|
115 | USBInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
|
---|
116 | USBInstall_CXXFLAGS = -Gz
|
---|
117 | USBInstall_CFLAGS = -Gz
|
---|
118 | USBInstall_SOURCES = \
|
---|
119 | Install/USBInstall.cpp
|
---|
120 | USBInstall_LIBS = \
|
---|
121 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
|
---|
122 | $(LIB_RUNTIME) \
|
---|
123 | $(PATH_STAGE_LIB)/SUPR3$(VBOX_SUFF_LIB) \
|
---|
124 | $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB)
|
---|
125 |
|
---|
126 |
|
---|
127 | #
|
---|
128 | # USBUninstall
|
---|
129 | #
|
---|
130 | USBUninstall_TEMPLATE = VBOXR3EXE
|
---|
131 | USBUninstall_DEFS = IN_RT_R3
|
---|
132 | USBUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
|
---|
133 | USBUninstall_CXXFLAGS = -Gz
|
---|
134 | USBUninstall_CFLAGS = -Gz
|
---|
135 | USBUninstall_SOURCES = \
|
---|
136 | Install/USBUninstall.cpp
|
---|
137 | USBUninstall_LIBS = \
|
---|
138 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
|
---|
139 | $(LIB_RUNTIME) \
|
---|
140 | $(PATH_STAGE_LIB)/SUPR3$(VBOX_SUFF_LIB) \
|
---|
141 | $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB)
|
---|
142 |
|
---|
143 | #
|
---|
144 | # USBTest
|
---|
145 | #
|
---|
146 | USBTest_TEMPLATE = VBOXR3EXE
|
---|
147 | USBTest_DEFS = IN_RT_R3 IN_USBLIB
|
---|
148 | USBTest_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
|
---|
149 | USBTest_CXXFLAGS = -Gz
|
---|
150 | USBTest_CFLAGS = -Gz
|
---|
151 | USBTest_SOURCES = \
|
---|
152 | testcase/USBTest.cpp \
|
---|
153 | ../USBFilter.cpp
|
---|
154 | USBTest_LIBS = \
|
---|
155 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
|
---|
156 | $(LIB_RUNTIME) \
|
---|
157 | $(PATH_STAGE_LIB)/SUPR3$(VBOX_SUFF_LIB) \
|
---|
158 | $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB)
|
---|
159 |
|
---|
160 | #
|
---|
161 | # Install the INF files.
|
---|
162 | #
|
---|
163 | install-infs_TEMPLATE = VBoxR0DrvInfCat
|
---|
164 | install-infs_SOURCES = \
|
---|
165 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
|
---|
166 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf
|
---|
167 | install-infs_CLEAN = $(install-infs_SOURCES)
|
---|
168 | install-infs_BLDDIRS = \
|
---|
169 | $(PATH_TARGET)/VBoxUSBCat.dir \
|
---|
170 | $(PATH_TARGET)/VBoxUSBMonCat.dir
|
---|
171 |
|
---|
172 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf: $(PATH_SUB_CURRENT)/dev/VBoxUSB.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
173 | $(call MSG_GENERATE,install-infs,$@,$<)
|
---|
174 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
175 |
|
---|
176 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf: $(PATH_SUB_CURRENT)/mon/VBoxUSBMon.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
177 | $(call MSG_GENERATE,install-infs,$@,$<)
|
---|
178 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
179 |
|
---|
180 | ifdef VBOX_SIGNING_MODE
|
---|
181 | install-infs_SOURCES += \
|
---|
182 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat \
|
---|
183 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat=>VBoxUSB-PreW10.cat \
|
---|
184 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys \
|
---|
185 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat \
|
---|
186 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat=>VBoxUSBMon-PreW10.cat \
|
---|
187 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
|
---|
188 |
|
---|
189 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys: $$(VBoxUSB_1_TARGET) | $$(dir $$@)
|
---|
190 | $(INSTALL) -m 644 $< $(@D)
|
---|
191 |
|
---|
192 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.cat: \
|
---|
193 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
|
---|
194 | $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.sys
|
---|
195 | $(call MSG_TOOL,Inf2Cat,VBoxUSB-inf,$@,$<)
|
---|
196 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
197 |
|
---|
198 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys: $$(VBoxUSBMon_1_TARGET) | $$(dir $$@)
|
---|
199 | $(INSTALL) -m 644 $< $(@D)
|
---|
200 |
|
---|
201 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.cat: \
|
---|
202 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf \
|
---|
203 | $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.sys
|
---|
204 | $(call MSG_TOOL,Inf2Cat,VBoxUSBMon-inf,$@,$<)
|
---|
205 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
206 |
|
---|
207 | endif # signing
|
---|
208 |
|
---|
209 | # generate rules
|
---|
210 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
211 |
|
---|