VirtualBox

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

Last change on this file since 70509 was 70509, checked in by vboxsync, 7 years ago

ValidationKit/tests: python 3 updates.

  • 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 70509 2018-01-10 11:23:52Z vboxsync $
2## @file
3# kBuild Configuration file for the VirtualBox Validation Kit.
4#
5
6#
7# Copyright (C) 2010-2017 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 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#
44TEMPLATE_VBoxValidationKitR3Base = VBox Validation Kit ring-3 program base, both guest and host.
45TEMPLATE_VBoxValidationKitR3Base_EXTENDS = VBoxR3Static
46ifn1of ($(KBUILD_TARGET), darwin solaris win)
47 TEMPLATE_VBoxValidationKitR3Base_CFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_CFLAGS))
48 TEMPLATE_VBoxValidationKitR3Base_CXXFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_CXXFLAGS))
49 TEMPLATE_VBoxValidationKitR3Base_OBJCFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_OBJCFLAGS))
50 TEMPLATE_VBoxValidationKitR3Base_LDFLAGS = $(filter-out -static, $(TEMPLATE_VBoxR3Static_LDFLAGS))
51endif
52TEMPLATE_VBoxValidationKitR3Base_LIBS = $(TEMPLATE_VBoxR3Static_LIBS)
53if1of ($(KBUILD_TARGET), linux)
54 TEMPLATE_VBoxValidationKitR3Base_LIBS += supc++ crypt
55 TEMPLATE_VBoxValidationKitR3Base_LDTOOL = $(subst GXX,GCC,$(TEMPLATE_VBoxR3Static_TOOL))
56endif
57TEMPLATE_VBoxValidationKitR3Base_LDFLAGS.darwin = $(TEMPLATE_VBoxR3Static_LDFLAGS.darwin) -framework IOKit
58
59#
60# Template for building ring-3 progams for the Validation Kit.
61# These programs can run on any host or guest.
62#
63TEMPLATE_VBoxValidationKitR3 = VBox Validation Kit ring-3 program, both guest and host.
64TEMPLATE_VBoxValidationKitR3_EXTENDS = VBoxValidationKitR3Base
65TEMPLATE_VBoxValidationKitR3_EXTENDS_BY = appending
66TEMPLATE_VBoxValidationKitR3_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
67TEMPLATE_VBoxValidationKitR3_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
68TEMPLATE_VBoxValidationKitR3_DEFS = IN_RT_R3
69TEMPLATE_VBoxValidationKitR3_LIBS.darwin = iconv
70TEMPLATE_VBoxValidationKitR3_LIBS.freebsd = iconv
71TEMPLATE_VBoxValidationKitR3_LIBS = \
72 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
73ifdef IPRT_WITH_KSTUFF
74 TEMPLATE_VBoxValidationKitR3_LIBS += \
75 $(PATH_STAGE_LIB)/VBox-kStuffStatic$(VBOX_SUFF_LIB) \
76 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
77endif
78ifeq ($(KBUILD_TARGET),solaris)
79 TEMPLATE_VBoxValidationKitR3_LIBS += \
80 kstat \
81 nsl \
82 contract
83 if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
84 TEMPLATE_VBoxValidationKitR3_LIBS += \
85 smbios
86 endif
87endif
88ifneq ($(KBUILD_TARGET),win)
89 TEMPLATE_VBoxValidationKitR3_LIBS += \
90 $(SDK_VBOX_ZLIB_LIBS)
91endif
92
93# Make VCC100 output work on NT3.x, NT4, W2K, XP and W2K3.
94TEMPLATE_VBoxValidationKitR3_LIBS.win.x86 = \
95 $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/oldnames.lib \
96 $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
97 $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \
98 $(PATH_STAGE_LIB)/RuntimeR3VccTricks$(VBOX_SUFF_LIB)
99TEMPLATE_VBoxValidationKitR3_LDFLAGS.win.x86 = \
100 -Include:_vcc100_shell32_fakes_cpp \
101 -Include:_vcc100_shell32_fakes_asm \
102 -Section:.bss,RW!K
103ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
104 TEMPLATE_VBoxValidationKitR3_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB))$(TEMPLATE_VBoxValidationKitR3Base_POST_CMDS)$$(NLTAB)
105endif
106TEMPLATE_VBoxValidationKitR3_LNK_DEPS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION))
107
108#TODO: TEMPLATE_VBoxValidationKitR3_EXTENDS = VBOXGUESTR3EXE
109
110TEMPLATE_VBoxValidationKitR3_USES += vboximportchecker
111TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER = nt31$(error fuck)
112TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.x86 = nt31$(error fuck)
113TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.x86 = nt31$(error fuck)
114TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.amd64 = xp64
115
116
117#
118# Template for building ring-3 programs for the Validation Kit.
119# These programs can run on the host and may take advantage of the support
120# driver when installed.
121#
122TEMPLATE_VBoxValidationKitR3Host = VBox Validation Kit ring-3 program, mainly host.
123TEMPLATE_VBoxValidationKitR3Host_EXTENDS = VBoxValidationKitR3Base
124TEMPLATE_VBoxValidationKitR3Host_EXTENDS_BY = appending
125TEMPLATE_VBoxValidationKitR3Host_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
126TEMPLATE_VBoxValidationKitR3Host_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
127TEMPLATE_VBoxValidationKitR3Host_DEFS = IN_RT_R3 IN_SUP_R3
128TEMPLATE_VBoxValidationKitR3Host_LIBS.darwin = iconv
129TEMPLATE_VBoxValidationKitR3Host_LIBS.freebsd = iconv
130TEMPLATE_VBoxValidationKitR3Host_LIBS = \
131 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB) \
132 $(PATH_STAGE_LIB)/SUPR3Static$(VBOX_SUFF_LIB) \
133 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
134ifdef IPRT_WITH_KSTUFF
135 TEMPLATE_VBoxValidationKitR3Host_LIBS += \
136 $(PATH_STAGE_LIB)/VBox-kStuffStatic$(VBOX_SUFF_LIB) \
137 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
138endif
139ifeq ($(KBUILD_TARGET),solaris)
140 TEMPLATE_VBoxValidationKitR3Host_LIBS += \
141 kstat \
142 nsl \
143 contract
144 if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
145 TEMPLATE_VBoxValidationKitR3Host_LIBS += \
146 smbios
147 endif
148endif
149
150#
151# Template for building agnostic ring-0 host modules for the Validation Kit.
152#
153TEMPLATE_VBoxValidationKitR0 = VBox Validation Kit agnostic ring-0 host module.
154TEMPLATE_VBoxValidationKitR0_EXTENDS = VBoxR0
155TEMPLATE_VBoxValidationKitR0_EXTENDS_BY = appending
156TEMPLATE_VBoxValidationKitR0_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
157TEMPLATE_VBoxValidationKitR0_DEFS = IN_RT_R0
158TEMPLATE_VBoxValidationKitR0_LIBS = \
159 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
160if1of ($(KBUILD_TARGET),os2 win)
161 TEMPLATE_VBoxValidationKitR0_LIBS += \
162 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
163endif
164
165#
166# List of python sources that should be linted and unittested.
167#
168VBOX_VALIDATIONKIT_PYTHON_SOURCES :=
169VBOX_VALIDATIONKIT_PYLINT_TARGETS :=
170VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE :=
171
172ifdef VBOX_WITH_PYLINT
173 TESTING +=
174endif
175
176#
177# Process python sources.
178#
179if1of ($(KBUILD_TARGET), win os2)
180 VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH);$(VBOX_PATH_VALIDATIONKIT_SRC);$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript;$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager:$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll
181else
182 VBOX_PYTHONPATH_VALIDATIONKIT = $(PYTHONPATH):$(VBOX_PATH_VALIDATIONKIT_SRC):$(VBOX_PATH_VALIDATIONKIT_SRC)/testboxscript:$(VBOX_PATH_VALIDATIONKIT_SRC)/testmanager;$(VBOX_PATH_VALIDATIONKIT_SRC)/../VMM/VMMAll
183endif
184BLDDIRS += $(PATH_TARGET)/pylint $(PATH_TARGET)/pyunittest
185
186define def_vbox_validationkit_py_check
187$(eval name:=$(basename $(notdir $(py))))
188
189pylint:: $(name)-py-phony.o
190$(name).o: $(name)-py-phony.o
191$(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
192ifdef VBOX_WITH_PYLINT
193 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
194 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -- \
195 $(VBOX_PYLINT) --rcfile=$(VBOX_PATH_VALIDATIONKIT_SRC)/pylintrc $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
196endif
197 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
198
199ifn1of ($(py),$(VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE))
200pyunittest:: $(name)-pyunittest.o
201$(PATH_TARGET)/pyunittest/$(name).o $(name)-pyunittest.o:: $(py) | $(PATH_TARGET)/pyunittest/
202 $(QUIET2)$(call MSG_L1,Unittesting Python source $(py)...)
203 $(QUIET)$(REDIRECT) -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -C $(dir $(py)) \
204 -- $(VBOX_BLD_PYTHON) -m unittest -v $(notdir $(basename $(py)))
205 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pyunittest/$(name).o"
206VBOX_VALIDATIONKIT_PYUNITTEST_TARGETS += $(PATH_TARGET)/pyunittest/$(name).o
207
208TESTING += $(name)-pyunittest.o
209endif
210TESTING += $(name)-py-phony.o
211VBOX_VALIDATIONKIT_PYLINT_TARGETS += $(PATH_TARGET)/pylint/$(name).o
212endef # def_vbox_validationkit_py_check
213
214
215define def_vbox_validationkit_process_python_sources
216$(if-expr $(words $(_SUB_MAKEFILE_STACK)) <= 0 || "$1" == "FORCE", \
217 $(foreach py, $(VBOX_VALIDATIONKIT_PYTHON_SOURCES), $(eval $(def_vbox_validationkit_py_check))),)
218endef
219
220
221
222#
223# http://www.jshint.com
224#
225VBOX_JSHINT ?= jshint
226VBOX_JSHINT_FLAGS := --config $(VBOX_PATH_VALIDATIONKIT_SRC)/jshintrc.js --verbose
227ifndef VBOX_WITH_JSHINT
228 VBOX_WITH_JSHINT := $(which $(VBOX_JSHINT))
229endif
230
231#
232# List of javascript sources that should be checked and linted.
233#
234VBOX_VALIDATIONKIT_JS_SOURCES :=
235
236define def_vbox_validationkit_js_check
237$(eval name:=$(basename $(notdir $(js))))
238$(name).o $(name).obj:: # $(PATH_SUB_CURRENT)/$(js)
239 -$(REDIRECT) -E LC_ALL=C -C $(dir $(js)) -- $$(VBOX_JSHINT) ./$(notdir $(js)) $$(VBOX_JSHINT_FLAGS)
240jslint:: $(name).o
241endef
242
243define def_vbox_validationkit_process_js_sources
244$(if-expr $(words $(_SUB_MAKEFILE_STACK)) <= 0, \
245 $(foreach js, $(VBOX_VALIDATIONKIT_JS_SOURCES), $(eval $(def_vbox_validationkit_js_check))),)
246endef
247
Note: See TracBrowser for help on using the repository browser.

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