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