1 | # $Id: Makefile.kmk 98439 2023-02-02 12:47:31Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the storage device & driver testcases.
|
---|
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 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | #
|
---|
27 |
|
---|
28 | SUB_DEPTH = ../../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 |
|
---|
31 | #
|
---|
32 | # Basic testcases for the VD code.
|
---|
33 | #
|
---|
34 | ifdef VBOX_WITH_TESTCASES
|
---|
35 | PROGRAMS += tstVD tstVD-2 tstVDSnap tstVDFill
|
---|
36 |
|
---|
37 | tstVD_TEMPLATE = VBoxR3TstExe
|
---|
38 | tstVD_SOURCES = tstVD.cpp
|
---|
39 | tstVD_LIBS = $(LIB_DDU)
|
---|
40 |
|
---|
41 | tstVD-2_TEMPLATE = VBoxR3TstExe
|
---|
42 | tstVD-2_SOURCES = tstVD-2.cpp
|
---|
43 | tstVD-2_LIBS = $(LIB_DDU)
|
---|
44 |
|
---|
45 | tstVDFill_TEMPLATE = VBoxR3TstExe
|
---|
46 | tstVDFill_SOURCES = tstVDFill.cpp
|
---|
47 | tstVDFill_LIBS = $(LIB_DDU)
|
---|
48 |
|
---|
49 | PROGRAMS += tstVDIo
|
---|
50 |
|
---|
51 | #
|
---|
52 | # VD I/O test scripts to built in -> .cpp
|
---|
53 | #
|
---|
54 | TSTVDIO_BUILTIN_TESTS_FILE = $(tstVDIo_0_OUTDIR)/BuiltinTests.cpp
|
---|
55 | TSTVDIO_BUILTIN_TESTS := \
|
---|
56 | tstVDIo=tstVDIo.vd \
|
---|
57 | tstVDResize=tstVDResize.vd \
|
---|
58 | tstVDCompact=tstVDCompact.vd \
|
---|
59 | tstVDCopy=tstVDCopy.vd \
|
---|
60 | tstVDDiscard=tstVDDiscard.vd \
|
---|
61 | tstVDShareable=tstVDShareable.vd
|
---|
62 | TSTVDIO_BUILTIN_TEST_NAMES := $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(firstword $(subst =,$(SPACE) ,$(test))))
|
---|
63 | TSTVDIO_PATH_TESTS := $(PATH_SUB_CURRENT)
|
---|
64 |
|
---|
65 | # 1=name, 2=filter
|
---|
66 | TSTVDIO_GEN_TEST_MACRO = 'TSTVDIOTESTENTRY const g_a$(1)[] =' '{' \
|
---|
67 | $(foreach testnm,$(filter $(2),$(TSTVDIO_BUILTIN_TEST_NAMES)), ' TSTVDIOTESTENTRY_GEN($(testnm), g_ab$(testnm)),') \
|
---|
68 | '};' 'unsigned const g_c$(1) = RT_ELEMENTS(g_a$(1));' '' ''
|
---|
69 |
|
---|
70 | $$(TSTVDIO_BUILTIN_TESTS_FILE): $(MAKEFILE_CURRENT) \
|
---|
71 | $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SPACE) ,$(test)))) \
|
---|
72 | $(VBOX_BIN2C) \
|
---|
73 | | $$(dir $$@)
|
---|
74 | $(QUIET)$(RM) -f -- $@ $@.vd
|
---|
75 | $(QUIET)$(APPEND) -n "$@" \
|
---|
76 | '' \
|
---|
77 | '#include "BuiltinTests.h"' \
|
---|
78 | ''
|
---|
79 | $(foreach test,$(TSTVDIO_BUILTIN_TESTS), $(NLTAB)$(VBOX_BIN2C) -ascii --append --no-size \
|
---|
80 | "$(firstword $(subst =,$(SP) ,$(test)))" \
|
---|
81 | "$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SP) ,$(test)))" \
|
---|
82 | "$@")
|
---|
83 |
|
---|
84 | # Generate test lists.
|
---|
85 | $(QUIET)$(APPEND) -n "$@" '' \
|
---|
86 | $(call TSTVDIO_GEN_TEST_MACRO,VDIoTests,%) \
|
---|
87 |
|
---|
88 | tstVDIo_TEMPLATE = VBoxR3TstExe
|
---|
89 | tstVDIo_INCS := $(PATH_SUB_CURRENT)
|
---|
90 |
|
---|
91 | ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
|
---|
92 | tstVDIo_DEFS += VBOX_TSTVDIO_WITH_LOG_REPLAY
|
---|
93 | endif
|
---|
94 |
|
---|
95 | tstVDIo_SOURCES = \
|
---|
96 | tstVDIo.cpp \
|
---|
97 | VDIoBackend.cpp \
|
---|
98 | VDIoBackendMem.cpp \
|
---|
99 | VDMemDisk.cpp \
|
---|
100 | VDIoRnd.cpp \
|
---|
101 | VDScript.cpp \
|
---|
102 | VDScriptAst.cpp \
|
---|
103 | VDScriptChecker.cpp \
|
---|
104 | VDScriptInterp.cpp \
|
---|
105 | $(TSTVDIO_BUILTIN_TESTS_FILE)
|
---|
106 | tstVDIo_LIBS = \
|
---|
107 | $(LIB_DDU)
|
---|
108 | tstVDIo_CLEAN = \
|
---|
109 | $(TSTVDIO_BUILTIN_TESTS_FILE)
|
---|
110 | tstVDSnap_TEMPLATE = VBoxR3TstExe
|
---|
111 | tstVDSnap_LIBS = $(LIB_DDU)
|
---|
112 | tstVDSnap_SOURCES = tstVDSnap.cpp
|
---|
113 | endif
|
---|
114 |
|
---|
115 | if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
|
---|
116 | PROGRAMS += vbox-img
|
---|
117 |
|
---|
118 | #
|
---|
119 | # vbox-img - static because it might be used as a standalone tool.
|
---|
120 | #
|
---|
121 | ifneq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),solaris.sparc32 solaris.sparc64)
|
---|
122 | vbox-img_TEMPLATE := VBoxR3Exe
|
---|
123 | vbox-img_DEFS := IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
|
---|
124 | else
|
---|
125 | vbox-img_TEMPLATE := VBoxR3Static
|
---|
126 | vbox-img_DEFS := IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
|
---|
127 | endif
|
---|
128 | vbox-img_INCS := \
|
---|
129 | ../../Main/include
|
---|
130 | vbox-img_SOURCES := \
|
---|
131 | vbox-img.cpp \
|
---|
132 | ../VD.cpp \
|
---|
133 | ../VDPlugin.cpp \
|
---|
134 | ../VDVfs.cpp \
|
---|
135 | ../VDI.cpp \
|
---|
136 | ../VMDK.cpp \
|
---|
137 | ../VHD.cpp \
|
---|
138 | ../DMG.cpp \
|
---|
139 | ../Parallels.cpp \
|
---|
140 | ../ISCSI.cpp \
|
---|
141 | ../RAW.cpp \
|
---|
142 | ../QED.cpp \
|
---|
143 | ../QCOW.cpp \
|
---|
144 | ../VHDX.cpp \
|
---|
145 | ../CUE.cpp \
|
---|
146 | ../VISO.cpp \
|
---|
147 | ../VCICache.cpp \
|
---|
148 | ../VDIfVfs.cpp
|
---|
149 | vbox-img_SOURCES.win = \
|
---|
150 | vbox-img.rc
|
---|
151 | ifeq ($(vbox-img_TEMPLATE),VBoxR3Exe)
|
---|
152 | vbox-img_LIBS = \
|
---|
153 | $(LIB_RUNTIME)
|
---|
154 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
155 | vbox-img_LIBS += geom bsdxml sbuf
|
---|
156 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
157 | vbox-img_LIBS += kstat efi
|
---|
158 | endif
|
---|
159 |
|
---|
160 | else
|
---|
161 | vbox-img_LIBS = \
|
---|
162 | $(VBOX_LIB_RUNTIME_STATIC)
|
---|
163 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
164 | vbox-img_LIBS += \
|
---|
165 | $(SDK_VBoxLzf_STATIC_LIBS) \
|
---|
166 | $(SDK_VBoxZlibStatic_LIBS)
|
---|
167 | else
|
---|
168 | vbox-img_LIBS += \
|
---|
169 | $(SDK_VBoxLzf_LIBS) \
|
---|
170 | $(SDK_VBoxZlib_LIBS)
|
---|
171 | endif
|
---|
172 | ifeq ($(KBUILD_TARGET),linux)
|
---|
173 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
174 | vbox-img_LIBS += xml2
|
---|
175 | endif
|
---|
176 | else ifeq ($(KBUILD_TARGET),freebsd)
|
---|
177 | vbox-img_LIBS += iconv geom bsdxml sbuf
|
---|
178 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
179 | vbox-img_LIBS += xml2 lzma
|
---|
180 | endif
|
---|
181 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
182 | vbox-img_LIBS += iconv
|
---|
183 | else ifeq ($(KBUILD_TARGET),win)
|
---|
184 | vbox-img_SDKS.win = VBoxNtDll
|
---|
185 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
186 | vbox-img_LIBS += kstat efi
|
---|
187 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
188 | vbox-img_LIBS += xml2
|
---|
189 | endif
|
---|
190 | endif
|
---|
191 | endif
|
---|
192 |
|
---|
193 | endif
|
---|
194 |
|
---|
195 | if defined(VBOX_WITH_TESTCASES) && defined(VBOX_WITH_PLUGIN_CRYPT) \
|
---|
196 | && defined(VBOX_WITH_EXTPACK_PUEL) && defined(VBOX_WITH_EXTPACK_PUEL_BUILD) \
|
---|
197 | && defined(VBOX_WITH_VDKEYSTOREMGR)
|
---|
198 | PROGRAMS += vdkeystoremgr
|
---|
199 |
|
---|
200 | #
|
---|
201 | # vdkeystoremgr - static because it might be used as a standalone tool.
|
---|
202 | #
|
---|
203 | vdkeystoremgr_TEMPLATE = VBoxR3Static
|
---|
204 | vdkeystoremgr_DEFS += IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
|
---|
205 | vdkeystoremgr_SOURCES = \
|
---|
206 | vdkeystoremgr.cpp \
|
---|
207 | ../VDKeyStore.cpp
|
---|
208 | vdkeystoremgr_SOURCES.win = \
|
---|
209 | vdkeystoremgr_SOURCES.rc
|
---|
210 | vdkeystoremgr_LIBS = \
|
---|
211 | $(VBOX_LIB_RUNTIME_STATIC) \
|
---|
212 | $(PATH_STAGE_LIB)/SUPR3$(VBOX_SUFF_LIB)
|
---|
213 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
214 | vdkeystoremgr_LIBS += \
|
---|
215 | $(SDK_VBoxLzf_STATIC_LIBS) \
|
---|
216 | $(SDK_VBoxZlibStatic_LIBS)
|
---|
217 | else
|
---|
218 | vdkeystoremgr_LIBS += \
|
---|
219 | $(SDK_VBoxLzf_LIBS) \
|
---|
220 | $(SDK_VBoxZlib_LIBS)
|
---|
221 | endif
|
---|
222 | ifeq ($(KBUILD_TARGET),linux)
|
---|
223 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
224 | vdkeystoremgr_LIBS += xml2
|
---|
225 | endif
|
---|
226 | else if1of ($(KBUILD_TARGET), darwin freebsd)
|
---|
227 | vdkeystoremgr_LIBS += iconv
|
---|
228 | else ifeq ($(KBUILD_TARGET),win)
|
---|
229 | vdkeystoremgr_SDKS.win = VBoxNtDll
|
---|
230 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
231 | vdkeystoremgr_LIBS += kstat
|
---|
232 | endif
|
---|
233 | endif
|
---|
234 |
|
---|
235 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
236 |
|
---|