1 | # $Id: Makefile.kmk 39070 2011-10-21 09:41:18Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VMM testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2010 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 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | #
|
---|
22 | # Target lists.
|
---|
23 | #
|
---|
24 | PROGRAMS += tstVMStructSize tstAsmStructs
|
---|
25 | ifdef VBOX_WITH_RAW_MODE
|
---|
26 | PROGRAMS += tstVMStructRC tstAsmStructsRC
|
---|
27 | endif
|
---|
28 | ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
29 | PROGRAMS += tstGlobalConfig tstInstrEmul
|
---|
30 | ifdef VBOX_WITH_RAW_MODE
|
---|
31 | PROGRAMS += tstVMM tstVMM-HwAccm
|
---|
32 | ifneq ($(KBUILD_TARGET),win)
|
---|
33 | PROGRAMS += tstVMMFork
|
---|
34 | endif
|
---|
35 | endif
|
---|
36 | ifdef VBOX_WITH_TESTCASES
|
---|
37 | PROGRAMS += \
|
---|
38 | tstCFGM \
|
---|
39 | tstCompiler \
|
---|
40 | tstCompressionBenchmark \
|
---|
41 | tstIEMCheckMc \
|
---|
42 | tstMMHyperHeap \
|
---|
43 | tstSSM \
|
---|
44 | tstVMMR0CallHost-1 \
|
---|
45 | tstVMMR0CallHost-2 \
|
---|
46 | tstVMREQ
|
---|
47 | ifn1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), solaris.x86 solaris.amd64 win.amd64 ) ## TODO: Fix the code.
|
---|
48 | PROGRAMS += tstX86-1
|
---|
49 | endif
|
---|
50 | ifneq ($(KBUILD_TARGET),l4)
|
---|
51 | PROGRAMS += tstAnimate
|
---|
52 | endif
|
---|
53 | ifdef VBOX_WITH_RAW_MODE
|
---|
54 | PROGRAMS += tstMicro
|
---|
55 | SYSMODS += tstMicroRC
|
---|
56 | endif
|
---|
57 | ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
|
---|
58 | PROGRAMS += tstPDMAsyncCompletion
|
---|
59 | PROGRAMS += tstPDMAsyncCompletionStress
|
---|
60 | endif
|
---|
61 | endif # VBOX_WITH_TESTCASES
|
---|
62 | endif # !VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
63 |
|
---|
64 | # Where we put our temporary files (just for simplicity)
|
---|
65 | VBOX_VMM_TESTCASE_OUT_DIR := $(PATH_TARGET)/VMM
|
---|
66 | BLDDIRS += $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
67 |
|
---|
68 | #
|
---|
69 | # We setup two 'other' targets for executing the two structure & alignment
|
---|
70 | # validation testcases. Perhaps a bit hackish, but extremely useful.
|
---|
71 | #
|
---|
72 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
|
---|
73 | ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
|
---|
74 | OTHERS += \
|
---|
75 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
76 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
77 | endif
|
---|
78 | endif
|
---|
79 |
|
---|
80 | # The normal testing pass.
|
---|
81 | TESTING += \
|
---|
82 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
83 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
84 | ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
85 | TESTING += \
|
---|
86 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run
|
---|
87 | endif
|
---|
88 |
|
---|
89 | OTHER_CLEAN += \
|
---|
90 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
91 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run \
|
---|
92 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run \
|
---|
93 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.h \
|
---|
94 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o \
|
---|
95 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
|
---|
96 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.o \
|
---|
97 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.lst \
|
---|
98 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.h.dump \
|
---|
99 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h \
|
---|
100 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h \
|
---|
101 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
|
---|
102 |
|
---|
103 | #
|
---|
104 | # Globals
|
---|
105 | #
|
---|
106 | VBOX_PATH_VMM_SRC = $(PATH_ROOT)/src/VBox/VMM
|
---|
107 |
|
---|
108 | #
|
---|
109 | # Targets
|
---|
110 | #
|
---|
111 | ifdef VBOX_WITH_RAW_MODE
|
---|
112 | tstVMStructRC_TEMPLATE = VBoxRcExe
|
---|
113 | tstVMStructRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE
|
---|
114 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
|
---|
115 | tstVMStructRC_DEFS += \
|
---|
116 | VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC \
|
---|
117 | VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_RC
|
---|
118 | endif
|
---|
119 | ifdef VBOX_WITH_R0_LOGGING
|
---|
120 | tstVMStructRC_DEFS += VBOX_WITH_R0_LOGGING
|
---|
121 | endif
|
---|
122 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
123 | tstVMStructRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
124 | endif
|
---|
125 | tstVMStructRC_SOURCES = tstVMStructRC.cpp
|
---|
126 | tstVMStructRC_INCS = \
|
---|
127 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
128 | $(VBOX_PATH_VMM_SRC)/PATM
|
---|
129 | endif
|
---|
130 |
|
---|
131 | tstVMStructSize_TEMPLATE= VBOXR3AUTOTST
|
---|
132 | tstVMStructSize_DEFS = IN_VMM_R3 IN_DIS
|
---|
133 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
|
---|
134 | tstVMStructSize_DEFS += \
|
---|
135 | VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
|
---|
136 | VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
|
---|
137 | endif
|
---|
138 | ifdef VBOX_WITH_RAW_MODE
|
---|
139 | tstVMStructSize_DEFS += VBOX_WITH_RAW_MODE
|
---|
140 | endif
|
---|
141 | tstVMStructSize_INCS = \
|
---|
142 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
143 | $(VBOX_PATH_VMM_SRC)/PATM \
|
---|
144 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
145 | tstVMStructSize_SOURCES = tstVMStructSize.cpp
|
---|
146 | ifdef VBOX_WITH_RAW_MODE
|
---|
147 | tstVMStructSize.cpp_DEPS= $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
|
---|
148 | endif
|
---|
149 | ifdef VBOX_WITH_R0_LOGGING
|
---|
150 | tstVMStructSize_DEFS += VBOX_WITH_R0_LOGGING
|
---|
151 | endif
|
---|
152 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
153 | tstVMStructSize_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
154 | endif
|
---|
155 |
|
---|
156 | tstAsmStructs_TEMPLATE = VBOXR3AUTOTST
|
---|
157 | tstAsmStructs_DEFS = IN_VMM_R3 IN_DIS
|
---|
158 | ifdef VBOX_WITH_RAW_MODE
|
---|
159 | tstAsmStructs_DEFS += VBOX_WITH_RAW_MODE
|
---|
160 | endif
|
---|
161 | ifdef VBOX_WITH_R0_LOGGING
|
---|
162 | tstAsmStructs_DEFS += VBOX_WITH_R0_LOGGING
|
---|
163 | endif
|
---|
164 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
165 | tstAsmStructs_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
166 | endif
|
---|
167 | tstAsmStructs_INCS = \
|
---|
168 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
169 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
170 | tstAsmStructs_SOURCES = tstAsmStructs.cpp
|
---|
171 | tstAsmStructs.cpp_DEPS = $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
|
---|
172 |
|
---|
173 | ifdef VBOX_WITH_RAW_MODE
|
---|
174 | tstAsmStructsRC_TEMPLATE= VBoxRcExe
|
---|
175 | tstAsmStructsRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE
|
---|
176 | ifdef VBOX_WITH_R0_LOGGING
|
---|
177 | tstAsmStructsRC_DEFS += VBOX_WITH_R0_LOGGING
|
---|
178 | endif
|
---|
179 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
180 | tstAsmStructsRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
181 | endif
|
---|
182 | tstAsmStructsRC_INCS = \
|
---|
183 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
184 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
185 | tstAsmStructsRC_SOURCES = tstAsmStructs.cpp
|
---|
186 | tstAsmStructs.cpp_DEPS += $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h
|
---|
187 | endif # VBOX_WITH_RAW_MODE
|
---|
188 |
|
---|
189 |
|
---|
190 | tstGlobalConfig_TEMPLATE= VBOXR3TSTEXE
|
---|
191 | tstGlobalConfig_SOURCES = tstGlobalConfig.cpp
|
---|
192 | tstGlobalConfig_LIBS = $(LIB_RUNTIME)
|
---|
193 |
|
---|
194 | tstIEMCheckMc_TEMPLATE = VBOXR3TSTEXE
|
---|
195 | tstIEMCheckMc_SOURCES = tstIEMCheckMc.cpp
|
---|
196 | tstIEMCheckMc_LIBS = $(LIB_RUNTIME)
|
---|
197 | ifneq ($(KBUILD_TARGET),win)
|
---|
198 | tstIEMCheckMc_CXXFLAGS = -Wno-unused-parameter
|
---|
199 | endif
|
---|
200 |
|
---|
201 | tstMMHyperHeap_TEMPLATE = VBOXR3TSTEXE
|
---|
202 | tstMMHyperHeap_SOURCES = tstMMHyperHeap.cpp
|
---|
203 | tstMMHyperHeap_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
204 |
|
---|
205 | tstSSM_TEMPLATE = VBOXR3TSTEXE
|
---|
206 | tstSSM_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
207 | tstSSM_SOURCES = tstSSM.cpp
|
---|
208 | tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
209 |
|
---|
210 | tstInstrEmul_TEMPLATE = VBOXR3EXE
|
---|
211 | tstInstrEmul_SOURCES = tstInstrEmul.cpp ../VMMAll/EMAllA.asm
|
---|
212 | tstInstrEmul_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
213 |
|
---|
214 | tstCFGM_TEMPLATE = VBOXR3TSTEXE
|
---|
215 | tstCFGM_SOURCES = tstCFGM.cpp
|
---|
216 | tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
217 |
|
---|
218 | tstCompressionBenchmark_TEMPLATE = VBOXR3TSTEXE
|
---|
219 | tstCompressionBenchmark_SOURCES = tstCompressionBenchmark.cpp
|
---|
220 |
|
---|
221 | tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
|
---|
222 | tstVMMR0CallHost-1_DEFS = VMM_R0_NO_SWITCH_STACK
|
---|
223 | tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
224 | tstVMMR0CallHost-1_SOURCES = \
|
---|
225 | tstVMMR0CallHost-1.cpp
|
---|
226 | tstVMMR0CallHost-1_SOURCES.amd64 = \
|
---|
227 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
|
---|
228 | tstVMMR0CallHost-1_SOURCES.x86 = \
|
---|
229 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
|
---|
230 |
|
---|
231 | tstVMMR0CallHost-2_EXTENDS = tstVMMR0CallHost-1
|
---|
232 | tstVMMR0CallHost-2_DEFS = VMM_R0_SWITCH_STACK
|
---|
233 |
|
---|
234 | tstVMREQ_TEMPLATE = VBOXR3EXE
|
---|
235 | tstVMREQ_SOURCES = tstVMREQ.cpp
|
---|
236 | tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
237 |
|
---|
238 | tstAnimate_TEMPLATE = VBOXR3EXE
|
---|
239 | tstAnimate_SOURCES = tstAnimate.cpp
|
---|
240 | tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
241 |
|
---|
242 | tstCompiler_TEMPLATE = VBOXR3TSTEXE
|
---|
243 | tstCompiler_SOURCES = tstCompiler.cpp
|
---|
244 | tstCompiler_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
245 |
|
---|
246 | tstX86-1_TEMPLATE = VBOXR3TSTEXE
|
---|
247 | tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
|
---|
248 | tstX86-1_LIBS = $(LIB_RUNTIME)
|
---|
249 |
|
---|
250 | ifdef VBOX_WITH_RAW_MODE
|
---|
251 |
|
---|
252 | tstVMM_TEMPLATE = VBOXR3EXE
|
---|
253 | tstVMM_SOURCES = tstVMM.cpp
|
---|
254 | tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
255 |
|
---|
256 | tstVMM-HwAccm_TEMPLATE = VBOXR3EXE
|
---|
257 | tstVMM-HwAccm_SOURCES = tstVMM-HwAccm.cpp
|
---|
258 | tstVMM-HwAccm_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
259 |
|
---|
260 | tstVMMFork_TEMPLATE = VBOXR3EXE
|
---|
261 | tstVMMFork_SOURCES = tstVMMFork.cpp
|
---|
262 | tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
263 |
|
---|
264 | tstMicro_TEMPLATE = VBOXR3EXE
|
---|
265 | tstMicro_SOURCES = tstMicro.cpp
|
---|
266 | tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
267 |
|
---|
268 | tstMicroRC_TEMPLATE = VBoxRc
|
---|
269 | tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
|
---|
270 | tstMicroRC_DEFS =
|
---|
271 | tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
|
---|
272 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
273 | tstMicroRC_LDFLAGS = -Entry:tstMicroRC
|
---|
274 | endif
|
---|
275 | tstMicroRC_SYSSUFF = .gc
|
---|
276 | tstMicroRC_LIBS = \
|
---|
277 | $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
|
---|
278 | $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
|
---|
279 | ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
|
---|
280 | tstMicroRC_LIBS += \
|
---|
281 | $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
|
---|
282 | $(LIB_VMMGC)
|
---|
283 | endif
|
---|
284 | tstMicroRC_SOURCES.win = tstMicroRC.def
|
---|
285 |
|
---|
286 | endif # VBOX_WITH_RAW_MODE
|
---|
287 |
|
---|
288 | ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
|
---|
289 | tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
|
---|
290 | tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
291 | tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
|
---|
292 | tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
293 |
|
---|
294 | tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
|
---|
295 | tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
296 | tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
|
---|
297 | tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
298 | endif
|
---|
299 |
|
---|
300 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
301 |
|
---|
302 |
|
---|
303 | #
|
---|
304 | # Run rule for tstInstrEmul.
|
---|
305 | #
|
---|
306 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run: $$(tstInstrEmul_1_STAGE_TARGET) | $$(dir $$@)
|
---|
307 | $(QUIET)$(RM) -f $@
|
---|
308 | $(QUIET)$(REDIRECT) -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
|
---|
309 | $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
|
---|
310 | -- \
|
---|
311 | $(tstInstrEmul_1_STAGE_TARGET)
|
---|
312 | $(QUIET)$(APPEND) "$@" "done"
|
---|
313 |
|
---|
314 |
|
---|
315 | #
|
---|
316 | # Some handcrafted support targets for tstAsmStructs.
|
---|
317 | #
|
---|
318 |
|
---|
319 | ifeq ($(KBUILD_HOST),win)
|
---|
320 | ifndef TOOL_MINGW32
|
---|
321 | include $(KBUILD_PATH)/tools/MINGW32.kmk
|
---|
322 | endif
|
---|
323 | VBOX_NM ?= $(PATH_TOOL_MINGW32)/bin/nm.exe -p
|
---|
324 | else
|
---|
325 | VBOX_NM ?= nm -p
|
---|
326 | endif
|
---|
327 |
|
---|
328 | MY_ASA_ASM_STUFF = \
|
---|
329 | $(addprefix -D, \
|
---|
330 | $(DEFS) \
|
---|
331 | $(DEFS.$(KBUILD_TYPE)) \
|
---|
332 | $(DEFS.$(KBUILD_TARGET)) \
|
---|
333 | IN_RING3 $(ARCH_BITS_DEFS) \
|
---|
334 | $(DEFS.$(KBUILD_TARGET_ARCH)) \
|
---|
335 | $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
336 | $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
|
---|
337 | ) \
|
---|
338 | -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
|
---|
339 | $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
|
---|
340 | ,-I$(inc)/)
|
---|
341 |
|
---|
342 | # 1a. make a header file which makes all the structures+members globals.
|
---|
343 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
|
---|
344 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
345 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
|
---|
346 | $(DEPTH)/include/iprt/asmdefs.mac \
|
---|
347 | $(DEPTH)/include/VBox/vmm/cpum.mac \
|
---|
348 | $(DEPTH)/include/VBox/vmm/vm.mac \
|
---|
349 | $(DEPTH)/include/VBox/sup.mac \
|
---|
350 | $(DEPTH)/include/iprt/x86.mac \
|
---|
351 | $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
|
---|
352 | $(VBOX_PATH_VMM_SRC)/include/TRPMInternal.mac \
|
---|
353 | $(VBOX_PATH_VMM_SRC)/include/HWACCMInternal.mac \
|
---|
354 | $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
|
---|
355 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
356 | $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
|
---|
357 | | $$(dir $$@)
|
---|
358 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
359 | ifndef DONT_USE_YASM
|
---|
360 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
|
---|
361 | $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ $@.lst
|
---|
362 | else
|
---|
363 | $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
|
---|
364 | $(VBOX_NM) $@.o | $(SED) \
|
---|
365 | -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
|
---|
366 | -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
|
---|
367 | > $@
|
---|
368 | endif
|
---|
369 |
|
---|
370 | # 1b. make an elf/macho object containing the offsets.
|
---|
371 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
|
---|
372 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
373 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
|
---|
374 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
375 | | $$(dir $$@)
|
---|
376 | $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
|
---|
377 | ifndef DONT_USE_YASM
|
---|
378 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
379 | else
|
---|
380 | $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
381 | endif
|
---|
382 |
|
---|
383 | # 2. use nm and sed to transform this into the header we want.
|
---|
384 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
|
---|
385 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
386 | $(QUIET)$(RM) -f $@ $@.dump $@.tmp
|
---|
387 | $(QUIET)$(REDIRECT) -wo $@.dump -- $(VBOX_NM) $<
|
---|
388 | $(QUIET)$(SED) -e '/STAMPROFILEADV/d' \
|
---|
389 | -e '/00[0-9a-fA-F]* [aA] [^_.]*\./!d' -e 's/\(00[0-9a-fA-F]*\) [aA] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\2, 0x0\1, \3);/' \
|
---|
390 | --output $@.tmp $@.dump
|
---|
391 | $(QUIET)$(SED) -e '/VM_size$$/d' -e '/VMCPU_size$$/d' \
|
---|
392 | -e '/00[0-9a-fA-F]* [aA] [^_.]*_size$$/!d' -e 's/\(00[0-9a-fA-F]*\) [aA] \([^_.]*\)_size/ CHECK_SIZE(\2, 0x0\1);/' \
|
---|
393 | --append $@.tmp $@.dump
|
---|
394 | $(QUIET)$(MV) -f $@.tmp $@
|
---|
395 | $(QUIET)$(RM) -f $@.dump
|
---|
396 |
|
---|
397 | ifdef VBOX_WITH_RAW_MODE
|
---|
398 | # 3. transform the HC header into a RC one by omitting some HC only structures.
|
---|
399 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
|
---|
400 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
401 | $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' --output $@ $^
|
---|
402 | endif
|
---|
403 |
|
---|
404 | # 4. run it.
|
---|
405 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
|
---|
406 | $$(tstAsmStructs_1_STAGE_TARGET) \
|
---|
407 | $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
|
---|
408 | $(QUIET)$(RM) -f $@
|
---|
409 | $(tstAsmStructs_1_STAGE_TARGET)
|
---|
410 | ifdef VBOX_WITH_RAW_MODE
|
---|
411 | $(tstAsmStructsRC_1_STAGE_TARGET)
|
---|
412 | endif
|
---|
413 | $(QUIET)$(APPEND) "$@" "done"
|
---|
414 |
|
---|
415 |
|
---|
416 |
|
---|
417 | #
|
---|
418 | # Run rule for tstVMStructSize.
|
---|
419 | #
|
---|
420 |
|
---|
421 | ifdef VBOX_WITH_RAW_MODE
|
---|
422 | # 1. Manually dump selected structures and members.
|
---|
423 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
|
---|
424 | $(call MSG_GENERATE,tstVMStructSize,$@)
|
---|
425 | $(QUIET)$(REDIRECT) -wo $@ -- $<
|
---|
426 | endif # VBOX_WITH_RAW_MODE
|
---|
427 |
|
---|
428 | # 2. run it.
|
---|
429 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
|
---|
430 | $(QUIET)$(RM) -f $@
|
---|
431 | $<
|
---|
432 | $(QUIET)$(APPEND) "$@" "done"
|
---|
433 |
|
---|
434 | # alias for the two struct tests.
|
---|
435 | run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
436 |
|
---|