1 | # $Id: Makefile.kmk 99679 2023-05-08 16:44:51Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the device and driver samples.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009-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 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | #
|
---|
27 |
|
---|
28 | SUB_DEPTH = ../../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 |
|
---|
31 |
|
---|
32 | #
|
---|
33 | # VBoxSampleDevice - A sample device module.
|
---|
34 | #
|
---|
35 | DLLS += VBoxSampleDevice
|
---|
36 | VBoxSampleDevice_TEMPLATE = VBoxR3Dll
|
---|
37 | VBoxSampleDevice_SOURCES = \
|
---|
38 | VBoxSampleDevice.cpp
|
---|
39 | VBoxSampleDevice_LIBS = \
|
---|
40 | $(LIB_RUNTIME)
|
---|
41 |
|
---|
42 | #
|
---|
43 | # VBoxSampleDriver - A sample driver module.
|
---|
44 | #
|
---|
45 | DLLS += VBoxSampleDriver
|
---|
46 | VBoxSampleDriver_TEMPLATE = VBoxR3Dll
|
---|
47 | VBoxSampleDriver_SOURCES = \
|
---|
48 | DrvStorageFilter.cpp
|
---|
49 | VBoxSampleDriver_LIBS = \
|
---|
50 | $(LIB_RUNTIME)
|
---|
51 |
|
---|
52 |
|
---|
53 | #
|
---|
54 | # VBoxPlaygroundDevice - A device module demonstrating some unusual features.
|
---|
55 | #
|
---|
56 | ifdef VBOX_WITH_MAIN
|
---|
57 | DLLS += VBoxPlaygroundDevice
|
---|
58 | VBoxPlaygroundDevice_TEMPLATE = VBoxR3Dll
|
---|
59 | VBoxPlaygroundDevice_SOURCES = \
|
---|
60 | DevPlayground.cpp
|
---|
61 | VBoxPlaygroundDevice_LIBS = \
|
---|
62 | $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
|
---|
63 | $(LIB_RUNTIME)
|
---|
64 | endif
|
---|
65 |
|
---|
66 | ifdef VBOX_WITH_XPCOM
|
---|
67 | ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM.
|
---|
68 | VBoxPlaygroundDevice_DEFS += VBOX_WITH_XPCOM
|
---|
69 | ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
70 | VBoxPlaygroundDevice_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
71 | endif
|
---|
72 | VBoxPlaygroundDevice_INCS += \
|
---|
73 | $(VBOX_XPCOM_INCS)
|
---|
74 | VBoxPlaygroundDevice_INTERMEDIATES += \
|
---|
75 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
|
---|
76 | VBoxPlaygroundDevice_LIBS += \
|
---|
77 | $(LIB_XPCOM)
|
---|
78 | else # COM
|
---|
79 | VBoxPlaygroundDevice_INCS += \
|
---|
80 | $(VBOX_PATH_SDK)/bindings/mscom/include
|
---|
81 | VBoxPlaygroundDevice_INTERMEDIATES += \
|
---|
82 | $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
|
---|
83 | endif # COM
|
---|
84 |
|
---|
85 |
|
---|
86 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
87 |
|
---|
88 |
|
---|
89 | #
|
---|
90 | # Installs the filter.
|
---|
91 | #
|
---|
92 | install-filter:
|
---|
93 | $(if-expr "$(VBOX_MANAGE)" == "",$(error VBOX_MANAGE is not defined,))
|
---|
94 | $(if-expr "$(VBOX_VMNAME)" == "",$(error VBOX_VMNAME is not defined,))
|
---|
95 | # Make VBox load the driver
|
---|
96 | $(VBOX_MANAGE) setextradata "$(VBOX_VMNAME)" "VBoxInternal/PDM/Drivers/VBoxSampleDriver/Path" \
|
---|
97 | "$(if $(VBoxSampleDriver_1_INST_TARGET),$(VBoxSampleDriver_1_INST_TARGET),$(VBoxSampleDriver_1_TARGET))"
|
---|
98 | # Configure the matching.
|
---|
99 | $(VBOX_MANAGE) setextradata "$(VBOX_VMNAME)" "VBoxInternal/PDM/DriverTransformations/StorageFilter/AboveDriver" \
|
---|
100 | "VD"
|
---|
101 | # The config of the injected driver.
|
---|
102 | $(VBOX_MANAGE) setextradata "$(VBOX_VMNAME)" "VBoxInternal/PDM/DriverTransformations/StorageFilter/AttachedDriver/Driver" \
|
---|
103 | "StorageFilter"
|
---|
104 | $(VBOX_MANAGE) setextradata "$(VBOX_VMNAME)" "VBoxInternal/PDM/DriverTransformations/StorageFilter/AttachedDriver/Config/AsyncIOSupported" \
|
---|
105 | "1"
|
---|
106 |
|
---|
107 | uninstall-filter:
|
---|
108 | $(if-expr "$(VBOX_MANAGE)" == "",$(error VBOX_MANAGE is not defined,))
|
---|
109 | $(if-expr "$(VBOX_VMNAME)" == "",$(error VBOX_VMNAME is not defined,))
|
---|
110 | $(VBOX_MANAGE) showvminfo "$(VBOX_VMNAME)"
|
---|
111 | $(VBOX_MANAGE) setextradata "$(VBOX_VMNAME)" "VBoxInternal/PDM/Drivers/VBoxSampleDriver/Path"
|
---|
112 | $(VBOX_MANAGE) setextradata "$(VBOX_VMNAME)" "VBoxInternal/PDM/DriverTransformations/StorageFilter/AboveDriver"
|
---|
113 | $(VBOX_MANAGE) setextradata "$(VBOX_VMNAME)" "VBoxInternal/PDM/DriverTransformations/StorageFilter/AttachedDriver/Config/AsyncIOSupported"
|
---|
114 |
|
---|