VirtualBox

source: vbox/trunk/src/VBox/VMM/testcase/Makefile@ 1404

Last change on this file since 1404 was 1404, checked in by vboxsync, 18 years ago

yasm/mach-o doesn't grok stabs, so drop that. it's not necessary I believe.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.2 KB
Line 
1#
2# Makefile for the VMM testcases.
3#
4
5#
6# Copyright (C) 2006 InnoTek Systemberatung GmbH
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License as published by the Free Software Foundation,
12# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13# distribution. VirtualBox OSE is distributed in the hope that it will
14# be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16# If you received this file as part of a commercial VirtualBox
17# distribution, then only the terms of your commercial VirtualBox
18# license agreement apply instead of the previous paragraph.
19#
20
21DEPTH = ../../../..
22include $(PATH_KBUILD)/header.kmk
23
24#
25# Target lists.
26#
27PROGRAMS = tstVMStructSize tstVMStructGC tstAsmStructs tstAsmStructsGC tstVMM tstVMM-HwAccm
28ifdef VBOX_WITH_TESTCASES
29 PROGRAMS += tstCFGM tstSSM tstMMHyperHeap tstVMM-2 tstVMREQ tstMicro tstCompiler tstVMMR0CallHost-1
30 ifneq ($(BUILD_TARGET),l4)
31 PROGRAMS += tstAnimate
32 endif
33 SYSMODS = tstMicroGC
34endif # VBOX_WITH_TESTCASES
35
36#
37# We setup two 'other' targets for executing the two structure & alignment
38# validation testcases. Perhaps a bit hackish, but extremely useful.
39#
40ifeq ($(BUILD_TARGET),$(BUILD_PLATFORM))
41 ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(BUILD_TARGET_ARCH).$(BUILD_PLATFORM_ARCH)),)
42 OTHERS += \
43 $(PATH_TARGET)/tstAsmStructs.run \
44 $(PATH_TARGET)/tstVMStructSize.run
45 endif
46endif
47OTHER_CLEAN += \
48 $(PATH_TARGET)/tstAsmStructs.run \
49 $(PATH_TARGET)/tstVMStructSize.run \
50 $(PATH_TARGET)/tstAsmStructs.h \
51 $(PATH_TARGET)/tstAsmStructsAsm.o \
52 $(PATH_TARGET)/tstAsmStructs.h.dump
53
54#
55# Globals.
56#
57TEMPLATE = VBOXR3TSTEXE
58
59#
60# Targets
61#
62tstVMStructGC_TEMPLATE = VBOXGCEXE
63tstVMStructGC_DEFS = IN_VMM_GC IN_PDM_GC IN_CFGM_GC IN_IOM_GC IN_VM_GC IN_CPUM_GC IN_SELM_GC IN_PGM_GC IN_TRPM_GC IN_MM_GC IN_PDM_GC IN_DBGF_GC IN_PATM_GC IN_DIS_GC IN_STAM_GC IN_VGADEVICE_GC IN_CSAM_GC IN_SSM_GC IN_REM_GC IN_RRM_GC
64tstVMStructGC_SOURCES = tstVMStructGC.cpp
65tstVMStructGC_INCS = .. ../PATM
66
67tstVMStructSize_DEFS = IN_VMM_R3 IN_PDM_R3 IN_CFGM_R3 IN_IOM_R3 IN_VM_R3 IN_CPUM_R3 IN_SELM_R3 IN_PGM_R3 IN_TRPM_R3 IN_MM_R3 IN_PDM_R3 IN_DBGF_R3 IN_PATM_R3 IN_DIS_R3 IN_STAM_R3 IN_VGADEVICE_R3 IN_CSAM_R3 IN_SSM_R3 IN_REM_R3
68tstVMStructSize_INCS = .. ../PATM $(PATH_TARGET)
69tstVMStructSize_SOURCES = tstVMStructSize.cpp
70tstVMStructSize_LIBS.l4 = $(LIB_RUNTIME)
71tstVMStructSize.cpp_DEPS= $(PATH_TARGET)/tstVMStructGC.h
72
73tstAsmStructs_DEFS = IN_VMM_R3 IN_PDM_R3 IN_CFGM_R3 IN_IOM_R3 IN_VM_R3 IN_CPUM_R3 IN_SELM_R3 IN_PGM_R3 IN_TRPM_R3 IN_MM_R3 IN_PDM_R3 IN_DBGF_R3 IN_PATM_R3 IN_DIS_R3 IN_STAM_R3 IN_VGADEVICE_R3 IN_CSAM_R3 IN_SSM_R3
74tstAsmStructs_INCS = .. $(PATH_TARGET)
75tstAsmStructs_SOURCES = tstAsmStructs.cpp
76tstAsmStructs_LIBS.l4 = $(LIB_RUNTIME)
77
78tstAsmStructsGC_TEMPLATE= VBOXGCEXE
79tstAsmStructsGC_DEFS = IN_VMM_GC IN_PDM_GC IN_CFGM_GC IN_IOM_GC IN_VM_GC IN_CPUM_GC IN_SELM_GC IN_PGM_GC IN_TRPM_GC IN_MM_GC IN_PDM_GC IN_DBGF_GC IN_PATM_GC IN_DIS_GC IN_STAM_GC IN_VGADEVICE_GC IN_CSAM_GC IN_SSM_GC IN_RRM_GC
80tstAsmStructsGC_INCS = .. $(PATH_TARGET)
81tstAsmStructsGC_SOURCES = tstAsmStructs.cpp
82
83tstAsmStructs.cpp_DEPS = $(PATH_TARGET)/tstAsmStructsHC.h $(PATH_TARGET)/tstAsmStructsGC.h
84
85
86tstMMHyperHeap_SOURCES = tstMMHyperHeap.cpp
87tstMMHyperHeap_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
88
89tstSSM_SOURCES = tstSSM.cpp
90tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
91
92tstCFGM_SOURCES = tstCFGM.cpp
93tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
94
95tstVMM_SOURCES = tstVMM.cpp
96tstVMM_TEMPLATE = VBOXR3EXE
97tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
98
99tstVMM-HwAccm_SOURCES = tstVMM-HwAccm.cpp
100tstVMM-HwAccm_TEMPLATE = VBOXR3EXE
101tstVMM-HwAccm_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
102
103tstVMM-2_SOURCES = tstVMM-2.cpp
104tstVMM-2_TEMPLATE = VBOXR3EXE
105tstVMM-2_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
106
107tstVMMR0CallHost-1_TEMPLATE = VBOXR3EXE
108tstVMMR0CallHost-1_INCS = ..
109tstVMMR0CallHost-1_SOURCES = \
110 tstVMMR0CallHost-1.cpp \
111 ../VMMR0/VMMR0A.asm
112tstVMMR0CallHost-1_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
113
114tstVMREQ_SOURCES = tstVMREQ.cpp
115tstVMREQ_TEMPLATE = VBOXR3EXE
116tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
117
118tstAnimate_SOURCES = tstAnimate.cpp
119tstAnimate_TEMPLATE = VBOXR3EXE
120tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
121
122tstCompiler_SOURCES = tstCompiler.cpp
123tstCompiler_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
124
125tstMicro_SOURCES = tstMicro.cpp
126tstMicro_TEMPLATE = VBOXR3EXE
127tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
128
129# tstMicroGC.gc
130tstMicroGC_TEMPLATE = VBOXGC
131tstMicroGC_SOURCES = tstMicroGC.cpp tstMicroGCA.asm
132tstMicroGC_DEFS =
133ifeq ($(VBOX_LDR_FMT32),pe)
134tstMicroGC_LDFLAGS = -Entry:tstMicroGC
135endif
136tstMicroGC_SYSSUFF = .gc
137tstMicroGC_LIBS = \
138 $(PATH_LIB)/DisasmGC$(VBOX_SUFF_LIB) \
139 $(PATH_LIB)/RuntimeGC$(VBOX_SUFF_LIB)
140ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
141tstMicroGC_LIBS += \
142 $(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) \
143 $(LIB_VMMGC)
144endif
145tstMicroGC_SOURCES.win = tstMicroGC.def
146
147
148include $(PATH_KBUILD)/footer.kmk
149
150
151#
152# Some handcrafted support for tstAsmStructs.
153#
154
155# 1. make an aout object containing the offsets.
156$(PATH_TARGET)/tstAsmStructsAsm.o: tstAsmStructsAsm.asm \
157 $(DEPTH)/include/iprt/asmdefs.mac \
158 $(DEPTH)/include/VBox/cpum.mac \
159 $(DEPTH)/include/VBox/vm.mac \
160 ../CPUMInternal.mac \
161 ../TRPMInternal.mac \
162 ../VMMInternal.mac \
163 Makefile \
164 | $(call DIRDEP,$(PATH_TARGET))
165 $(call MSG_L1,Compiling $<)
166ifndef DONT_USE_YASM
167 $(QUIET)$(TOOL_YASM_AS) \
168 $(addprefix -D, \
169 $(DEFS) \
170 $(DEFS.$(BUILD_TYPE)) \
171 $(DEFS.$(BUILD_TARGET)) \
172 IN_RING3 \
173 $(DEFS.$(BUILD_TARGET_ARCH)) \
174 $(DEFS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
175 ) \
176 -f $(if $(eq $(BUILD_TARGET),darwin),macho,elf) \
177 $(foreach inc,$(INCS),-I$(inc)/) -o $@ $<
178else
179 $(QUIET)$(TOOL_NASM_AS) \
180 $(addprefix -D, \
181 $(DEFS) \
182 $(DEFS.$(BUILD_TYPE)) \
183 $(DEFS.$(BUILD_TARGET)) \
184 IN_RING3 \
185 $(DEFS.$(BUILD_TARGET_ARCH)) \
186 $(DEFS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
187 ) \
188 -f $(if $(eq $(BUILD_TARGET),darwin),macho,elf) \
189 $(foreach inc,$(INCS),-I$(inc)/) -o $@ $<
190endif
191
192# 2. use nm and sed to transform this into the header we want.
193ifeq ($(BUILD_PLATFORM),win)
194 include $(PATH_KBUILD)/tools/MINGW32.kmk
195 VBOX_NM ?= $(PATH_TOOL_MINGW32)/bin/nm.exe -p
196else
197 VBOX_NM ?= nm -p
198endif
199$(PATH_TARGET)/tstAsmStructsHC.h: $(PATH_TARGET)/tstAsmStructsAsm.o
200 $(call MSG_L1,Generating $@)
201 $(QUIET)$(RM) -f $@ $@.dump $@.tmp
202 $(VBOX_NM) $< > $@.dump
203 $(QUIET)$(SED) -e '/STAMPROFILEADV/d' \
204 -e '/00[0-9a-fA-F]* a [^_.]*\./!d' -e 's/\(00[0-9a-fA-F]*\) a \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\2, 0x0\1, \3);/' \
205 $@.dump > $@.tmp
206 $(QUIET)$(SED) -e '/VM_size$$/d' \
207 -e '/00[0-9a-fA-F]* a [^_.]*_size$$/!d' -e 's/\(00[0-9a-fA-F]*\) a \([^_.]*\)_size/ CHECK_SIZE(\2, 0x0\1);/' \
208 $@.dump >> $@.tmp
209 $(QUIET)$(MV) -f $@.tmp $@
210 $(QUIET)$(RM) -f $@.dump
211
212# 3. transform the HC header into a GC one by omitting some HC only structures.
213$(PATH_TARGET)/tstAsmStructsGC.h: $(PATH_TARGET)/tstAsmStructsHC.h
214 $(call MSG_L1,Generating $@)
215 $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' \
216 $^ > $@
217
218# 4. run it.
219$(PATH_TARGET)/tstAsmStructs.run: $(INSTARGET_tstAsmStructs) $(INSTARGET_tstAsmStructsGC)
220 $(QUIET)$(RM) -f $@
221 $(INSTARGET_tstAsmStructs)
222 $(INSTARGET_tstAsmStructsGC)
223 $(QUIET)$(APPEND) "$@" "done"
224
225#
226# Run rule for tstVMStructSize.
227#
228
229# 1. Dump selected structure in the VMMGC.gc debug info.
230# 2. Generate a testcase from the dump
231## future
232
233# 1&2. Manually dump selected structures and members.
234$(PATH_TARGET)/tstVMStructGC.h: $(INSTARGET_tstVMStructGC)
235 $(call MSG_L1,Generating $<)
236 $(QUIET)$(INSTARGET_tstVMStructGC) > $@
237
238# 3. run it.
239$(PATH_TARGET)/tstVMStructSize.run: $(INSTARGET_tstVMStructSize)
240 $(QUIET)$(RM) -f $@
241 $^
242 $(QUIET)$(APPEND) "$@" "done"
243
244# alias for the two struct tests.
245run-struct-tests: $(PATH_TARGET)/tstAsmStructs.run $(PATH_TARGET)/tstVMStructSize.run
246
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