VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/Config.kmk@ 96407

Last change on this file since 96407 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.6 KB
Line 
1# $Id: Config.kmk 96407 2022-08-22 17:43:14Z vboxsync $
2## @file
3# kBuild Configuration file for the VirtualBox Validation Kit.
4#
5
6#
7# Copyright (C) 2010-2022 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
37VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED = 1
38
39# Include the top-level configure file.
40ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
41 include $(PATH_ROOT)/Config.kmk
42endif
43
44#
45# Globals
46#
47VBOX_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#
55TEMPLATE_VBOXVALIDATIONKITR3BASE = VBox Validation Kit ring-3 program base, both guest and host.
56TEMPLATE_VBOXVALIDATIONKITR3BASE_EXTENDS = VBoxR3Static
57ifeq ($(KBUILD_TARGET),win)
58 TEMPLATE_VBOXVALIDATIONKITR3BASE_LDFLAGS = $(filter-out -IntegrityCheck, $(TEMPLATE_VBoxR3Static_LDFLAGS))
59else ifn1of ($(KBUILD_TARGET), darwin solaris win)
60 TEMPLATE_VBOXVALIDATIONKITR3BASE_CFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_CFLAGS))
61 TEMPLATE_VBOXVALIDATIONKITR3BASE_CXXFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_CXXFLAGS))
62 TEMPLATE_VBOXVALIDATIONKITR3BASE_OBJCFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_OBJCFLAGS))
63 TEMPLATE_VBOXVALIDATIONKITR3BASE_LDFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_LDFLAGS))
64endif
65TEMPLATE_VBOXVALIDATIONKITR3BASE_DEFS = $(filter-out VBOX_WITH_DTRACE,$(TEMPLATE_VBoxR3Static_DEFS))
66TEMPLATE_VBOXVALIDATIONKITR3BASE_LIBS = $(TEMPLATE_VBoxR3Static_LIBS)
67if1of ($(KBUILD_TARGET), linux)
68 if $(VBOX_GCC_VERSION_CXX) < 40800
69 TEMPLATE_VBOXVALIDATIONKITR3BASE_LIBS += supc++
70 TEMPLATE_VBOXVALIDATIONKITR3BASE_LDTOOL = $(subst GXX,GCC,$(TEMPLATE_VBoxR3Static_TOOL))
71 endif
72endif
73TEMPLATE_VBOXVALIDATIONKITR3BASE_LDFLAGS.darwin = $(TEMPLATE_VBoxR3Static_LDFLAGS.darwin) -framework IOKit
74
75
76#
77# Template for building ring-3 programs for the Validation Kit.
78# These programs can run on any host or guest.
79#
80TEMPLATE_VBoxValidationKitR3 = VBox Validation Kit ring-3 program, both guest and host.
81TEMPLATE_VBoxValidationKitR3_EXTENDS = VBOXVALIDATIONKITR3BASE
82TEMPLATE_VBoxValidationKitR3_EXTENDS_BY = appending
83TEMPLATE_VBoxValidationKitR3_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
84TEMPLATE_VBoxValidationKitR3_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
85TEMPLATE_VBoxValidationKitR3_DEFS = IN_RT_R3
86TEMPLATE_VBoxValidationKitR3_LIBS.darwin = iconv
87TEMPLATE_VBoxValidationKitR3_LIBS.freebsd = iconv
88TEMPLATE_VBoxValidationKitR3_LIBS = \
89 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
90ifeq ($(KBUILD_TARGET),solaris)
91 TEMPLATE_VBoxValidationKitR3_LIBS += \
92 kstat \
93 nsl \
94 contract
95 if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
96 TEMPLATE_VBoxValidationKitR3_LIBS += \
97 smbios
98 endif
99endif
100ifneq ($(KBUILD_TARGET),win)
101 TEMPLATE_VBoxValidationKitR3_LIBS += \
102 $(SDK_VBOX_ZLIB_LIBS)
103endif
104
105# Make VCC100 output work on NT3.x, NT4, W2K, XP and W2K3.
106TEMPLATE_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)
111TEMPLATE_VBoxValidationKitR3_LDFLAGS.win.x86 = \
112 -Include:_vcc100_shell32_fakes_cpp \
113 -Include:_vcc100_shell32_fakes_asm \
114 -Section:.bss,RW!K
115ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
116 TEMPLATE_VBoxValidationKitR3_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB))$(TEMPLATE_VBOXVALIDATIONKITR3BASE_POST_CMDS)$$(NLTAB)
117endif
118TEMPLATE_VBoxValidationKitR3_LNK_DEPS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION))
119
120#TODO: TEMPLATE_VBoxValidationKitR3_EXTENDS = VBOXGUESTR3EXE
121
122TEMPLATE_VBoxValidationKitR3_USES += vboximportchecker
123TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.x86 = nt31
124TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.amd64 = xp64
125
126
127#
128# Template for ring-3 testcases to be included on the Validation Kit .ISO.
129#
130# Needed for running the ring-3 testcases on older guests (like NT4 / XP).
131# Those testcases then run as part of the Validation Kit and are included on the Validation Kit .ISO.
132# See @bugref:10195.
133#
134TEMPLATE_VBoxValidationKitR3TstExe = VBox Ring 3 Testcase Exe for Validation Kit .ISO
135TEMPLATE_VBoxValidationKitR3TstExe_EXTENDS = VBoxValidationKitR3
136TEMPLATE_VBoxValidationKitR3TstExe_INST = $(INST_VALIDATIONKIT)/testcase/$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/testcase/
137
138
139#
140# Template for building ring-3 programs for the Validation Kit.
141# When these programs run on the host they may take advantage of the
142# support driver if installed.
143#
144TEMPLATE_VBoxValidationKitR3SupDrv = VBox Validation Kit ring-3 program, mainly host.
145TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS = VBoxValidationKitR3
146TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS_BY = appending
147TEMPLATE_VBoxValidationKitR3SupDrv_DEFS = IN_SUP_R3
148TEMPLATE_VBoxValidationKitR3SupDrv_LIBS = \
149 $(PATH_STAGE_LIB)/SUPR3Static$(VBOX_SUFF_LIB) \
150 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
151TEMPLATE_VBoxValidationKitR3SupDrv_LDFLAGS.win.x86 = \
152 -Include:_vcc100_ntdll_fakes_cpp \
153 -Include:_vcc100_ntdll_fakes_asm
154
155#
156# Template for building agnostic ring-0 host modules for the Validation Kit.
157#
158TEMPLATE_VBoxValidationKitR0 = VBox Validation Kit agnostic ring-0 host module.
159TEMPLATE_VBoxValidationKitR0_EXTENDS = VBoxR0
160TEMPLATE_VBoxValidationKitR0_EXTENDS_BY = appending
161TEMPLATE_VBoxValidationKitR0_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
162TEMPLATE_VBoxValidationKitR0_DEFS = IN_RT_R0
163TEMPLATE_VBoxValidationKitR0_LIBS = \
164 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
165 $(VBOX_LIB_SUPR0)
166
167#
168# List of python sources that should be linted and unittested.
169#
170VBOX_VALIDATIONKIT_PYTHON_SOURCES :=
171VBOX_VALIDATIONKIT_PYLINT_TARGETS :=
172VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE :=
173
174ifdef VBOX_WITH_PYLINT
175 TESTING +=
176endif
177
178#
179# Process python sources.
180#
181if1of ($(KBUILD_TARGET), win os2)
182 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
183else
184 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
185endif
186BLDDIRS += $(PATH_TARGET)/pylint $(PATH_TARGET)/pyunittest
187
188define def_vbox_validationkit_py_check
189$(eval name:=$(basename $(notdir $(py))))
190
191pylint: $(name)-py-phony.o
192$(name).o: $(name)-py-phony.o
193$(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
194ifdef VBOX_WITH_PYLINT
195 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
196 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -- \
197 $(VBOX_PYLINT) --rcfile=$(VBOX_PATH_VALIDATIONKIT_SRC)/pylintrc $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
198endif
199 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
200
201ifn1of ($(py),$(VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE))
202pyunittest: $(name)-pyunittest.o
203$(PATH_TARGET)/pyunittest/$(name).o $(name)-pyunittest.o:: $(py) | $(PATH_TARGET)/pyunittest/
204 $(QUIET2)$(call MSG_L1,Unittesting Python source $(py)...)
205 $(QUIET)$(REDIRECT) -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -C $(dir $(py)) \
206 -- $(VBOX_UNITTEST_PYTHON) -m unittest -v $(notdir $(basename $(py)))
207 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pyunittest/$(name).o"
208VBOX_VALIDATIONKIT_PYUNITTEST_TARGETS += $(PATH_TARGET)/pyunittest/$(name).o
209
210TESTING += $(name)-pyunittest.o
211endif
212TESTING += $(name)-py-phony.o
213VBOX_VALIDATIONKIT_PYLINT_TARGETS += $(PATH_TARGET)/pylint/$(name).o
214endef # def_vbox_validationkit_py_check
215
216
217define def_vbox_validationkit_process_python_sources
218$(if-expr $(words $(_SUB_MAKEFILE_STACK)) <= 0 || "$1" == "FORCE", \
219 $(foreach py, $(VBOX_VALIDATIONKIT_PYTHON_SOURCES), $(eval $(def_vbox_validationkit_py_check))),)
220endef
221
222
223
224#
225# http://www.jshint.com
226#
227VBOX_JSHINT ?= jshint
228VBOX_JSHINT_FLAGS := --config $(VBOX_PATH_VALIDATIONKIT_SRC)/jshintrc.js --verbose
229ifndef VBOX_WITH_JSHINT
230 VBOX_WITH_JSHINT := $(which $(VBOX_JSHINT))
231endif
232
233#
234# List of javascript sources that should be checked and linted.
235#
236VBOX_VALIDATIONKIT_JS_SOURCES :=
237
238define def_vbox_validationkit_js_check
239$(eval name:=$(basename $(notdir $(js))))
240$(name).o $(name).obj: # $(PATH_SUB_CURRENT)/$(js)
241 -$(REDIRECT) -E LC_ALL=C -C $(dir $(js)) -- $$(VBOX_JSHINT) ./$(notdir $(js)) $$(VBOX_JSHINT_FLAGS)
242jslint: $(name).o
243endef
244
245ifdef VBOX_WITH_JSHINT
246define def_vbox_validationkit_process_js_sources
247$(if-expr $(words $(_SUB_MAKEFILE_STACK)) <= 0, \
248 $(foreach js, $(VBOX_VALIDATIONKIT_JS_SOURCES), $(eval $(def_vbox_validationkit_js_check))),)
249endef
250endif
251
252
253#
254# List of IPRT testcases that will be included in the ValKit.
255#
256ifdef VBOX_WITH_VALIDATIONKIT_UNITTESTS_PACKING
257 VALKIT_UNITTESTS_WHITELIST_IPRT := \
258 tstFile \
259 tstFileLock \
260 tstRTPathQueryInfo \
261 tstRTPipe \
262 tstRTProcCreateEx \
263 tstRTProcCreatePrf \
264 tstRTProcQueryUsername \
265 tstThread-1 \
266 tstUtf8
267
268 VALKIT_UNITTESTS_WHITELIST_IPRT.linux += \
269 tstRTProcWait \
270 tstRTProcIsRunningByName
271
272 VALKIT_UNITTESTS_WHITELIST_IPRT.win += \
273 tstRTProcWait
274
275endif # VBOX_WITH_VALIDATIONKIT_UNITTESTS_PACKING
276
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