VirtualBox

source: vbox/trunk/src/VBox/VMM/testcase/Makefile.kmk@ 45733

Last change on this file since 45733 was 45530, checked in by vboxsync, 12 years ago

attempt to fix the builds

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