VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/Makefile.kmk@ 93420

Last change on this file since 93420 was 93420, checked in by vboxsync, 3 years ago

*.kmk: Introducing VBOX_WITH_R0_MODULES and VBOX_WITH_HWVIRT for helping with bugref:9898 and bugref:9044 (apple stuff at least). [valkit build fix]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.1 KB
Line 
1# $Id: Makefile.kmk 93420 2022-01-24 18:31:46Z vboxsync $
2## @file
3# VirtualBox Validation Kit.
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# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27SUB_DEPTH = ../../..
28include $(KBUILD_PATH)/subheader.kmk
29
30# Make sure our Config.kmk is included.
31ifndef VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED
32 include $(PATH_SUB_CURRENT)/Config.kmk
33endif
34
35# Collect install targets
36VBOX_VALIDATIONKIT_INSTALLS := $(INSTALLS)
37
38#
39# Include sub-makefiles.
40#
41include $(PATH_SUB_CURRENT)/tests/Makefile.kmk
42ifneq ($(KBUILD_HOST),os2) # need yasm
43 include $(PATH_SUB_CURRENT)/bootsectors/Makefile.kmk
44endif
45include $(PATH_SUB_CURRENT)/utils/Makefile.kmk
46include $(PATH_SUB_CURRENT)/common/Makefile.kmk
47include $(PATH_SUB_CURRENT)/testboxscript/Makefile.kmk
48include $(PATH_SUB_CURRENT)/testdriver/Makefile.kmk
49include $(PATH_SUB_CURRENT)/testmanager/Makefile.kmk
50
51#
52# Globals.
53#
54
55# The current target is enabled by default.
56VBOX_WITH_VALIDATIONKIT_PACKING.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = 1
57
58
59#
60# Install the test driver framework.
61#
62INSTALLS += ValidationKit-testdriver
63ValidationKit-testdriver_TEMPLATE = VBoxValidationKitR3
64ValidationKit-testdriver_INST = $(INST_VALIDATIONKIT)testdriver/
65ValidationKit-testdriver_MODE = a+r,u+w
66ValidationKit-testdriver_SOURCES := \
67 $(PATH_SUB_CURRENT)/testdriver/__init__.py \
68 $(PATH_SUB_CURRENT)/testdriver/base.py \
69 $(PATH_SUB_CURRENT)/testdriver/btresolver.py \
70 $(PATH_SUB_CURRENT)/testdriver/reporter.py \
71 $(PATH_SUB_CURRENT)/testdriver/testfileset.py \
72 $(PATH_SUB_CURRENT)/testdriver/tst-txsclient.py \
73 $(PATH_SUB_CURRENT)/testdriver/txsclient.py \
74 $(PATH_SUB_CURRENT)/testdriver/vbox.py \
75 $(PATH_SUB_CURRENT)/testdriver/vboxcon.py \
76 $(PATH_SUB_CURRENT)/testdriver/vboxtestfileset.py \
77 $(PATH_SUB_CURRENT)/testdriver/vboxtestvms.py \
78 $(PATH_SUB_CURRENT)/testdriver/vboxwrappers.py \
79 $(PATH_SUB_CURRENT)/testdriver/winbase.py \
80 $(PATH_SUB_CURRENT)/testdriver/win-vbox-net-uninstall.ps1
81ValidationKit-testdriver_EXEC_SOURCES := \
82 $(PATH_SUB_CURRENT)/testdriver/vboxinstaller.py
83$(PATH_SUB_CURRENT)/testdriver/txsclient.py_VBOX_PYCHECKER_FLAGS = --no-reimport
84
85
86#
87# Packing target.
88#
89ifndef VBOX_WITHOUT_VALIDATIONKIT_ZIP
90
91 VBOX_VALIDATIONKIT_INSTALLS := $(filter-out $(VBOX_VALIDATIONKIT_INSTALLS), $(INSTALLS))
92
93 #
94 # VBoxValidationKit.zip.
95 # TODO: Don't pack the python stuff multiple times? Lazy works for now.
96 #
97 PACKING += $(PATH_OUT)/VBoxValidationKit.zip
98 $(PATH_OUT)/VBoxValidationKit.zip: \
99 $(VBOX_PATH_VALIDATIONKIT)/VBoxValidationKit.iso \
100 $(VBOX_PATH_VALIDATIONKIT)/ \
101 $$(foreach inst, $$(VBOX_VALIDATIONKIT_INSTALLS), \
102 $$(filter $(PATH_STAGE)/$(INST_VALIDATIONKIT)%, $$($$(inst)_2_STAGE_TARGETS)))
103 $(call MSG_L1,Packing the Test Suite $@)
104 $(QUIET)$(RM) -f $@
105 $(foreach os, darwin freebsd linux os2 solaris win,$(foreach arch, x86 amd64 \
106 ,$(if-expr defined(VBOX_WITH_VALIDATIONKIT_PACKING.$(os).$(arch))\
107 ,$(NLTAB)$(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE)/$(os).$(arch)/$(KBUILD_TYPE)/ \
108 -- $(VBOX_ZIP) -r9 $@ $(INST_VALIDATIONKIT) -x '*.pyc',)))
109
110 #
111 # VBoxTestBoxScript.zip - For setting up the testboxes.
112 #
113 PACKING += $(PATH_OUT)/VBoxTestBoxScript.zip
114 $(PATH_OUT)/VBoxTestBoxScript.zip: \
115 $$(testboxscript_2_STAGE_TARGETS) \
116 $$(testboxscript-common_2_STAGE_TARGETS) \
117 $$(TestBoxHelper_2_STAGE_TARGETS)
118 $(call MSG_L1,Packing the TestBox Script files to $@)
119 $(QUIET)$(RM) -f $@
120 $(foreach os, darwin freebsd linux os2 solaris win,$(foreach arch, x86 amd64 \
121 ,$(if-expr defined(VBOX_WITH_VALIDATIONKIT_PACKING.$(os).$(arch))\
122 ,$(NLTAB)$(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE)/$(os).$(arch)/$(KBUILD_TYPE)/ \
123 -- $(VBOX_ZIP) -r9X $@ $(INST_TESTBOXSCRIPT) -x '*.pyc',)))
124
125endif # !VBOX_WITHOUT_VALIDATIONKIT_ZIP
126
127
128#
129# Automatically lint python code and python unit tests during build.
130#
131if defined(VBOX_WITH_PYLINT) && !defined(VBOX_WITHOUT_AUTO_PYLINT)
132 OTHERS += $(PATH_TARGET)/pylint.run
133 OTHER_CLEAN += $(PATH_TARGET)/pylint.run
134 $(PATH_TARGET)/pylint.run: $$(filter-out %/testboxscript.o, $$(VBOX_VALIDATIONKIT_PYLINT_TARGETS))
135 $(QUIET)$(APPEND) -t "$@"
136endif
137if defined(VBOX_WITH_PYLINT) && !defined(VBOX_WITHOUT_AUTO_PYUNITTEST) # Tied to pylint for hysterical raisins.
138 OTHERS += $(PATH_TARGET)/pyunittest.run
139 OTHER_CLEAN += $(PATH_TARGET)/pyunittest.run
140 $(PATH_TARGET)/pyunittest.run: $$(VBOX_VALIDATIONKIT_PYUNITTEST_TARGETS)
141 $(QUIET)$(APPEND) -t "$@"
142endif
143
144$(evalcall def_vbox_validationkit_process_python_sources,FORCE)
145$(evalcall def_vbox_validationkit_process_js_sources,FORCE)
146include $(FILE_KBUILD_SUB_FOOTER)
147
148
149
150
151#
152# Construct the file spec for creating the Validation Kit guest iso.
153#
154VBOX_VALIDATIONKIT_FILESPEC = \
155 valkit.txt=$(VBOX_PATH_VALIDATIONKIT_SRC)/docs/valkit.txt \
156 $(VBOX_PATH_VALIDATIONKIT)/vboxtxs-readme.txt
157ifneq ($(KBUILD_HOST),os2)
158 VBOX_VALIDATIONKIT_FILESPEC += \
159 $(VBOX_PATH_VALIDATIONKIT)/bootsectors/bootsector-pae.img \
160 $(VBOX_PATH_VALIDATIONKIT)/bootsectors/bootsector-shutdown.img
161endif
162
163# Generate VBOX_PATH_VALIDATIONKIT.os.arch variables.
164$(foreach os, darwin freebsd linux os2 solaris win,$(foreach arch, x86 amd64, \
165 $(eval VBOX_PATH_VALIDATIONKIT.$(os).$(arch) = $(PATH_OUT_BASE)/$(os).$(arch)/$(KBUILD_TYPE)/$(INST_VALIDATIONKIT)$(os)/$(arch)) \
166))
167
168# Common files first.
169define def_vbox_validationkit_common_files
170 ifdef VBOX_WITH_VALIDATIONKIT_PACKING.$(os).$(arch)
171 VBOX_VALIDATIONKIT_FILESPEC += \
172 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/exceptionsR3$(TMP_SUFF_EXE) \
173 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/cpu-alloc-all-mem$(TMP_SUFF_EXE) \
174 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/cpu-numa$(TMP_SUFF_EXE) \
175 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/FsPerf$(TMP_SUFF_EXE) \
176 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/IoPerf$(TMP_SUFF_EXE) \
177 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/NetPerf$(TMP_SUFF_EXE) \
178 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/LoadGenerator$(TMP_SUFF_EXE) \
179 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/SerialTest$(TMP_SUFF_EXE) \
180 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/TestExecService$(TMP_SUFF_EXE) \
181 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/vts_rm$(TMP_SUFF_EXE) \
182 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/vts_shutdown$(TMP_SUFF_EXE) \
183 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/vts_tar$(TMP_SUFF_EXE) \
184 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/xmmsaving$(TMP_SUFF_EXE)
185 if1of ($(arch), amd64) ## HACK ALERT! This mirrors VBOX_WITH_R0_MODULES logic in /Config.kmk.
186 VBOX_VALIDATIONKIT_FILESPEC += \
187 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/loadgeneratorR0.r0
188 endif
189 ifn1of ($(os), os2) ## not compiling bootsectors, no yasm. could fix this better.
190 VBOX_VALIDATIONKIT_FILESPEC += \
191 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/bs3-timing-1$(TMP_SUFF_EXE)
192 endif
193 ifn1of ($(os), os2 freebsd netbsd openbsd) ## must match utils/audio/Makefile.kmk
194 VBOX_VALIDATIONKIT_FILESPEC += \
195 $$(VBOX_PATH_VALIDATIONKIT.$(os).$(arch))/vkat$(TMP_SUFF_EXE)
196 endif
197 endif
198endef
199
200TMP_SUFF_EXE=.exe
201$(foreach os, os2 win,$(foreach arch, x86 amd64, \
202 $(eval $(def_vbox_validationkit_common_files)) \
203))
204TMP_SUFF_EXE=
205$(foreach os, darwin freebsd linux solaris,$(foreach arch, x86 amd64, \
206 $(eval $(def_vbox_validationkit_common_files)) \
207))
208
209# OS specific files - Linux
210ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.x86
211 VBOX_VALIDATIONKIT_FILESPEC += \
212 $(VBOX_PATH_VALIDATIONKIT.linux.x86)/UsbTest
213endif
214ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.amd64
215 VBOX_VALIDATIONKIT_FILESPEC += \
216 $(VBOX_PATH_VALIDATIONKIT.linux.amd64)/UsbTest
217endif
218ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.x86
219 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.x86)/../vboxtxs)
220 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.x86)/../vboxtxs-nat)
221 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.x86)/../vboxtxs.service)
222
223else ifdef VBOX_WITH_VALIDATIONKIT_PACKING.linux.amd64
224 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.amd64)/../vboxtxs)
225 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.amd64)/../vboxtxs-nat)
226 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.linux.amd64)/../vboxtxs.service)
227endif
228
229# OS specific files - OS/2
230ifdef VBOX_WITH_VALIDATIONKIT_PACKING.os2.x86
231 VBOX_VALIDATIONKIT_FILESPEC += \
232 $(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc06.dll \
233 $(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc061.dll \
234 $(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc062.dll \
235 $(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc063.dll \
236 $(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc064.dll \
237 $(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc065.dll \
238 $(VBOX_PATH_VALIDATIONKIT.os2.x86)/libc066.dll
239endif
240
241# OS specific files - Solaris
242ifdef VBOX_WITH_VALIDATIONKIT_PACKING.solaris.x86
243 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.x86)/../vboxtxs.sh)
244 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.x86)/../vboxtxs.xml)
245 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.x86)/../vboxtxs-sol10.xml)
246else ifdef VBOX_WITH_VALIDATIONKIT_PACKING.solaris.amd64
247 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.amd64)/../vboxtxs.sh)
248 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.amd64)/../vboxtxs.xml)
249 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.solaris.amd64)/../vboxtxs-sol10.xml)
250endif
251
252# OS specific files - Windows
253ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.x86
254 VBOX_VALIDATIONKIT_FILESPEC += \
255 $(VBOX_PATH_VALIDATIONKIT.win.x86)/ntSetFreq.exe \
256 $(VBOX_PATH_VALIDATIONKIT.win.x86)/ntTimeSources.exe
257 # Disabled for now; does not work without WinMM.dll export verification files.
258 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
259 # VBOX_VALIDATIONKIT_FILESPEC += \
260 # $(VBOX_PATH_VALIDATIONKIT.win.x86)/ntPlayToneWaveX.exe
261 #endif
262endif
263ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.amd64
264 VBOX_VALIDATIONKIT_FILESPEC += \
265 $(VBOX_PATH_VALIDATIONKIT.win.amd64)/ntSetFreq.exe \
266 $(VBOX_PATH_VALIDATIONKIT.win.amd64)/ntTimeSources.exe
267 # Disabled for now; does not work without WinMM.dll export verification files.
268 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
269 # VBOX_VALIDATIONKIT_FILESPEC += \
270 # $(VBOX_PATH_VALIDATIONKIT.win.amd64)/ntPlayToneWaveX.exe
271 #endif
272endif
273ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.x86
274 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs.cmd)
275 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs.reg)
276 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs-nat.cmd)
277 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.x86)/../vboxtxs-nat.reg)
278else ifdef VBOX_WITH_VALIDATIONKIT_PACKING.win.amd64
279 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs.cmd)
280 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs.reg)
281 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs-nat.cmd)
282 VBOX_VALIDATIONKIT_FILESPEC += $(abspath $(VBOX_PATH_VALIDATIONKIT.win.amd64)/../vboxtxs-nat.reg)
283endif
284
285
286#
287# Build the Validation Kit guest ISO.
288#
289$(VBOX_PATH_VALIDATIONKIT)/VBoxValidationKit.iso: \
290 $(filter-out %=deleteme=, $(subst =,=deleteme= , $(VBOX_VALIDATIONKIT_FILESPEC))) \
291 $(VBOX_SVN_REV_KMK) \
292 $(VBOX_PATH_VALIDATIONKIT_SRC)/Makefile.kmk \
293 | $(if-expr defined(VBOX_USE_RTISOMAKER),$(VBOX_RTISOMAKER),)
294 $(call MSG_TOOL,RTIsoMaker,,$@)
295 $(QUIET)$(MKDIR) -p $(@D)
296ifneq ($(KBUILD_TARGET),os2)
297 $(QUIET)$(ECHO) VBOX_VALIDATIONKIT_FILESPEC $(VBOX_VALIDATIONKIT_FILESPEC)
298endif
299 $(VBOX_RTISOMAKER) \
300 --output $@ \
301 --iso-level 3 \
302 --rock-ridge \
303 --joliet \
304 --rational-attribs \
305 --random-order-verification 2048 \
306 $(foreach spec,$(VBOX_VALIDATIONKIT_FILESPEC) \
307 ,$(if $(findstring =,$(spec)), $(spec), /$(lastword $(subst /$(INST_VALIDATIONKIT), ,$(spec))=$(spec))) ) \
308 $(foreach spec,$(filter-out %.txt %.dll %.xml %.reg %.img, $(VBOX_VALIDATIONKIT_FILESPEC)) \
309 ,--chmod=a+x:/$(lastword $(if $(findstring =,$(spec)), \
310 $(subst =, $(SP), $(spec)), \
311 $(subst /$(INST_VALIDATIONKIT), ,$(spec))))) \
312 --volume-id "VBOXVALK_$(VBOX_SVN_REV)_$(VBOX_VERSION_STRING_RAW)" \
313 --name-setup joliet \
314 --volume-id "VBoxValK $(VBOX_SVN_REV)"
315
316# Alias for creating the iso.
317.PHONY: validationkit-iso
318validationkit-iso: $(VBOX_PATH_VALIDATIONKIT)/VBoxValidationKit.iso
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette