VirtualBox

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

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

Validation Kit/unit tests: Cleaned up build templates by moving the Validation Kit-specific ones to ValidationKit/Config.kmk + derive TEMPLATE_VBoxValidationKitR3TstExe from VBoxValidationKitR3, as loader trickery is also needed here for older guests (XP and friends). bugref:10195

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