VirtualBox

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

Last change on this file since 88956 was 88284, checked in by vboxsync, 4 years ago

ValKit/Config.kmk: Link against libsupc++ only when g++ is older than 4.8 (may need polishing, all I know at this point is that gcc 4.8.5 on OL7 doesn't have it and doesn't need it).

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