VirtualBox

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

Last change on this file since 41800 was 41677, checked in by vboxsync, 13 years ago

Drop tstCompile.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 15.7 KB
Line 
1# $Id: Makefile.kmk 41677 2012-06-13 09:32:02Z 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-HwAccm
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-HwAccm_TEMPLATE = VBOXR3EXE
259 tstVMM-HwAccm_SOURCES = tstVMM-HwAccm.cpp
260 tstVMM-HwAccm_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
270 tstMicroRC_TEMPLATE = VBoxRc
271 tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
272 tstMicroRC_DEFS =
273 tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
274 ifeq ($(VBOX_LDR_FMT32),pe)
275 tstMicroRC_LDFLAGS = -Entry:tstMicroRC
276 endif
277 tstMicroRC_SYSSUFF = .gc
278 tstMicroRC_LIBS = \
279 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
280 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
281 ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
282 tstMicroRC_LIBS += \
283 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
284 $(LIB_VMMGC)
285 endif
286 tstMicroRC_SOURCES.win = tstMicroRC.def
287
288endif # VBOX_WITH_RAW_MODE
289
290ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
291 tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
292 tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
293 tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
294 tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
295
296 tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
297 tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
298 tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
299 tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
300endif
301
302
303#
304# Generate VM structure tests.
305#
306if !defined(VBOX_ONLY_EXTPACKS) \
307 && ( defined(VBOX_WITH_DTRACE_R3) \
308 || defined(VBOX_WITH_DTRACE_R0) \
309 || defined(VBOX_WITH_DTRACE_RC))
310 tstVMStructDTrace_TEMPLATE= VBOXR3AUTOTST
311 tstVMStructDTrace_DEFS = IN_VMM_R3 IN_DIS
312 ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
313 tstVMStructDTrace_DEFS += \
314 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
315 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
316 endif
317 ifdef VBOX_WITH_RAW_MODE
318 tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
319 endif
320 tstVMStructDTrace_INCS = \
321 $(VBOX_PATH_VMM_SRC)/include \
322 $(VBOX_PATH_VMM_SRC)/PATM \
323 $(VBOX_VMM_TESTCASE_OUT_DIR)
324 tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
325 ifdef VBOX_WITH_R0_LOGGING
326 tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
327 endif
328 ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
329 tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
330 endif
331
332
333 VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
334 VMMLibDTraceStructTest_SOURCES = \
335 $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
336
337 $$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
338 $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
339 $(QUIET)$(RM) -f $@
340 $< > $@
341
342endif
343
344
345include $(FILE_KBUILD_SUB_FOOTER)
346
347
348#
349# Run rule for tstInstrEmul.
350#
351$(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run: $$(tstInstrEmul_1_STAGE_TARGET) | $$(dir $$@)
352 $(QUIET)$(RM) -f $@
353 $(QUIET)$(REDIRECT) -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
354 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
355 -- \
356 $(tstInstrEmul_1_STAGE_TARGET)
357 $(QUIET)$(APPEND) "$@" "done"
358
359
360#
361# Some handcrafted support targets for tstAsmStructs.
362#
363
364ifeq ($(KBUILD_HOST),win)
365 ifndef TOOL_MINGW32
366 include $(KBUILD_PATH)/tools/MINGW32.kmk
367 endif
368 VBOX_NM ?= $(PATH_TOOL_MINGW32)/bin/nm.exe -p
369else
370 VBOX_NM ?= nm -p
371endif
372
373MY_ASA_ASM_STUFF = \
374 $(addprefix -D, \
375 $(DEFS) \
376 $(DEFS.$(KBUILD_TYPE)) \
377 $(DEFS.$(KBUILD_TARGET)) \
378 IN_RING3 $(ARCH_BITS_DEFS) \
379 $(DEFS.$(KBUILD_TARGET_ARCH)) \
380 $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
381 $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
382 ) \
383 -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
384 $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
385 ,-I$(inc)/)
386
387# 1a. make a header file which makes all the structures+members globals.
388$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
389 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
390 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
391 $(DEPTH)/include/iprt/asmdefs.mac \
392 $(DEPTH)/include/VBox/vmm/cpum.mac \
393 $(DEPTH)/include/VBox/vmm/vm.mac \
394 $(DEPTH)/include/VBox/sup.mac \
395 $(DEPTH)/include/iprt/x86.mac \
396 $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
397 $(VBOX_PATH_VMM_SRC)/include/TRPMInternal.mac \
398 $(VBOX_PATH_VMM_SRC)/include/HWACCMInternal.mac \
399 $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
400 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
401 $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
402 | $$(dir $$@)
403 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
404ifndef DONT_USE_YASM
405 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
406 $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ $@.lst
407else
408 $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
409 $(VBOX_NM) $@.o | $(SED) \
410 -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
411 -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
412 > $@
413endif
414
415# 1b. make an elf/macho object containing the offsets.
416$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
417 $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
418 $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
419 $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
420 | $$(dir $$@)
421 $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
422ifndef DONT_USE_YASM
423 $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
424else
425 $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
426endif
427
428# 2. use nm and sed to transform this into the header we want.
429$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
430 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
431 $(QUIET)$(RM) -f $@ $@.dump $@.tmp
432 $(QUIET)$(REDIRECT) -wo $@.dump -- $(VBOX_NM) $<
433 $(QUIET)$(SED) \
434 -e '/STAMPROFILEADV/d' \
435 \
436 -e '/00[0-9a-fA-F]* [aA] [^_.]*\./!d' \
437 -e 's/\(00[0-9a-fA-F]*\) [aA] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\2, 0x0\1, \3);/' \
438 --output $@.tmp $@.dump
439 $(QUIET)$(SED) \
440 -e '/VM_size$$/d' \
441 -e '/VMCPU_size$$/d' \
442 -e '/VMMCPU_size$$/d' \
443 -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
444 \
445 -e '/00[0-9a-fA-F]* [aA] [^_.]*_size$$/!d' \
446 -e 's/\(00[0-9a-fA-F]*\) [aA] \([^_.]*\)_size/ CHECK_SIZE(\2, 0x0\1);/' \
447 --append $@.tmp $@.dump
448 $(QUIET)$(MV) -f $@.tmp $@
449 $(QUIET)$(RM) -f $@.dump
450
451ifdef VBOX_WITH_RAW_MODE
452# 3. transform the HC header into a RC one by omitting some HC only structures.
453$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
454 $(call MSG_GENERATE,tstVMStructSize,$@,$<)
455 $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' --output $@ $^
456endif
457
458# 4. run it.
459$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
460 $$(tstAsmStructs_1_STAGE_TARGET) \
461 $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
462 $(QUIET)$(RM) -f $@
463 $(tstAsmStructs_1_STAGE_TARGET)
464ifdef VBOX_WITH_RAW_MODE
465 $(tstAsmStructsRC_1_STAGE_TARGET)
466endif
467 $(QUIET)$(APPEND) "$@" "done"
468
469
470
471#
472# Run rule for tstVMStructSize.
473#
474
475ifdef VBOX_WITH_RAW_MODE
476# 1. Manually dump selected structures and members.
477$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
478 $(call MSG_GENERATE,tstVMStructSize,$@)
479 $(QUIET)$(REDIRECT) -wo $@ -- $<
480endif # VBOX_WITH_RAW_MODE
481
482# 2. run it.
483$(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
484 $(QUIET)$(RM) -f $@
485 $<
486 $(QUIET)$(APPEND) "$@" "done"
487
488# alias for the two struct tests.
489run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
490
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