1 | # $Id: Config.kmk 105160 2024-07-05 12:02:04Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # kBuild Configuration file for the VirtualBox Validation Kit.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2010-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 | # The contents of this file may alternatively be used under the terms
|
---|
26 | # of the Common Development and Distribution License Version 1.0
|
---|
27 | # (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | # in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | # CDDL are applicable instead of those of the GPL.
|
---|
30 | #
|
---|
31 | # You may elect to license modified versions of this file under the
|
---|
32 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | #
|
---|
34 | # SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | #
|
---|
36 |
|
---|
37 | VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED = 1
|
---|
38 |
|
---|
39 | # Include the top-level configure file.
|
---|
40 | ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
|
---|
41 | include $(PATH_ROOT)/Config.kmk
|
---|
42 | endif
|
---|
43 |
|
---|
44 | #
|
---|
45 | # Globals
|
---|
46 | #
|
---|
47 | VBOX_PATH_VALIDATIONKIT_SRC := $(PATH_ROOT)/src/VBox/ValidationKit
|
---|
48 |
|
---|
49 |
|
---|
50 | #
|
---|
51 | # Base template for Validation Kit R3 programs that drops the -static flag since we only want to use the
|
---|
52 | # static version of our own libraries and not the system libs.
|
---|
53 | #
|
---|
54 | TEMPLATE_VBoxValidationKitR3Base = VBox Validation Kit ring-3 program base, both guest and host.
|
---|
55 | TEMPLATE_VBoxValidationKitR3Base_EXTENDS = VBoxR3Static
|
---|
56 | ifeq ($(KBUILD_TARGET),win)
|
---|
57 | TEMPLATE_VBoxValidationKitR3Base_LDFLAGS = $(filter-out -IntegrityCheck, $(TEMPLATE_VBoxR3Static_LDFLAGS))
|
---|
58 | else ifn1of ($(KBUILD_TARGET), darwin solaris win)
|
---|
59 | TEMPLATE_VBoxValidationKitR3Base_CFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_CFLAGS))
|
---|
60 | TEMPLATE_VBoxValidationKitR3Base_CXXFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_CXXFLAGS))
|
---|
61 | TEMPLATE_VBoxValidationKitR3Base_OBJCFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_OBJCFLAGS))
|
---|
62 | TEMPLATE_VBoxValidationKitR3Base_LDFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_LDFLAGS))
|
---|
63 | endif
|
---|
64 | TEMPLATE_VBoxValidationKitR3Base_DEFS = $(filter-out VBOX_WITH_DTRACE,$(TEMPLATE_VBoxR3Static_DEFS))
|
---|
65 | TEMPLATE_VBoxValidationKitR3Base_LIBS = $(TEMPLATE_VBoxR3Static_LIBS)
|
---|
66 | if1of ($(KBUILD_TARGET), linux)
|
---|
67 | if $(VBOX_GCC_VERSION_CXX) < 40800
|
---|
68 | TEMPLATE_VBoxValidationKitR3Base_LIBS += supc++
|
---|
69 | TEMPLATE_VBoxValidationKitR3Base_LDTOOL = $(subst GXX,GCC,$(TEMPLATE_VBoxR3Static_TOOL))
|
---|
70 | endif
|
---|
71 | endif
|
---|
72 | TEMPLATE_VBoxValidationKitR3Base_LDFLAGS.darwin = $(TEMPLATE_VBoxR3Static_LDFLAGS.darwin) -framework IOKit
|
---|
73 |
|
---|
74 |
|
---|
75 | #
|
---|
76 | # Template for building ring-3 programs for the Validation Kit.
|
---|
77 | # These programs can run on any host or guest.
|
---|
78 | #
|
---|
79 | TEMPLATE_VBoxValidationKitR3 = VBox Validation Kit ring-3 program, both guest and host.
|
---|
80 | TEMPLATE_VBoxValidationKitR3_EXTENDS = VBoxValidationKitR3Base
|
---|
81 | TEMPLATE_VBoxValidationKitR3_EXTENDS_BY = appending
|
---|
82 | TEMPLATE_VBoxValidationKitR3_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
|
---|
83 | TEMPLATE_VBoxValidationKitR3_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBoxNtDll
|
---|
84 | TEMPLATE_VBoxValidationKitR3_DEFS = IN_RT_R3
|
---|
85 | TEMPLATE_VBoxValidationKitR3_LIBS.darwin = iconv
|
---|
86 | TEMPLATE_VBoxValidationKitR3_LIBS.freebsd = iconv
|
---|
87 | TEMPLATE_VBoxValidationKitR3_LIBS = \
|
---|
88 | $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
|
---|
89 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
90 | TEMPLATE_VBoxValidationKitR3_LIBS += \
|
---|
91 | kstat \
|
---|
92 | nsl \
|
---|
93 | contract
|
---|
94 | if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
|
---|
95 | TEMPLATE_VBoxValidationKitR3_LIBS += \
|
---|
96 | smbios
|
---|
97 | endif
|
---|
98 | endif
|
---|
99 | ifneq ($(KBUILD_TARGET),win)
|
---|
100 | TEMPLATE_VBoxValidationKitR3_LIBS += \
|
---|
101 | $(SDK_VBoxZlib_LIBS)
|
---|
102 | endif
|
---|
103 |
|
---|
104 | # Make VCC100 output work on NT3.x, NT4, W2K, XP and W2K3.
|
---|
105 | ifndef VBOX_WITH_NOCRT_STATIC
|
---|
106 | TEMPLATE_VBoxValidationKitR3_LIBS.win.x86 = \
|
---|
107 | $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/oldnames.lib \
|
---|
108 | $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
109 | $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
110 | $(PATH_STAGE_LIB)/RuntimeR3VccTricks$(VBOX_SUFF_LIB)
|
---|
111 | TEMPLATE_VBoxValidationKitR3_LDFLAGS.win.x86 = \
|
---|
112 | -Include:_vcc100_shell32_fakes_cpp \
|
---|
113 | -Include:_vcc100_shell32_fakes_asm \
|
---|
114 | -Section:.bss,RW!K
|
---|
115 | endif
|
---|
116 | TEMPLATE_VBoxValidationKitR3_LDFLAGS.win.x86 += -NoOptIData
|
---|
117 |
|
---|
118 | TEMPLATE_VBoxValidationKitR3_USES.win += vboxsetpeversion
|
---|
119 | TEMPLATE_VBoxValidationKitR3_VBOX_SET_PE_VERSION.win.x86 = nt31
|
---|
120 | TEMPLATE_VBoxValidationKitR3_VBOX_SET_PE_VERSION.win.amd64 = xp64
|
---|
121 |
|
---|
122 | TEMPLATE_VBoxValidationKitR3_USES.win += vboximportchecker
|
---|
123 | TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.x86 = nt31
|
---|
124 | TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.amd64 = xp64
|
---|
125 | #TODO: TEMPLATE_VBoxValidationKitR3_EXTENDS = VBoxGuestR3Exe
|
---|
126 |
|
---|
127 |
|
---|
128 | #
|
---|
129 | # Template for ring-3 testcases to be included on the Validation Kit .ISO.
|
---|
130 | #
|
---|
131 | # Needed for running the ring-3 testcases on older guests (like NT4 / XP).
|
---|
132 | # Those testcases then run as part of the Validation Kit and are included on the Validation Kit .ISO.
|
---|
133 | # See @bugref:10195.
|
---|
134 | #
|
---|
135 | TEMPLATE_VBoxValidationKitR3TstExe = VBox Ring 3 Testcase Exe for Validation Kit .ISO
|
---|
136 | TEMPLATE_VBoxValidationKitR3TstExe_EXTENDS = VBoxValidationKitR3
|
---|
137 | TEMPLATE_VBoxValidationKitR3TstExe_INST = $(INST_VALIDATIONKIT)/testcase/$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/testcase/
|
---|
138 |
|
---|
139 |
|
---|
140 | #
|
---|
141 | # Template for building ring-3 programs for the Validation Kit.
|
---|
142 | # When these programs run on the host they may take advantage of the
|
---|
143 | # support driver if installed.
|
---|
144 | #
|
---|
145 | TEMPLATE_VBoxValidationKitR3SupDrv = VBox Validation Kit ring-3 program, mainly host.
|
---|
146 | TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS = VBoxValidationKitR3
|
---|
147 | TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS_BY = appending
|
---|
148 | TEMPLATE_VBoxValidationKitR3SupDrv_DEFS = IN_SUP_R3
|
---|
149 | TEMPLATE_VBoxValidationKitR3SupDrv_LIBS = \
|
---|
150 | $(PATH_STAGE_LIB)/SUPR3Static$(VBOX_SUFF_LIB) \
|
---|
151 | $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
|
---|
152 | ifndef VBOX_WITH_NOCRT_STATIC
|
---|
153 | TEMPLATE_VBoxValidationKitR3SupDrv_LDFLAGS.win.x86 = \
|
---|
154 | -Include:_vcc100_ntdll_fakes_cpp \
|
---|
155 | -Include:_vcc100_ntdll_fakes_asm
|
---|
156 | endif
|
---|
157 |
|
---|
158 | #
|
---|
159 | # Template for building agnostic ring-0 host modules for the Validation Kit.
|
---|
160 | #
|
---|
161 | TEMPLATE_VBoxValidationKitR0 = VBox Validation Kit agnostic ring-0 host module.
|
---|
162 | TEMPLATE_VBoxValidationKitR0_EXTENDS = VBoxR0
|
---|
163 | TEMPLATE_VBoxValidationKitR0_EXTENDS_BY = appending
|
---|
164 | TEMPLATE_VBoxValidationKitR0_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
|
---|
165 | TEMPLATE_VBoxValidationKitR0_DEFS = IN_RT_R0
|
---|
166 | TEMPLATE_VBoxValidationKitR0_LIBS = \
|
---|
167 | $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
|
---|
168 | $(VBOX_LIB_SUPR0)
|
---|
169 |
|
---|
170 | #
|
---|
171 | # List of python sources that should be linted and unittested.
|
---|
172 | #
|
---|
173 | VBOX_VALIDATIONKIT_PYTHON_SOURCES :=
|
---|
174 | VBOX_VALIDATIONKIT_PYLINT_TARGETS :=
|
---|
175 | VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE :=
|
---|
176 |
|
---|
177 | ifdef VBOX_WITH_PYLINT
|
---|
178 | TESTING +=
|
---|
179 | endif
|
---|
180 |
|
---|
181 | #
|
---|
182 | # Process python sources.
|
---|
183 | #
|
---|
184 | if1of ($(KBUILD_TARGET), win os2)
|
---|
185 | VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH);$(VBOX_PATH_VALIDATIONKIT_SRC);$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript;$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager;$(VBOX_PATH_VALIDATIONKIT_SRC)/tests/additions;$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll
|
---|
186 | else
|
---|
187 | VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH):$(VBOX_PATH_VALIDATIONKIT_SRC):$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript:$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager:$(VBOX_PATH_VALIDATIONKIT_SRC)/tests/additions:$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll
|
---|
188 | endif
|
---|
189 | BLDDIRS += $(PATH_TARGET)/pylint $(PATH_TARGET)/pyunittest
|
---|
190 |
|
---|
191 | define def_vbox_validationkit_py_check
|
---|
192 | $(eval name:=$(basename $(notdir $(py))))
|
---|
193 |
|
---|
194 | pylint: $(name)-py-phony.o
|
---|
195 | $(name).o: $(name)-py-phony.o
|
---|
196 | $(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
|
---|
197 | ifdef VBOX_WITH_PYLINT
|
---|
198 | $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
|
---|
199 | $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -- \
|
---|
200 | $(VBOX_PYLINT) --rcfile=$(VBOX_PATH_VALIDATIONKIT_SRC)/pylintrc $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
|
---|
201 | endif
|
---|
202 | $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
|
---|
203 |
|
---|
204 | ifn1of ($(py), $(VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE))
|
---|
205 | pyunittest: $(name)-pyunittest.o
|
---|
206 | $(PATH_TARGET)/pyunittest/$(name).o $(name)-pyunittest.o:: $(py) | $(PATH_TARGET)/pyunittest/
|
---|
207 | $(QUIET2)$(call MSG_L1,Unittesting Python source $(py)...)
|
---|
208 | $(QUIET)$(REDIRECT) -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -C $(dir $(py)) \
|
---|
209 | -- $(VBOX_UNITTEST_PYTHON) -m unittest -v $(notdir $(basename $(py)))
|
---|
210 | $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pyunittest/$(name).o"
|
---|
211 | VBOX_VALIDATIONKIT_PYUNITTEST_TARGETS += $(PATH_TARGET)/pyunittest/$(name).o
|
---|
212 |
|
---|
213 | TESTING += $(name)-pyunittest.o
|
---|
214 | endif
|
---|
215 | TESTING += $(name)-py-phony.o
|
---|
216 | VBOX_VALIDATIONKIT_PYLINT_TARGETS += $(PATH_TARGET)/pylint/$(name).o
|
---|
217 | endef # def_vbox_validationkit_py_check
|
---|
218 |
|
---|
219 |
|
---|
220 | define def_vbox_validationkit_process_python_sources
|
---|
221 | if $(words $(_SUB_MAKEFILE_STACK)) <= 0 || "$1" == "FORCE"
|
---|
222 | $(foreach py, $(VBOX_VALIDATIONKIT_PYTHON_SOURCES), $(eval $(def_vbox_validationkit_py_check)))
|
---|
223 | endif
|
---|
224 | endef
|
---|
225 |
|
---|
226 |
|
---|
227 |
|
---|
228 | #
|
---|
229 | # http://www.jshint.com
|
---|
230 | #
|
---|
231 | VBOX_JSHINT ?= jshint
|
---|
232 | VBOX_JSHINT_FLAGS := --config $(VBOX_PATH_VALIDATIONKIT_SRC)/jshintrc.js --verbose
|
---|
233 | ifndef VBOX_WITH_JSHINT
|
---|
234 | VBOX_WITH_JSHINT := $(which $(VBOX_JSHINT))
|
---|
235 | endif
|
---|
236 |
|
---|
237 | #
|
---|
238 | # List of javascript sources that should be checked and linted.
|
---|
239 | #
|
---|
240 | VBOX_VALIDATIONKIT_JS_SOURCES :=
|
---|
241 |
|
---|
242 | define def_vbox_validationkit_js_check
|
---|
243 | $(eval name:=$(basename $(notdir $(js))))
|
---|
244 | $(name).o $(name).obj: # $(PATH_SUB_CURRENT)/$(js)
|
---|
245 | -$(REDIRECT) -E LC_ALL=C -C $(dir $(js)) -- $$(VBOX_JSHINT) ./$(notdir $(js)) $$(VBOX_JSHINT_FLAGS)
|
---|
246 | jslint: $(name).o
|
---|
247 | endef
|
---|
248 |
|
---|
249 | ifdef VBOX_WITH_JSHINT
|
---|
250 | define def_vbox_validationkit_process_js_sources
|
---|
251 | if $(words $(_SUB_MAKEFILE_STACK)) <= 0
|
---|
252 | $(foreach js, $(VBOX_VALIDATIONKIT_JS_SOURCES), $(eval $(def_vbox_validationkit_js_check)))
|
---|
253 | endif
|
---|
254 | endef
|
---|
255 | endif
|
---|
256 |
|
---|
257 |
|
---|
258 | #
|
---|
259 | # List of IPRT testcases that will be included in the ValKit.
|
---|
260 | #
|
---|
261 | ifdef VBOX_WITH_VALIDATIONKIT_UNITTESTS_PACKING
|
---|
262 | VALKIT_UNITTESTS_WHITELIST_IPRT := \
|
---|
263 | tstFile \
|
---|
264 | tstFileLock \
|
---|
265 | tstRTPathQueryInfo \
|
---|
266 | tstRTPipe \
|
---|
267 | tstRTProcCreateEx \
|
---|
268 | tstRTProcCreatePrf \
|
---|
269 | tstRTProcQueryUsername \
|
---|
270 | tstThread-1 \
|
---|
271 | tstUtf8
|
---|
272 |
|
---|
273 | VALKIT_UNITTESTS_WHITELIST_IPRT.linux += \
|
---|
274 | tstRTProcWait \
|
---|
275 | tstRTProcIsRunningByName
|
---|
276 |
|
---|
277 | VALKIT_UNITTESTS_WHITELIST_IPRT.win += \
|
---|
278 | tstRTProcWait
|
---|
279 |
|
---|
280 | endif # VBOX_WITH_VALIDATIONKIT_UNITTESTS_PACKING
|
---|
281 |
|
---|