1 | # $Id: Makefile.kmk 106688 2024-10-25 11:09:46Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the storage device & driver testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2024 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 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
162 | vbox-img_SDKS := VBoxZlibStatic VBoxLzfStatic
|
---|
163 | else
|
---|
164 | vbox-img_SDKS := VBoxZlib VBoxLzf
|
---|
165 | endif
|
---|
166 | vbox-img_SDKS.win := VBoxNtDll
|
---|
167 | vbox-img_LIBS = \
|
---|
168 | $(VBOX_LIB_RUNTIME_STATIC)
|
---|
169 | ifeq ($(KBUILD_TARGET),linux)
|
---|
170 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
171 | vbox-img_LIBS += xml2
|
---|
172 | endif
|
---|
173 | else ifeq ($(KBUILD_TARGET),freebsd)
|
---|
174 | vbox-img_LIBS += iconv geom bsdxml sbuf
|
---|
175 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
176 | vbox-img_LIBS += xml2 lzma
|
---|
177 | endif
|
---|
178 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
179 | vbox-img_LIBS += iconv
|
---|
180 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
181 | vbox-img_LIBS += kstat efi
|
---|
182 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
183 | vbox-img_LIBS += xml2
|
---|
184 | endif
|
---|
185 | endif
|
---|
186 | endif
|
---|
187 |
|
---|
188 | endif
|
---|
189 |
|
---|
190 | if defined(VBOX_WITH_TESTCASES) && defined(VBOX_WITH_PLUGIN_CRYPT) \
|
---|
191 | && defined(VBOX_WITH_EXTPACK_PUEL) && defined(VBOX_WITH_EXTPACK_PUEL_BUILD) \
|
---|
192 | && defined(VBOX_WITH_VDKEYSTOREMGR)
|
---|
193 | PROGRAMS += vdkeystoremgr
|
---|
194 |
|
---|
195 | #
|
---|
196 | # vdkeystoremgr - static because it might be used as a standalone tool.
|
---|
197 | #
|
---|
198 | vdkeystoremgr_TEMPLATE = VBoxR3Static
|
---|
199 | vdkeystoremgr_DEFS += IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
|
---|
200 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
201 | vdkeystoremgr_SDKS = VBoxZlibStatic
|
---|
202 | else
|
---|
203 | vdkeystoremgr_SDKS = VBoxZlib
|
---|
204 | endif
|
---|
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 | ifeq ($(KBUILD_TARGET),linux)
|
---|
214 | ifdef SDK_VBoxLibXml2_LIBS
|
---|
215 | vdkeystoremgr_LIBS += xml2
|
---|
216 | endif
|
---|
217 | else if1of ($(KBUILD_TARGET), darwin freebsd)
|
---|
218 | vdkeystoremgr_LIBS += iconv
|
---|
219 | else ifeq ($(KBUILD_TARGET),win)
|
---|
220 | vdkeystoremgr_SDKS.win = VBoxNtDll
|
---|
221 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
222 | vdkeystoremgr_LIBS += kstat
|
---|
223 | endif
|
---|
224 | endif
|
---|
225 |
|
---|
226 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
227 |
|
---|