1 | # $Id: Makefile.kmk 99770 2023-05-12 09:27:23Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VBox API testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2004-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 | # Target and globals (small mess)
|
---|
34 | #
|
---|
35 | ifndef VBOX_ONLY_SDK
|
---|
36 | if defined(VBOX_WITH_TESTCASES)
|
---|
37 | PROGRAMS += \
|
---|
38 | tstAPI \
|
---|
39 | tstVBoxAPI \
|
---|
40 | tstVBoxAPIPerf \
|
---|
41 | tstVBoxMultipleVM \
|
---|
42 | $(if $(VBOX_OSE),,tstOVF) \
|
---|
43 | $(if $(VBOX_WITH_XPCOM),tstVBoxAPIXPCOM,tstVBoxAPIWin msiDarwinDescriptorDecoder) \
|
---|
44 | $(if $(VBOX_WITH_RESOURCE_USAGE_API),tstCollector,) \
|
---|
45 | $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlContextID,) \
|
---|
46 | $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlParseBuffer,) \
|
---|
47 | $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlPaths,) \
|
---|
48 | tstMediumLock \
|
---|
49 | tstSafeArray \
|
---|
50 | tstBstr \
|
---|
51 | tstGuid \
|
---|
52 | tstUnattendedScript \
|
---|
53 | tstVBoxCrypto
|
---|
54 | PROGRAMS.linux += \
|
---|
55 | $(if $(VBOX_WITH_USB),tstUSBProxyLinux,)
|
---|
56 | endif # !VBOX_WITH_TESTCASES
|
---|
57 | endif # !VBOX_ONLY_SDK
|
---|
58 | if defined(VBOX_ONLY_SDK) || !defined(VBOX_WITH_XPCOM)
|
---|
59 | INSTALLS += samplesMSCOM
|
---|
60 | endif
|
---|
61 | if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_XPCOM)
|
---|
62 | INSTALLS += samplesXPCOM
|
---|
63 | endif
|
---|
64 |
|
---|
65 |
|
---|
66 | #
|
---|
67 | # The samples
|
---|
68 | #
|
---|
69 | samplesMSCOM_MODE = a+r,u+w
|
---|
70 | samplesMSCOM_INST = $(INST_SDK)bindings/mscom/samples/
|
---|
71 | samplesMSCOM_SOURCES = tstVBoxAPIWin.cpp makefile.tstVBoxAPIWin=>Makefile
|
---|
72 |
|
---|
73 | samplesXPCOM_MODE = a+r,u+w
|
---|
74 | samplesXPCOM_INST = $(INST_SDK)bindings/xpcom/samples/
|
---|
75 | samplesXPCOM_SOURCES = tstVBoxAPIXPCOM.cpp makefile.tstVBoxAPIXPCOM=>Makefile
|
---|
76 |
|
---|
77 | #
|
---|
78 | # tstVBoxMultipleVM
|
---|
79 | #
|
---|
80 | tstVBoxMultipleVM_TEMPLATE = VBoxMainClientTstExe
|
---|
81 | tstVBoxMultipleVM_SOURCES = tstVBoxMultipleVM.cpp
|
---|
82 |
|
---|
83 | #
|
---|
84 | # tstAPI
|
---|
85 | #
|
---|
86 | tstAPI_TEMPLATE = VBoxMainClientTstExe
|
---|
87 | #tstAPI_INST = $(INST_SDK)bindings/gluecom/samples/
|
---|
88 | tstAPI_SOURCES = tstAPI.cpp
|
---|
89 |
|
---|
90 | #
|
---|
91 | # tstVBoxAPI
|
---|
92 | #
|
---|
93 | tstVBoxAPI_TEMPLATE = VBoxMainClientTstExe
|
---|
94 | tstVBoxAPI_SOURCES = \
|
---|
95 | tstVBoxAPI.cpp
|
---|
96 |
|
---|
97 | #
|
---|
98 | # tstVBoxAPIPerf
|
---|
99 | #
|
---|
100 | tstVBoxAPIPerf_TEMPLATE = VBoxMainClientTstExe
|
---|
101 | tstVBoxAPIPerf_SOURCES = \
|
---|
102 | tstVBoxAPIPerf.cpp
|
---|
103 |
|
---|
104 | #
|
---|
105 | # tstOVF
|
---|
106 | #
|
---|
107 | tstOVF_TEMPLATE = VBoxMainClientTstExe
|
---|
108 | #tstOVF_INST = $(INST_SDK)bindings/gluecom/samples/
|
---|
109 | tstOVF_SOURCES = tstOVF.cpp
|
---|
110 |
|
---|
111 | ifndef VBOX_OSE
|
---|
112 | #
|
---|
113 | # OVF test data.
|
---|
114 | #
|
---|
115 | INSTALLS += ovf-testcases
|
---|
116 | ovf-testcases_MODE = a+r,u+w
|
---|
117 | ovf-testcases_INST = $(INST_TESTCASE)ovf-testcases/
|
---|
118 | ovf-testcases_SOURCES = \
|
---|
119 | ovf-dummy.vmdk \
|
---|
120 | ovf-joomla-0.9/joomla-1.1.4-ovf.ovf=>ovf-joomla-0.9/joomla-1.1.4-ovf.ovf \
|
---|
121 | ovf-winhost-audio-nodisks/WinXP.ovf=>ovf-winhost-audio-nodisks/WinXP.ovf \
|
---|
122 | ovf-winxp-vbox-sharedfolders/winxp.ovf=>ovf-winxp-vbox-sharedfolders/winxp.ovf
|
---|
123 | endif
|
---|
124 |
|
---|
125 |
|
---|
126 | #
|
---|
127 | # tstVBoxAPIXPCOM
|
---|
128 | #
|
---|
129 | # We only build the testcase here to make sure it builds.
|
---|
130 | # It comes with a custom makefile which should be tested as well!
|
---|
131 | #
|
---|
132 | # Use very generic template to make the build environment similar
|
---|
133 | # to the standalone case, to detect if IPRT or glue use sneaks in.
|
---|
134 | #
|
---|
135 | tstVBoxAPIXPCOM_TEMPLATE = VBoxR3Exe
|
---|
136 | tstVBoxAPIXPCOM_INST = $(INST_TESTCASE)
|
---|
137 | tstVBoxAPIXPCOM_SOURCES = tstVBoxAPIXPCOM.cpp
|
---|
138 | tstVBoxAPIXPCOM_INCS = \
|
---|
139 | $(VBOX_PATH_SDK)/bindings/xpcom/include \
|
---|
140 | $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
|
---|
141 | $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
|
---|
142 | $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
|
---|
143 | $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
|
---|
144 | tstVBoxAPIXPCOM_LIBS = \
|
---|
145 | $(LIB_XPCOM) \
|
---|
146 | $(LIB_RUNTIME)
|
---|
147 | tstVBoxAPIXPCOM_CXXFLAGS = -fshort-wchar
|
---|
148 | ifdef VBOX_WITH_RUNPATH
|
---|
149 | tstVBoxAPIXPCOM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBoxBldProg_LDFLAGS)
|
---|
150 | else ifdef VBOX_WITH_RELATIVE_RUNPATH
|
---|
151 | tstVBoxAPIXPCOM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBoxBldProg_LDFLAGS)
|
---|
152 | endif
|
---|
153 | tstVBoxAPIXPCOM_INTERMEDIATES = \
|
---|
154 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
|
---|
155 | ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
156 | tstVBoxAPIXPCOM_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
157 | endif
|
---|
158 |
|
---|
159 |
|
---|
160 | #
|
---|
161 | # tstVBoxAPIWin
|
---|
162 | #
|
---|
163 | # Use very generic template to make the build environment similar
|
---|
164 | # to the standalone case, to detect if IPRT or glue use sneaks in.
|
---|
165 | #
|
---|
166 | tstVBoxAPIWin_TEMPLATE = VBoxR3Exe
|
---|
167 | tstVBoxAPIWin_INST = $(INST_TESTCASE)
|
---|
168 | tstVBoxAPIWin_SOURCES = \
|
---|
169 | tstVBoxAPIWin.cpp \
|
---|
170 | $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
|
---|
171 | tstVBoxAPIWin_INCS = \
|
---|
172 | $(VBOX_PATH_SDK)/bindings/mscom/include
|
---|
173 | tstVBoxAPIWin_INTERMEDIATES = \
|
---|
174 | $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
|
---|
175 |
|
---|
176 |
|
---|
177 | #
|
---|
178 | # msiDarwinDescriptorDecoder
|
---|
179 | #
|
---|
180 | # Use very generic template to make the build environment similar
|
---|
181 | # to the standalone case, to detect if IPRT or glue use sneaks in.
|
---|
182 | #
|
---|
183 | msiDarwinDescriptorDecoder_TEMPLATE = VBoxR3Exe
|
---|
184 | msiDarwinDescriptorDecoder_INST = $(VBOX_INST_TOOLS)
|
---|
185 | msiDarwinDescriptorDecoder_SOURCES = \
|
---|
186 | msiDarwinDescriptorDecoder.cpp
|
---|
187 |
|
---|
188 |
|
---|
189 | #
|
---|
190 | # tstCollector
|
---|
191 | #
|
---|
192 | # Note! VBOX_MAIN_APIWRAPPER_GEN_HDRS is only defined if kmk is executed a
|
---|
193 | # parent directory. Since the rules for generating the files listed by
|
---|
194 | # the variable lives in the parent makefile, this is not a problem.
|
---|
195 | #
|
---|
196 | tstCollector_TEMPLATE = VBoxMainClientTstExe
|
---|
197 | tstCollector_SOURCES = \
|
---|
198 | tstCollector.cpp \
|
---|
199 | ../src-server/Performance.cpp
|
---|
200 | tstCollector_INCS = \
|
---|
201 | ../include \
|
---|
202 | $(VBOX_MAIN_APIWRAPPER_INCS)
|
---|
203 | tstCollector_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
|
---|
204 | tstCollector_DEFS = VBOX_COLLECTOR_TEST_CASE
|
---|
205 | tstCollector_LDFLAGS.darwin = -lproc
|
---|
206 | tstCollector_LDFLAGS.solaris = -lkstat -lnvpair
|
---|
207 | tstCollector_LDFLAGS.win = psapi.lib powrprof.lib
|
---|
208 |
|
---|
209 |
|
---|
210 | #
|
---|
211 | # tstGuestCtrlContextID
|
---|
212 | #
|
---|
213 | tstGuestCtrlContextID_TEMPLATE = VBoxMainClientTstExe
|
---|
214 | tstGuestCtrlContextID_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
|
---|
215 | tstGuestCtrlContextID_DEFS += VBOX_WITH_HGCM VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
|
---|
216 | tstGuestCtrlContextID_SOURCES = \
|
---|
217 | tstGuestCtrlContextID.cpp \
|
---|
218 | ../src-client/GuestCtrlPrivate.cpp
|
---|
219 | tstGuestCtrlContextID_INCS = ../include \
|
---|
220 | $(VBOX_MAIN_APIWRAPPER_INCS)
|
---|
221 |
|
---|
222 |
|
---|
223 | #
|
---|
224 | # tstGuestCtrlParseBuffer
|
---|
225 | #
|
---|
226 | tstGuestCtrlParseBuffer_TEMPLATE = VBoxMainClientTstExe
|
---|
227 | tstGuestCtrlParseBuffer_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
|
---|
228 | tstGuestCtrlParseBuffer_DEFS += VBOX_WITH_HGCM VBOX_WITH_GSTCTL_TOOLBOX_SUPPORT VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
|
---|
229 | tstGuestCtrlParseBuffer_SOURCES = \
|
---|
230 | tstGuestCtrlParseBuffer.cpp \
|
---|
231 | ../src-client/GuestCtrlPrivate.cpp
|
---|
232 | tstGuestCtrlParseBuffer_INCS = ../include \
|
---|
233 | $(VBOX_MAIN_APIWRAPPER_INCS)
|
---|
234 |
|
---|
235 |
|
---|
236 | #
|
---|
237 | # tstGuestCtrlPaths
|
---|
238 | #
|
---|
239 | tstGuestCtrlPaths_TEMPLATE = VBoxMainClientTstExe
|
---|
240 | tstGuestCtrlPaths_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
|
---|
241 | tstGuestCtrlPaths_DEFS += VBOX_WITH_HGCM VBOX_WITH_GUEST_CONTROL VBOX_GUESTCTRL_TEST_CASE
|
---|
242 | tstGuestCtrlPaths_SOURCES = \
|
---|
243 | tstGuestCtrlPaths.cpp \
|
---|
244 | ../src-client/GuestCtrlPrivate.cpp
|
---|
245 | tstGuestCtrlPaths_INCS = ../include \
|
---|
246 | $(VBOX_MAIN_APIWRAPPER_INCS)
|
---|
247 |
|
---|
248 | if 0 # Enable this if you want automatic runs after compilation.
|
---|
249 | $$(tstGuestCtrlPaths_0_OUTDIR)/tstGuestCtrlPaths.run: $$(tstGuestCtrlPaths_1_STAGE_TARGET)
|
---|
250 | export VBOX_LOG_DEST=nofile; $(tstGuestCtrlPaths_1_STAGE_TARGET) quiet
|
---|
251 | $(QUIET)$(APPEND) -t "$@" "done"
|
---|
252 | OTHERS += $(tstGuestCtrlPaths_0_OUTDIR)/tstGuestCtrlPaths.run
|
---|
253 | endif
|
---|
254 |
|
---|
255 |
|
---|
256 | #
|
---|
257 | # tstUSBProxyLinux
|
---|
258 | #
|
---|
259 | tstUSBProxyLinux_TEMPLATE = VBoxMainClientTstExe
|
---|
260 | tstUSBProxyLinux_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
|
---|
261 | tstUSBProxyLinux_SOURCES = \
|
---|
262 | tstUSBProxyLinux.cpp \
|
---|
263 | ../src-server/linux/USBGetDevices.cpp
|
---|
264 | tstUSBProxyLinux_INCS = \
|
---|
265 | . \
|
---|
266 | ../include \
|
---|
267 | $(VBOX_PATH_SDK)/bindings/xpcom/include \
|
---|
268 | $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
|
---|
269 | $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
|
---|
270 | $(VBOX_MAIN_APIWRAPPER_INCS)
|
---|
271 | tstUSBProxyLinux_DEFS = \
|
---|
272 | UNIT_TEST \
|
---|
273 | VBOX_WITH_USB \
|
---|
274 | VBOX_USB_WITH_SYSFS \
|
---|
275 | VBOX_WITH_XPCOM
|
---|
276 | tstUSBProxyLinux_DEPS = \
|
---|
277 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
|
---|
278 | tstUSBProxyLinux_LIBS += \
|
---|
279 | $(PATH_OUT)/lib/USBLib.a \
|
---|
280 | $(PATH_OUT)/lib/VBoxCOM.a
|
---|
281 |
|
---|
282 |
|
---|
283 | #
|
---|
284 | # tstMediumLock
|
---|
285 | #
|
---|
286 | tstMediumLock_TEMPLATE = VBoxMainClientTstExe
|
---|
287 | tstMediumLock_SOURCES = tstMediumLock.cpp
|
---|
288 |
|
---|
289 |
|
---|
290 | #
|
---|
291 | # tstSafeArray
|
---|
292 | #
|
---|
293 | tstSafeArray_TEMPLATE = VBoxMainClientTstExe
|
---|
294 | tstSafeArray_SOURCES = tstSafeArray.cpp
|
---|
295 |
|
---|
296 |
|
---|
297 | #
|
---|
298 | # tstBstr
|
---|
299 | #
|
---|
300 | tstBstr_TEMPLATE = VBoxMainClientTstExe
|
---|
301 | tstBstr_SOURCES = tstBstr.cpp
|
---|
302 |
|
---|
303 |
|
---|
304 | #
|
---|
305 | # tstGuid
|
---|
306 | #
|
---|
307 | tstGuid_TEMPLATE = VBoxMainClientTstExe
|
---|
308 | tstGuid_SOURCES = tstGuid.cpp
|
---|
309 |
|
---|
310 |
|
---|
311 | #
|
---|
312 | # tstUnattendedScript
|
---|
313 | #
|
---|
314 | tstUnattendedScript_TEMPLATE = VBoxMainClientTstExe
|
---|
315 | tstUnattendedScript_DEFS = VBOX_WITH_UNATTENDED IN_VBOXSVC IN_TST_UNATTENDED_SCRIPT
|
---|
316 | tstUnattendedScript_INTERMEDIATES = \
|
---|
317 | $(VBOX_MAIN_APIWRAPPER_GEN_HDRS) \
|
---|
318 | $(VBOX_XML_SCHEMADEFS_H)
|
---|
319 | tstUnattendedScript_INCS = \
|
---|
320 | ../include \
|
---|
321 | $(VBOX_MAIN_APIWRAPPER_INCS) \
|
---|
322 | $(dir $(VBOX_XML_SCHEMADEFS_H))
|
---|
323 | tstUnattendedScript_SOURCES = \
|
---|
324 | tstUnattendedScript.cpp \
|
---|
325 | ../src-server/UnattendedScript.cpp \
|
---|
326 | ../src-all/TextScript.cpp \
|
---|
327 | ../src-all/VirtualBoxBase.cpp \
|
---|
328 | ../src-all/VirtualBoxErrorInfoImpl.cpp \
|
---|
329 | ../src-all/AutoCaller.cpp \
|
---|
330 | ../src-all/GlobalStatusConversion.cpp
|
---|
331 | tstUnattendedScript_LIBS = \
|
---|
332 | $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB)
|
---|
333 |
|
---|
334 | INSTALLS += tstUnattendedScriptFiles
|
---|
335 | tstUnattendedScriptFiles_TEMPLATE = VBoxMainTstExe
|
---|
336 | tstUnattendedScriptFiles_SOURCES = \
|
---|
337 | tstUnattendedScript-1.template \
|
---|
338 | tstUnattendedScript-1.expected
|
---|
339 |
|
---|
340 |
|
---|
341 | #
|
---|
342 | # tstVBoxCrypto
|
---|
343 | #
|
---|
344 | tstVBoxCrypto_TEMPLATE = VBoxMainClientTstExe
|
---|
345 | tstVBoxCrypto_SOURCES = tstVBoxCrypto.cpp
|
---|
346 |
|
---|
347 |
|
---|
348 |
|
---|
349 | # generate rules.
|
---|
350 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
351 |
|
---|