VirtualBox

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

Last change on this file since 84533 was 84533, checked in by vboxsync, 5 years ago

s/VBOX_WITH_AUTOMATIC_DEFS_QUOTING/KMK_WITH_QUOTING/g - bugref:8489

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.4 KB
Line 
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
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 KMK_WITH_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 KMK_WITH_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# USBInstall
112#
113USBInstall_TEMPLATE = VBOXR3EXE
114USBInstall_DEFS = IN_RT_R3
115USBInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
116USBInstall_CXXFLAGS = -Gz
117USBInstall_CFLAGS = -Gz
118USBInstall_SOURCES = \
119 Install/USBInstall.cpp
120USBInstall_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#
130USBUninstall_TEMPLATE = VBOXR3EXE
131USBUninstall_DEFS = IN_RT_R3
132USBUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
133USBUninstall_CXXFLAGS = -Gz
134USBUninstall_CFLAGS = -Gz
135USBUninstall_SOURCES = \
136 Install/USBUninstall.cpp
137USBUninstall_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#
146USBTest_TEMPLATE = VBOXR3EXE
147USBTest_DEFS = IN_RT_R3 IN_USBLIB
148USBTest_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
149USBTest_CXXFLAGS = -Gz
150USBTest_CFLAGS = -Gz
151USBTest_SOURCES = \
152 testcase/USBTest.cpp \
153 ../USBFilter.cpp
154USBTest_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#
163install-infs_TEMPLATE = VBoxR0DrvInfCat
164install-infs_SOURCES = \
165 $(PATH_TARGET)/VBoxUSBCat.dir/VBoxUSB.inf \
166 $(PATH_TARGET)/VBoxUSBMonCat.dir/VBoxUSBMon.inf
167install-infs_CLEAN = $(install-infs_SOURCES)
168install-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
180ifdef VBOX_SIGNING_MODE
181install-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
207endif # signing
208
209# generate rules
210include $(FILE_KBUILD_SUB_FOOTER)
211
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