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