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 |
|
---|
27 | VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED = 1
|
---|
28 |
|
---|
29 | # Include the top-level configure file.
|
---|
30 | ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
|
---|
31 | include $(PATH_ROOT)/Config.kmk
|
---|
32 | endif
|
---|
33 |
|
---|
34 | #
|
---|
35 | # Globals
|
---|
36 | #
|
---|
37 | VBOX_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 | #
|
---|
44 | TEMPLATE_VBoxValidationKitR3 = VBox Validation Kit ring-3 program, both guest and host.
|
---|
45 | TEMPLATE_VBoxValidationKitR3_EXTENDS = VBOXVALIDATIONKITR3BASE
|
---|
46 | TEMPLATE_VBoxValidationKitR3_EXTENDS_BY = appending
|
---|
47 | TEMPLATE_VBoxValidationKitR3_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
|
---|
48 | TEMPLATE_VBoxValidationKitR3_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
|
---|
49 | TEMPLATE_VBoxValidationKitR3_DEFS = IN_RT_R3
|
---|
50 | TEMPLATE_VBoxValidationKitR3_LIBS.darwin = iconv
|
---|
51 | TEMPLATE_VBoxValidationKitR3_LIBS.freebsd = iconv
|
---|
52 | TEMPLATE_VBoxValidationKitR3_LIBS = \
|
---|
53 | $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
|
---|
54 | ifeq ($(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
|
---|
63 | endif
|
---|
64 | ifneq ($(KBUILD_TARGET),win)
|
---|
65 | TEMPLATE_VBoxValidationKitR3_LIBS += \
|
---|
66 | $(SDK_VBOX_ZLIB_LIBS)
|
---|
67 | endif
|
---|
68 |
|
---|
69 | # Make VCC100 output work on NT3.x, NT4, W2K, XP and W2K3.
|
---|
70 | TEMPLATE_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)
|
---|
75 | TEMPLATE_VBoxValidationKitR3_LDFLAGS.win.x86 = \
|
---|
76 | -Include:_vcc100_shell32_fakes_cpp \
|
---|
77 | -Include:_vcc100_shell32_fakes_asm \
|
---|
78 | -Section:.bss,RW!K
|
---|
79 | ifeq ($(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)
|
---|
81 | endif
|
---|
82 | TEMPLATE_VBoxValidationKitR3_LNK_DEPS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION))
|
---|
83 |
|
---|
84 | #TODO: TEMPLATE_VBoxValidationKitR3_EXTENDS = VBOXGUESTR3EXE
|
---|
85 |
|
---|
86 | TEMPLATE_VBoxValidationKitR3_USES += vboximportchecker
|
---|
87 | TEMPLATE_VBoxValidationKitR3_VBOX_IMPORT_CHECKER.win.x86 = nt31
|
---|
88 | TEMPLATE_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 | #
|
---|
96 | TEMPLATE_VBoxValidationKitR3SupDrv = VBox Validation Kit ring-3 program, mainly host.
|
---|
97 | TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS = VBoxValidationKitR3
|
---|
98 | TEMPLATE_VBoxValidationKitR3SupDrv_EXTENDS_BY = appending
|
---|
99 | TEMPLATE_VBoxValidationKitR3SupDrv_DEFS = IN_SUP_R3
|
---|
100 | TEMPLATE_VBoxValidationKitR3SupDrv_LIBS = \
|
---|
101 | $(PATH_STAGE_LIB)/SUPR3Static$(VBOX_SUFF_LIB) \
|
---|
102 | $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
|
---|
103 | TEMPLATE_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 | #
|
---|
110 | TEMPLATE_VBoxValidationKitR0 = VBox Validation Kit agnostic ring-0 host module.
|
---|
111 | TEMPLATE_VBoxValidationKitR0_EXTENDS = VBoxR0
|
---|
112 | TEMPLATE_VBoxValidationKitR0_EXTENDS_BY = appending
|
---|
113 | TEMPLATE_VBoxValidationKitR0_INST = $(INST_VALIDATIONKIT)$(KBUILD_TARGET)/$(KBUILD_TARGET_ARCH)/
|
---|
114 | TEMPLATE_VBoxValidationKitR0_DEFS = IN_RT_R0
|
---|
115 | TEMPLATE_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 | #
|
---|
122 | VBOX_VALIDATIONKIT_PYTHON_SOURCES :=
|
---|
123 | VBOX_VALIDATIONKIT_PYLINT_TARGETS :=
|
---|
124 | VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE :=
|
---|
125 |
|
---|
126 | ifdef VBOX_WITH_PYLINT
|
---|
127 | TESTING +=
|
---|
128 | endif
|
---|
129 |
|
---|
130 | #
|
---|
131 | # Process python sources.
|
---|
132 | #
|
---|
133 | if1of ($(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
|
---|
135 | else
|
---|
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
|
---|
137 | endif
|
---|
138 | BLDDIRS += $(PATH_TARGET)/pylint $(PATH_TARGET)/pyunittest
|
---|
139 |
|
---|
140 | define def_vbox_validationkit_py_check
|
---|
141 | $(eval name:=$(basename $(notdir $(py))))
|
---|
142 |
|
---|
143 | pylint: $(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/
|
---|
146 | ifdef 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))
|
---|
150 | endif
|
---|
151 | $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
|
---|
152 |
|
---|
153 | ifn1of ($(py),$(VBOX_VALIDATIONKIT_PYUNITTEST_EXCLUDE))
|
---|
154 | pyunittest: $(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"
|
---|
160 | VBOX_VALIDATIONKIT_PYUNITTEST_TARGETS += $(PATH_TARGET)/pyunittest/$(name).o
|
---|
161 |
|
---|
162 | TESTING += $(name)-pyunittest.o
|
---|
163 | endif
|
---|
164 | TESTING += $(name)-py-phony.o
|
---|
165 | VBOX_VALIDATIONKIT_PYLINT_TARGETS += $(PATH_TARGET)/pylint/$(name).o
|
---|
166 | endef # def_vbox_validationkit_py_check
|
---|
167 |
|
---|
168 |
|
---|
169 | define 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))),)
|
---|
172 | endef
|
---|
173 |
|
---|
174 |
|
---|
175 |
|
---|
176 | #
|
---|
177 | # http://www.jshint.com
|
---|
178 | #
|
---|
179 | VBOX_JSHINT ?= jshint
|
---|
180 | VBOX_JSHINT_FLAGS := --config $(VBOX_PATH_VALIDATIONKIT_SRC)/jshintrc.js --verbose
|
---|
181 | ifndef VBOX_WITH_JSHINT
|
---|
182 | VBOX_WITH_JSHINT := $(which $(VBOX_JSHINT))
|
---|
183 | endif
|
---|
184 |
|
---|
185 | #
|
---|
186 | # List of javascript sources that should be checked and linted.
|
---|
187 | #
|
---|
188 | VBOX_VALIDATIONKIT_JS_SOURCES :=
|
---|
189 |
|
---|
190 | define 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)
|
---|
194 | jslint: $(name).o
|
---|
195 | endef
|
---|
196 |
|
---|
197 | ifdef VBOX_WITH_JSHINT
|
---|
198 | define 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))),)
|
---|
201 | endef
|
---|
202 | endif
|
---|