VirtualBox

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

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

Validation Kit: Moved TEMPLATE_VBOXVALIDATIONKITR3BASE to main Config.kmk and derive TEMPLATE_VBOXR3TSTEXE_VALKIT from it instead of TEMPLATE_VBoxR3Static. That way it's easier to maintain and not forgotten when we need to do more widespread changes (e.g. see r151253). bugref:​10195

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
Line 
1# $Id: Config.kmk 94861 2022-05-05 17:08:34Z 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# Template for building ring-3 programs for the Validation Kit.
42# These programs can run on any host or guest.
43#
44TEMPLATE_VBoxValidationKitR3 = VBox Validation Kit ring-3 program, both guest and host.
45TEMPLATE_VBoxValidationKitR3_EXTENDS = VBOXVALIDATIONKITR3BASE
46TEMPLATE_VBoxValidationKitR3_EXTENDS_BY = appending
47TEMPLATE_VBoxValidationKitR3_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
48TEMPLATE_VBoxValidationKitR3_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
49TEMPLATE_VBoxValidationKitR3_DEFS = IN_RT_R3
50TEMPLATE_VBoxValidationKitR3_LIBS.darwin = iconv
51TEMPLATE_VBoxValidationKitR3_LIBS.freebsd = iconv
52TEMPLATE_VBoxValidationKitR3_LIBS = \
53 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
54ifeq ($(KBUILD_TARGET),solaris)
55 TEMPLATE_VBoxValidationKitR3_LIBS += \
56 kstat \
57 nsl \
58 contract
59 if1of ($(KBUILD_TARGET_ARCH), amd64 x86)
60 TEMPLATE_VBoxValidationKitR3_LIBS += \
61 smbios
62 endif
63endif
64ifneq ($(KBUILD_TARGET),win)
65 TEMPLATE_VBoxValidationKitR3_LIBS += \
66 $(SDK_VBOX_ZLIB_LIBS)
67endif
68
69# Make VCC100 output work on NT3.x, NT4, W2K, XP and W2K3.
70TEMPLATE_VBoxValidationKitR3_LIBS.win.x86 = \
71 $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/oldnames.lib \
72 $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
73 $(PATH_TOOL_$(TEMPLATE_VBoxValidationKitR3_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \
74 $(PATH_STAGE_LIB)/RuntimeR3VccTricks$(VBOX_SUFF_LIB)
75TEMPLATE_VBoxValidationKitR3_LDFLAGS.win.x86 = \
76 -Include:_vcc100_shell32_fakes_cpp \
77 -Include:_vcc100_shell32_fakes_asm \
78 -Section:.bss,RW!K
79ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
80 TEMPLATE_VBoxValidationKitR3_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB))$(TEMPLATE_VBOXVALIDATIONKITR3BASE_POST_CMDS)$$(NLTAB)
81endif
82TEMPLATE_VBoxValidationKitR3_LNK_DEPS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION))
83
84#TODO: TEMPLATE_VBoxValidationKitR3_EXTENDS = VBOXGUESTR3EXE
85
86TEMPLATE_VBoxValidationKitR3_USES += vboximportchecker
87TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.x86 = nt31
88TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.amd64 = xp64
89
90
91#
92# Template for building ring-3 programs for the Validation Kit.
93# When these programs run on the host they may take advantage of the
94# support driver if installed.
95#
96TEMPLATE_VBoxValidationKitR3SupDrv = VBox Validation Kit ring-3 program, mainly host.
97TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS = VBoxValidationKitR3
98TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS_BY = appending
99TEMPLATE_VBoxValidationKitR3SupDrv_DEFS = IN_SUP_R3
100TEMPLATE_VBoxValidationKitR3SupDrv_LIBS = \
101 $(PATH_STAGE_LIB)/SUPR3Static$(VBOX_SUFF_LIB) \
102 $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
103TEMPLATE_VBoxValidationKitR3SupDrv_LDFLAGS.win.x86 = \
104 -Include:_vcc100_ntdll_fakes_cpp \
105 -Include:_vcc100_ntdll_fakes_asm
106
107#
108# Template for building agnostic ring-0 host modules for the Validation Kit.
109#
110TEMPLATE_VBoxValidationKitR0 = VBox Validation Kit agnostic ring-0 host module.
111TEMPLATE_VBoxValidationKitR0_EXTENDS = VBoxR0
112TEMPLATE_VBoxValidationKitR0_EXTENDS_BY = appending
113TEMPLATE_VBoxValidationKitR0_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
114TEMPLATE_VBoxValidationKitR0_DEFS = IN_RT_R0
115TEMPLATE_VBoxValidationKitR0_LIBS = \
116 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
117 $(VBOX_LIB_SUPR0)
118
119#
120# List of python sources that should be linted and unittested.
121#
122VBOX_VALIDATIONKIT_PYTHON_SOURCES :=
123VBOX_VALIDATIONKIT_PYLINT_TARGETS :=
124VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE :=
125
126ifdef VBOX_WITH_PYLINT
127 TESTING +=
128endif
129
130#
131# Process python sources.
132#
133if1of ($(KBUILD_TARGET), win os2)
134 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
135else
136 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
137endif
138BLDDIRS += $(PATH_TARGET)/pylint $(PATH_TARGET)/pyunittest
139
140define def_vbox_validationkit_py_check
141$(eval name:=$(basename $(notdir $(py))))
142
143pylint: $(name)-py-phony.o
144$(name).o: $(name)-py-phony.o
145$(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
146ifdef VBOX_WITH_PYLINT
147 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
148 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -- \
149 $(VBOX_PYLINT) --rcfile=$(VBOX_PATH_VALIDATIONKIT_SRC)/pylintrc $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
150endif
151 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
152
153ifn1of ($(py),$(VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE))
154pyunittest: $(name)-pyunittest.o
155$(PATH_TARGET)/pyunittest/$(name).o $(name)-pyunittest.o:: $(py) | $(PATH_TARGET)/pyunittest/
156 $(QUIET2)$(call MSG_L1,Unittesting Python source $(py)...)
157 $(QUIET)$(REDIRECT) -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VALIDATIONKIT)" -C $(dir $(py)) \
158 -- $(VBOX_UNITTEST_PYTHON) -m unittest -v $(notdir $(basename $(py)))
159 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pyunittest/$(name).o"
160VBOX_VALIDATIONKIT_PYUNITTEST_TARGETS += $(PATH_TARGET)/pyunittest/$(name).o
161
162TESTING += $(name)-pyunittest.o
163endif
164TESTING += $(name)-py-phony.o
165VBOX_VALIDATIONKIT_PYLINT_TARGETS += $(PATH_TARGET)/pylint/$(name).o
166endef # def_vbox_validationkit_py_check
167
168
169define def_vbox_validationkit_process_python_sources
170$(if-expr $(words $(_SUB_MAKEFILE_STACK)) <= 0 || "$1" == "FORCE", \
171 $(foreach py, $(VBOX_VALIDATIONKIT_PYTHON_SOURCES), $(eval $(def_vbox_validationkit_py_check))),)
172endef
173
174
175
176#
177# http://www.jshint.com
178#
179VBOX_JSHINT ?= jshint
180VBOX_JSHINT_FLAGS := --config $(VBOX_PATH_VALIDATIONKIT_SRC)/jshintrc.js --verbose
181ifndef VBOX_WITH_JSHINT
182 VBOX_WITH_JSHINT := $(which $(VBOX_JSHINT))
183endif
184
185#
186# List of javascript sources that should be checked and linted.
187#
188VBOX_VALIDATIONKIT_JS_SOURCES :=
189
190define def_vbox_validationkit_js_check
191$(eval name:=$(basename $(notdir $(js))))
192$(name).o $(name).obj: # $(PATH_SUB_CURRENT)/$(js)
193 -$(REDIRECT) -E LC_ALL=C -C $(dir $(js)) -- $$(VBOX_JSHINT) ./$(notdir $(js)) $$(VBOX_JSHINT_FLAGS)
194jslint: $(name).o
195endef
196
197ifdef VBOX_WITH_JSHINT
198define def_vbox_validationkit_process_js_sources
199$(if-expr $(words $(_SUB_MAKEFILE_STACK)) <= 0, \
200 $(foreach js, $(VBOX_VALIDATIONKIT_JS_SOURCES), $(eval $(def_vbox_validationkit_js_check))),)
201endef
202endif
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