VirtualBox

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

Last change on this file since 65919 was 65904, checked in by vboxsync, 8 years ago

VMM: Nested Hw.virt: Started with tweaking the AMD bits and laying the groundwork.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 28.8 KB
Line 
1# $Id: Makefile.kmk 65904 2017-03-01 10:21:38Z vboxsync $
2## @file
3# Top-level makefile for the VMM.
4#
5
6#
7# Copyright (C) 2006-2016 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# Include sub-makefiles.
22ifndef VBOX_ONLY_EXTPACKS
23 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
24endif
25include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
26
27
28# Fail on unsupported hosts.
29ifeq ($(KBUILD_TARGET_ARCH),x86)
30 ifeq ($(KBUILD_TARGET),darwin)
31 $(error 32-bit darwin is no longer a supported VirtualBox host. Go back to 4.3 or older for 32-bit support.)
32 else ifeq ($(KBUILD_TARGET),solaris)
33 $(error 32-bit solaris is no longer a supported VirtualBox host. Go back to 4.2 or older for 32-bit support.)
34 endif
35endif
36
37
38#
39# Globals
40#
41
42## DEFS variable that is picked up by all three VMM targets (R0, R3, RC).
43# Can be prepended to by setting it in LocalConfig.kmk
44VMM_COMMON_DEFS ?= VBOX_IN_VMM
45ifdef VBOX_WITH_2ND_IEM_STEP
46 VMM_COMMON_DEFS += VBOX_WITH_2ND_IEM_STEP
47endif
48ifdef VBOX_WITH_3RD_IEM_STEP
49 VMM_COMMON_DEFS += VBOX_WITH_3RD_IEM_STEP
50endif
51ifdef VBOX_WITH_NESTED_HWVIRT
52 VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT
53endif
54#ifdef VBOX_WITH_IEM
55# VMM_COMMON_DEFS += VBOX_WITH_IEM
56#endif
57ifdef VBOX_WITH_REM
58 VMM_COMMON_DEFS += VBOX_WITH_REM
59endif
60ifdef VBOX_WITH_MULTI_CORE
61 VMM_COMMON_DEFS += VBOX_WITH_MULTI_CORE
62endif
63ifdef VBOX_WITH_R0_LOGGING
64 VMM_COMMON_DEFS += VBOX_WITH_R0_LOGGING
65endif
66ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
67 VMM_COMMON_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
68endif
69ifdef VBOX_WITH_PCI_PASSTHROUGH
70 VMM_COMMON_DEFS += VBOX_WITH_PCI_PASSTHROUGH
71endif
72ifdef VBOX_WITH_DTRACE_RC
73 VMM_COMMON_DEFS += VBOX_WITH_DTRACE_RC
74endif
75ifdef VBOX_WITH_SAFE_STR
76 VMM_COMMON_DEFS += VBOX_WITH_SAFE_STR
77endif
78ifdef VBOX_WITH_RAW_RING1
79 VMM_COMMON_DEFS += VBOX_WITH_RAW_RING1
80endif
81ifdef VBOX_WITH_64ON32_IDT
82 VMM_COMMON_DEFS += VBOX_WITH_64ON32_IDT
83endif
84ifdef VBOX_WITH_64ON32_CMOS_DEBUG
85 VMM_COMMON_DEFS += VBOX_WITH_64ON32_CMOS_DEBUG
86endif
87ifdef VBOXSTRICTRC_STRICT_ENABLED
88 VMM_COMMON_DEFS += VBOXSTRICTRC_STRICT_ENABLED
89endif
90ifeq ($(KBUILD_TARGET),amd64)
91 VMM_COMMON_DEFS += VBOX_WITH_MORE_RING0_MEM_MAPPINGS
92endif
93
94# VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS
95
96# Special IEM debug mode which compares the result with HM/REM
97ifdef IEM_VERIFICATION_MODE
98 VMM_COMMON_DEFS += IEM_VERIFICATION_MODE IEM_VERIFICATION_MODE_FULL IEM_VERIFICATION_MODE_FULL_HM
99endif
100
101
102#
103# The VMM DLL.
104#
105ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
106 DLLS += VBoxVMM
107endif
108VBoxVMM_TEMPLATE = VBoxR3DllNoPic
109VBoxVMM_SONAME.linux = VBoxVMM.so
110
111VBoxVMM_DEFS = IN_VMM_R3 IN_DIS IN_GMM_R3 IN_DBG $(VMM_COMMON_DEFS)
112## @todo eliminate IN_GMM_R3
113ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
114 VBoxVMM_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
115endif
116ifdef VBOX_WITH_VUSB
117 VBoxVMM_DEFS += VBOX_WITH_USB
118endif
119ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
120 VBoxVMM_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
121endif
122ifdef VBOX_WITH_NETSHAPER
123 VBoxVMM_DEFS += VBOX_WITH_NETSHAPER
124endif
125ifdef VBOX_WITH_RAW_MODE
126 VBoxVMM_DEFS += VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0
127endif
128ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
129 VBoxVMM_DEFS += VMM_R0_SWITCH_STACK
130endif
131if "$(KBUILD_TYPE)" == "debug" && "$(USERNAME)" == "bird"
132 VBoxVMM_DEFS += RTMEM_WRAP_TO_EF_APIS
133endif
134VBoxVMM_DEFS.darwin = VMM_R0_SWITCH_STACK
135
136VBoxVMM_INCS = \
137 include \
138 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
139 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
140VBoxVMM_ASINCS = .
141
142VBoxVMM_SOURCES = \
143 VBoxVMM.d \
144 VMMR3/APIC.cpp \
145 VMMR3/CFGM.cpp \
146 VMMR3/CPUM.cpp \
147 VMMR3/CPUMR3CpuId.cpp \
148 VMMR3/CPUMR3Db.cpp \
149 VMMR3/CPUMDbg.cpp \
150 VMMR3/DBGF.cpp \
151 VMMR3/DBGFAddr.cpp \
152 VMMR3/DBGFAddrSpace.cpp \
153 VMMR3/DBGFBp.cpp \
154 VMMR3/DBGFCoreWrite.cpp \
155 VMMR3/DBGFCpu.cpp \
156 VMMR3/DBGFDisas.cpp \
157 VMMR3/DBGFInfo.cpp \
158 VMMR3/DBGFLog.cpp \
159 VMMR3/DBGFMem.cpp \
160 VMMR3/DBGFOS.cpp \
161 VMMR3/DBGFR3PlugIn.cpp \
162 VMMR3/DBGFReg.cpp \
163 VMMR3/DBGFStack.cpp \
164 VMMR3/DBGFR3Flow.cpp \
165 VMMR3/DBGFR3Trace.cpp \
166 VMMR3/DBGFR3Type.cpp \
167 VMMR3/EM.cpp \
168 VMMR3/EMR3Dbg.cpp \
169 $(if $(VBOX_WITH_RAW_MODE),VMMR3/EMRaw.cpp) \
170 VMMR3/EMHM.cpp \
171 VMMR3/FTM.cpp \
172 VMMR3/GIM.cpp \
173 VMMR3/GIMHv.cpp \
174 VMMR3/GIMKvm.cpp \
175 VMMR3/GIMMinimal.cpp \
176 VMMR3/IEMR3.cpp \
177 VMMR3/IOM.cpp \
178 VMMR3/GMM.cpp \
179 VMMR3/MM.cpp \
180 VMMR3/MMHeap.cpp \
181 VMMR3/MMHyper.cpp \
182 VMMR3/MMPagePool.cpp \
183 VMMR3/MMUkHeap.cpp \
184 VMMR3/PDM.cpp \
185 VMMR3/PDMBlkCache.cpp \
186 VMMR3/PDMDevice.cpp \
187 VMMR3/PDMDevHlp.cpp \
188 VMMR3/PDMDevMiscHlp.cpp \
189 VMMR3/PDMDriver.cpp \
190 VMMR3/PDMLdr.cpp \
191 VMMR3/PDMCritSect.cpp \
192 VMMR3/PDMQueue.cpp \
193 VMMR3/PDMThread.cpp \
194 VMMR3/PGM.cpp \
195 VMMR3/PGMDbg.cpp \
196 VMMR3/PGMR3DbgA.asm \
197 VMMR3/PGMHandler.cpp \
198 VMMR3/PGMMap.cpp \
199 VMMR3/PGMPhys.cpp \
200 VMMR3/PGMPool.cpp \
201 VMMR3/PGMSavedState.cpp \
202 VMMR3/PGMSharedPage.cpp \
203 VMMR3/SELM.cpp \
204 VMMR3/SSM.cpp \
205 VMMR3/STAM.cpp \
206 VMMR3/TM.cpp \
207 VMMR3/TRPM.cpp \
208 VMMR3/VM.cpp \
209 VMMR3/VMEmt.cpp \
210 VMMR3/VMReq.cpp \
211 VMMR3/VMM.cpp \
212 VMMR3/VMMGuruMeditation.cpp \
213 VMMR3/VMMSwitcher.cpp \
214 VMMR3/VMMTests.cpp \
215 VMMR3/HM.cpp \
216 $(if-expr defined(VBOX_WITH_RAW_MODE), \
217 VMMR3/CSAM.cpp \
218 VMMR3/PATM.cpp \
219 VMMR3/PATMPatch.cpp \
220 VMMR3/PATMGuest.cpp \
221 VMMR3/PATMA.asm \
222 VMMR3/PATMSSM.cpp \
223 VMMR3/PATMR3Dbg.cpp \
224 ,) \
225 VMMAll/APICAll.cpp \
226 VMMAll/CPUMAllRegs.cpp \
227 VMMAll/CPUMAllMsrs.cpp \
228 VMMAll/CPUMStack.cpp \
229 VMMAll/DBGFAll.cpp \
230 VMMAll/HMAll.cpp \
231 VMMAll/IEMAll.cpp \
232 VMMAll/IEMAllAImpl.asm \
233 VMMAll/IEMAllAImplC.cpp \
234 VMMAll/IOMAll.cpp \
235 VMMAll/IOMAllMMIO.cpp \
236 VMMAll/MMAll.cpp \
237 VMMAll/MMAllHyper.cpp \
238 VMMAll/MMAllPagePool.cpp \
239 VMMAll/PDMAll.cpp \
240 VMMAll/PDMAllCritSect.cpp \
241 VMMAll/PDMAllCritSectRw.cpp \
242 VMMAll/PDMAllCritSectBoth.cpp \
243 VMMAll/PDMAllQueue.cpp \
244 VMMAll/PGMAll.cpp \
245 VMMAll/PGMAllHandler.cpp \
246 VMMAll/PGMAllMap.cpp \
247 VMMAll/PGMAllPhys.cpp \
248 VMMAll/PGMAllPool.cpp \
249 VMMAll/SELMAll.cpp \
250 VMMAll/EMAll.cpp \
251 VMMAll/EMAllA.asm \
252 VMMAll/FTMAll.cpp \
253 VMMAll/GIMAll.cpp \
254 VMMAll/GIMAllHv.cpp \
255 VMMAll/GIMAllKvm.cpp \
256 VMMAll/TMAll.cpp \
257 VMMAll/TMAllCpu.cpp \
258 VMMAll/TMAllReal.cpp \
259 VMMAll/TMAllVirtual.cpp \
260 VMMAll/TRPMAll.cpp \
261 VMMAll/VMAll.cpp \
262 VMMAll/VMMAll.cpp \
263 VMMAll/VMMAllA.asm \
264 $(if-expr defined(VBOX_WITH_RAW_MODE), \
265 VMMAll/CSAMAll.cpp \
266 VMMAll/PATMAll.cpp \
267 ,)
268ifdef VBOX_WITH_VUSB
269 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
270endif
271ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
272 VBoxVMM_SOURCES += \
273 VMMR3/PDMAsyncCompletion.cpp \
274 VMMR3/PDMAsyncCompletionFile.cpp \
275 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
276 VMMR3/PDMAsyncCompletionFileNormal.cpp
277endif
278ifdef VBOX_WITH_NETSHAPER
279 VBoxVMM_SOURCES += \
280 VMMR3/PDMNetShaper.cpp \
281 VMMAll/PDMAllNetShaper.cpp
282endif
283ifdef VBOX_WITH_REM
284 VBoxVMM_SOURCES += \
285 VMMAll/REMAll.cpp
286endif
287ifdef VBOX_WITH_RAW_MODE
288 VBoxVMM_SOURCES.x86 += \
289 VMMSwitcher/32BitTo32Bit.asm \
290 VMMSwitcher/32BitToPAE.asm \
291 VMMSwitcher/PAETo32Bit.asm \
292 VMMSwitcher/PAEToPAE.asm
293 VBoxVMM_SOURCES.amd64 = \
294 VMMSwitcher/AMD64To32Bit.asm \
295 VMMSwitcher/AMD64ToPAE.asm
296endif
297VBoxVMM_SOURCES.x86 += \
298 VMMSwitcher/32BitToAMD64.asm \
299 VMMSwitcher/PAEToAMD64.asm \
300 VMMSwitcher/X86Stub.asm
301VBoxVMM_SOURCES.amd64 += \
302 VMMSwitcher/AMD64Stub.asm
303
304VBoxVMM_LIBS = \
305 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
306ifdef VBOX_WITH_DEBUGGER
307 VBoxVMM_LIBS += \
308 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
309endif
310VBoxVMM_LIBS += \
311 $(LIB_REM) \
312 $(LIB_RUNTIME)
313
314VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
315VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
316VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
317VBoxVMM_LDFLAGS.solaris = -mimpure-text
318
319# SSM wish to know the build type, host os and arch.
320VMMR3/SSM.cpp_DEFS += \
321 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
322 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
323 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
324
325
326#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
327# ifeq ($(KBUILD_HOST), linux)
328#VBoxVMM_LIBS += aio
329# endif
330#endif
331
332if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
333 VBoxVMM_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
334 VBoxVMM_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
335 VBoxVMM_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
336 VBoxVMM_VMMAll/PDMAllCritSect.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
337endif
338
339$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
340
341
342#
343# Generate macro template for IEM instruction statistics.
344#
345VBoxVMM_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
346VBoxVMM_CLEAN += \
347 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts \
348 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
349$$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts \
350+| $$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h: \
351 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructions.cpp.h \
352 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsOneByte.cpp.h \
353 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
354 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
355 $(QUIET)$(RM) -f -- "$@.tmp" "$@.tmp" "$@.sorted"
356 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
357 $(QUIET)$(SED) \
358 -e '/IEMOP_MNEMONIC[01234]*(/!d' \
359 -e 's/^.*IEMOP_MNEMONIC\([01234]*\)(/IEM_DO_INSTR_STAT\1(/' \
360 -e 's/;.*$(DOLLAR)//' \
361 --output "$@.tmp" $(filter %.cpp.h,$^)
362# Windows sort does some kind of seeking. So, we must use a temporary file and kmk_cat to define and undefine our macros.
363 $(QUIET)$(REDIRECT) -wto "$@.sorted" -- sort "$@.tmp"
364 $(QUIET)$(APPEND) -nt "$@" \
365 '/* Warning autogenerated by VMM/Makefile.kmk. */ ' \
366 '#define IEM_DO_INSTR_STAT0(f,u,l,fd,fi) IEM_DO_INSTR_STAT(l, #l)' \
367 '#define IEM_DO_INSTR_STAT1(f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1, #l " " #o1)' \
368 '#define IEM_DO_INSTR_STAT2(f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2, #l " " #o1 "," #o2)' \
369 '#define IEM_DO_INSTR_STAT3(f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3, #l " " #o1 "," #o2 "," #o3)' \
370 '#define IEM_DO_INSTR_STAT4(f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3 ## _ ## o4, #l " " #o1 "," #o2 "," #o3 "," #o4)' \
371 '#define IEM_DO_INSTR_STAT0EX(s,m,f,u,l,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
372 '#define IEM_DO_INSTR_STAT1EX(s,m,f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
373 '#define IEM_DO_INSTR_STAT2EX(s,m,f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
374 '#define IEM_DO_INSTR_STAT3EX(s,m,f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
375 '#define IEM_DO_INSTR_STAT4EX(s,m,f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
376 ''
377 $(QUIET)$(REDIRECT) -ato "$@" -- $(CAT_EXT) "$@.sorted"
378 $(QUIET)$(APPEND) -n "$@" \
379 '' \
380 '#undef IEM_DO_INSTR_STAT0' \
381 '#undef IEM_DO_INSTR_STAT1' \
382 '#undef IEM_DO_INSTR_STAT2' \
383 '#undef IEM_DO_INSTR_STAT3' \
384 '#undef IEM_DO_INSTR_STAT4' \
385 ''
386 $(QUIET)$(RM) -f -- "$@.tmp" "$@.sorted"
387 $(QUIET)$(CP) -v -f --changed -- "$@" "$(patsubst %.ts,%,$@)"
388
389
390if "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
391 #
392 # Debug type info hack for VMCPU, VM and similar.
393 #
394 # The microsoft linker seems to be using the last occurence of the structures
395 # when writing the module PDB file. So, we put the fully complete structures
396 # in a library which is at the end of the library list.
397 #
398 VBoxVMM_LIBS += $(VBoxVMMPdbTypeHack_1_TARGET)
399 VBoxVMM_LDFLAGS += /Export:PdbTypeHack
400
401 LIBRARIES += VBoxVMMPdbTypeHack
402 VBoxVMMPdbTypeHack_TEMPLATE = $(VBoxVMM_TEMPLATE)
403 VBoxVMMPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
404 VBoxVMMPdbTypeHack_DEFS = $(VBoxVMM_DEFS)
405 VBoxVMMPdbTypeHack_DEFS.win = $(VBoxVMM_DEFS.win)
406 VBoxVMMPdbTypeHack_DEFS.win.x86 = $(VBoxVMM_DEFS.win.x86)
407 VBoxVMMPdbTypeHack_DEFS.win.amd64 = $(VBoxVMM_DEFS.win.amd64)
408 VBoxVMMPdbTypeHack_INCS = $(VBoxVMM_INCS)
409 VBoxVMMPdbTypeHack_INTERMEDIATES = $(VBoxVMM_INTERMEDIATES)
410endif
411
412
413if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
414
415 #
416 # VMMRCBuiltin.lib
417 #
418 LIBRARIES += VMMRCBuiltin
419 VMMRCBuiltin_TEMPLATE = VBoxRc
420 ifeq ($(VBOX_LDR_FMT32),pe)
421 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
422 endif
423 ifeq ($(VBOX_LDR_FMT32),lx)
424 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
425 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
426 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
427 endif
428
429
430 #
431 # VMMRCImp.lib
432 #
433 LIBRARIES += VMMRCImp
434 VMMRCImp_TEMPLATE = VBoxRc
435 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
436 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
437
438 $$(VMMRCImp_0_OUTDIR)/VMMRC.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRC.def | $$(dir $$@)
439 ifeq ($(VBOX_LDR_FMT32),lx)
440 $(SED) \
441 -e '/not-os2/d' \
442 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
443 -e 's/[ \t]DATA[ \t]*/ /' \
444 --output $@ \
445 $<
446 $(APPEND) "$@" ""
447 $(APPEND) "$@" " ___ehInit"
448 else
449 $(SED) \
450 -e '/not-win/d' \
451 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
452 --output $@ $<
453 endif
454
455endif # RC && (pe || lx)
456
457
458if1of ($(VBOX_LDR_FMT), pe lx)
459 #
460 # VMMR0Imp.lib
461 #
462 LIBRARIES += VMMR0Imp
463 VMMR0Imp_TEMPLATE = VBoxR0
464 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
465 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
466 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
467 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
468 endif
469
470 $$(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(PATH_SUB_CURRENT)/VMMR0/VMMR0.def | $$(dir $$@)
471 ifeq ($(VBOX_LDR_FMT),lx)
472 $(SED) \
473 -e '/not-os2/d' \
474 -e '/not-amd64/d' \
475 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
476 -e 's/[ \t]DATA[ \t]*/ /' \
477 --output $@ $<
478 $(APPEND) "$@" ""
479 $(APPEND) "$@" " ___ehInit"
480 else
481 $(SED) \
482 -e '/not-win/d' \
483 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
484 --output $@ $<
485 endif
486endif # R0: pe + lx
487
488
489#
490# VMMR3Imp.lib
491#
492IMPORT_LIBS += VMMR3Imp
493$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
494
495ifneq ($(VBOX_LIB_VMM_LAZY),$(LIB_VMM))
496 #
497 # VMMR3LazyImp.lib (experimental)
498 #
499 LIBRARIES += VMMR3LazyImp
500 VMMR3LazyImp_TEMPLATE = VBoxR3Dll
501 VMMR3LazyImp_INST = $(INST_LIB)
502 VMMR3LazyImp_SOURCES = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
503 VMMR3LazyImp_CLEAN = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
504 $$(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm: $(PATH_SUB_CURRENT)/VMMR3/VMMR3.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
505 $(VBOX_DEF_2_LAZY_LOAD) --output $@ --library VBoxVMM $<
506endif
507
508
509if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
510 #
511 # VMMRC.rc
512 #
513 SYSMODS += VMMRC
514 VMMRC_TEMPLATE = VBoxRc
515 VMMRC_NAME = VMMRC
516
517 VMMRC_DEFS = IN_VMM_RC IN_RT_RC IN_DIS DIS_CORE_ONLY VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0 IN_SUP_RC \
518 $(VMM_COMMON_DEFS)
519 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
520 VMMRC_DEFS += VMM_R0_SWITCH_STACK
521 endif
522
523 VMMRC_INCS = \
524 include \
525 VMMRC \
526 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
527 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
528
529 VMMRC_LIBS = \
530 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
531 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB) \
532 $(PATH_STAGE_LIB)/SUPRC$(VBOX_SUFF_LIB)
533 ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
534 VMMRC_LIBS += \
535 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB)
536 endif
537
538 VMMRC_SOURCES = \
539 VBoxVMM.d \
540 VMMRC/VMMRC0.asm \
541 VMMRC/VMMRCDeps.cpp \
542 VMMRC/CPUMRC.cpp \
543 VMMRC/CPUMRCA.asm \
544 VMMRC/CPUMRCPatchHlp.asm \
545 VMMRC/EMRCA.asm \
546 VMMRC/IOMRC.cpp \
547 VMMRC/MMRamRC.cpp \
548 VMMRC/MMRamRCA.asm \
549 VMMRC/PDMRCDevice.cpp \
550 VMMRC/PGMRC.cpp \
551 VMMRC/SELMRC.cpp \
552 VMMRC/TRPMRC.cpp \
553 VMMRC/TRPMRCHandlers.cpp \
554 VMMRC/TRPMRCHandlersA.asm \
555 VMMRC/VMMRC.cpp \
556 VMMRC/VMMRCA.asm \
557 $(if-expr defined(VBOX_WITH_RAW_MODE), \
558 VMMRC/CSAMRC.cpp \
559 VMMRC/PATMRC.cpp \
560 ,) \
561 VMMRZ/CPUMRZ.cpp \
562 VMMRZ/CPUMRZA.asm \
563 VMMRZ/DBGFRZ.cpp \
564 VMMRZ/PGMRZDynMap.cpp \
565 VMMRZ/VMMRZ.cpp \
566 VMMAll/APICAll.cpp \
567 VMMAll/CPUMAllRegs.cpp \
568 VMMAll/CPUMAllMsrs.cpp \
569 VMMAll/DBGFAll.cpp \
570 VMMAll/IEMAll.cpp \
571 VMMAll/IEMAllAImpl.asm \
572 VMMAll/IEMAllAImplC.cpp \
573 VMMAll/IOMAll.cpp \
574 VMMAll/IOMAllMMIO.cpp \
575 VMMAll/EMAll.cpp \
576 VMMAll/EMAllA.asm \
577 VMMAll/FTMAll.cpp \
578 VMMAll/GIMAll.cpp \
579 VMMAll/GIMAllHv.cpp \
580 VMMAll/GIMAllKvm.cpp \
581 VMMAll/MMAll.cpp \
582 VMMAll/MMAllHyper.cpp \
583 VMMAll/PDMAll.cpp \
584 VMMAll/PDMAllCritSect.cpp \
585 VMMAll/PDMAllCritSectRw.cpp \
586 VMMAll/PDMAllCritSectBoth.cpp \
587 VMMAll/PDMAllQueue.cpp \
588 VMMAll/PGMAll.cpp \
589 VMMAll/PGMAllHandler.cpp \
590 VMMAll/PGMAllMap.cpp \
591 VMMAll/PGMAllPhys.cpp \
592 VMMAll/PGMAllPool.cpp \
593 VMMAll/SELMAll.cpp \
594 VMMAll/TMAll.cpp \
595 VMMAll/TMAllCpu.cpp \
596 VMMAll/TMAllReal.cpp \
597 VMMAll/TMAllVirtual.cpp \
598 VMMAll/TRPMAll.cpp \
599 VMMAll/VMAll.cpp \
600 VMMAll/VMMAll.cpp \
601 VMMAll/VMMAllA.asm \
602 $(if-expr defined(VBOX_WITH_RAW_MODE), \
603 VMMAll/CSAMAll.cpp \
604 VMMAll/PATMAll.cpp \
605 ,)
606 ifeq ($(VBOX_LDR_FMT32),pe)
607 VMMRC_SOURCES += VMMRC/VMMRC.def
608 endif
609 ifeq ($(VBOX_LDR_FMT32),lx)
610 VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
611 endif
612 ifdef VBOX_WITH_REM
613 VMMRC_SOURCES += \
614 VMMAll/REMAll.cpp
615 endif
616
617 # The very last one.
618 VMMRC_SOURCES += \
619 VMMRC/VMMRC99.asm
620
621 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
622
623 $(call VBOX_SET_VER_INFO_RC,VMMRC,VirtualBox VMM - raw-mode context parts) # Version info / description.
624
625 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
626 VMMRC_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
627 VMMRC_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
628 VMMRC_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
629 endif
630
631 VMMRC_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
632
633 if "$(KBUILD_TARGET)" == "win"
634 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
635 VMMRC_LIBS += $(VMMRCPdbTypeHack_1_TARGET)
636 VMMRC_LDFLAGS += /Export:PdbTypeHack
637
638 LIBRARIES += VMMRCPdbTypeHack
639 VMMRCPdbTypeHack_TEMPLATE = $(VMMRC_TEMPLATE)
640 VMMRCPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
641 VMMRCPdbTypeHack_DEFS = $(VMMRC_DEFS)
642 VMMRCPdbTypeHack_DEFS.win = $(VMMRC_DEFS.win)
643 VMMRCPdbTypeHack_DEFS.win.x86 = $(VMMRC_DEFS.win.x86)
644 VMMRCPdbTypeHack_DEFS.win.amd64 = $(VMMRC_DEFS.win.amd64)
645 VMMRCPdbTypeHack_INCS = $(VMMRC_INCS)
646 VMMRCPdbTypeHack_INTERMEDIATES = $(VMMRC_INTERMEDIATES)
647 endif
648
649endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
650
651
652ifndef VBOX_ONLY_EXTPACKS
653 #
654 # VMMR0.r0
655 #
656 SYSMODS += VMMR0
657 VMMR0_TEMPLATE = VBoxR0
658 VMMR0_SYSSUFF = .r0
659
660 VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
661 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
662 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
663 ifdef VBOX_WITH_PCI_PASSTHROUGH
664 VMMR0_DEFS += IN_PCIRAW_R0
665 endif
666 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
667 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
668 endif
669 ifdef VBOX_WITH_RAW_MODE
670 VMMR0_DEFS += VBOX_WITH_RAW_MODE
671 endif
672 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
673 VMMR0_DEFS += VMM_R0_SWITCH_STACK
674 endif
675 if1of ($(KBUILD_TARGET), darwin linux win)
676 VMMR0_DEFS += VMM_R0_TOUCH_FPU
677 endif
678 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
679 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
680
681 ifeq ($(VBOX_LDR_FMT),elf)
682 VMMR0_CXXFLAGS += -Wunused -Wunused-variable -Wno-unused-parameter
683 endif
684
685 VMMR0_INCS = \
686 include \
687 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
688 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
689
690 VMMR0_SOURCES = \
691 VBoxVMM.d \
692 VMMR0/CPUMR0.cpp \
693 VMMR0/CPUMR0A.asm \
694 VMMR0/GIMR0.cpp \
695 VMMR0/GIMR0Hv.cpp \
696 VMMR0/GIMR0Kvm.cpp \
697 VMMR0/GMMR0.cpp \
698 VMMR0/GVMMR0.cpp \
699 VMMR0/HMR0.cpp \
700 VMMR0/HMR0A.asm \
701 VMMR0/HMVMXR0.cpp \
702 VMMR0/HMSVMR0.cpp \
703 VMMR0/PDMR0Device.cpp \
704 VMMR0/PDMR0Driver.cpp \
705 VMMR0/PGMR0.cpp \
706 VMMR0/PGMR0SharedPage.cpp \
707 VMMR0/TRPMR0.cpp \
708 VMMR0/TRPMR0A.asm \
709 VMMR0/VMMR0.cpp \
710 VMMRZ/CPUMRZ.cpp \
711 VMMRZ/CPUMRZA.asm \
712 VMMRZ/DBGFRZ.cpp \
713 VMMRZ/VMMRZ.cpp \
714 VMMAll/APICAll.cpp \
715 VMMAll/CPUMAllRegs.cpp \
716 VMMAll/CPUMAllMsrs.cpp \
717 VMMAll/CPUMStack.cpp \
718 VMMAll/DBGFAll.cpp \
719 VMMAll/EMAll.cpp \
720 VMMAll/EMAllA.asm \
721 VMMAll/FTMAll.cpp \
722 VMMAll/GIMAll.cpp \
723 VMMAll/GIMAllHv.cpp \
724 VMMAll/GIMAllKvm.cpp \
725 VMMAll/HMAll.cpp \
726 VMMAll/IEMAll.cpp \
727 VMMAll/IEMAllAImpl.asm \
728 VMMAll/IEMAllAImplC.cpp \
729 VMMAll/IOMAll.cpp \
730 VMMAll/IOMAllMMIO.cpp \
731 VMMAll/MMAll.cpp \
732 VMMAll/MMAllHyper.cpp \
733 VMMAll/MMAllPagePool.cpp \
734 VMMAll/PDMAll.cpp \
735 VMMAll/PDMAllCritSect.cpp \
736 VMMAll/PDMAllCritSectRw.cpp \
737 VMMAll/PDMAllCritSectBoth.cpp \
738 VMMAll/PDMAllQueue.cpp \
739 VMMAll/PGMAll.cpp \
740 VMMAll/PGMAllHandler.cpp \
741 VMMAll/PGMAllMap.cpp \
742 VMMAll/PGMAllPhys.cpp \
743 VMMAll/PGMAllPool.cpp \
744 VMMAll/SELMAll.cpp \
745 VMMAll/TMAll.cpp \
746 VMMAll/TMAllCpu.cpp \
747 VMMAll/TMAllReal.cpp \
748 VMMAll/TMAllVirtual.cpp \
749 VMMAll/TRPMAll.cpp \
750 VMMAll/VMAll.cpp \
751 VMMAll/VMMAll.cpp \
752 VMMAll/VMMAllA.asm
753 if1of ($(VBOX_LDR_FMT), pe lx)
754 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
755 endif
756 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
757 VMMR0_SOURCES += \
758 VMMR0/VMMR0TripleFaultHack.cpp \
759 VMMR0/VMMR0TripleFaultHackA.asm
760 endif
761 ifdef VBOX_WITH_NETSHAPER
762 VMMR0_SOURCES += \
763 VMMAll/PDMAllNetShaper.cpp
764 endif
765 ifdef VBOX_WITH_REM
766 VMMR0_SOURCES += \
767 VMMAll/REMAll.cpp
768 endif
769 VMMR0_SOURCES.amd64 = \
770 VMMR0/VMMR0JmpA-amd64.asm
771 VMMR0_SOURCES.x86 = \
772 VMMR0/VMMR0JmpA-x86.asm
773
774 VMMR0_LIBS = \
775 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
776 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
777 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
778 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
779 VMMR0_LIBS += \
780 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
781 endif
782
783 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
784
785 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
786 VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
787 VMMR0_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
788 VMMR0_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
789 endif
790
791 VMMR0_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
792
793 if "$(KBUILD_TARGET)" == "win"
794 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
795 VMMR0_LIBS += $(VMMR0PdbTypeHack_1_TARGET)
796 VMMR0_LDFLAGS += /Export:PdbTypeHack
797
798 LIBRARIES += VMMR0PdbTypeHack
799 VMMR0PdbTypeHack_TEMPLATE = $(VMMR0_TEMPLATE)
800 VMMR0PdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
801 VMMR0PdbTypeHack_DEFS = $(VMMR0_DEFS)
802 VMMR0PdbTypeHack_DEFS.win = $(VMMR0_DEFS.win)
803 VMMR0PdbTypeHack_DEFS.win.x86 = $(VMMR0_DEFS.win.x86)
804 VMMR0PdbTypeHack_DEFS.win.amd64 = $(VMMR0_DEFS.win.amd64)
805 VMMR0PdbTypeHack_INCS = $(VMMR0_INCS)
806 VMMR0PdbTypeHack_INTERMEDIATES = $(VMMR0_INTERMEDIATES)
807 endif
808
809endif # !VBOX_ONLY_EXTPACKS
810
811
812
813ifndef VBOX_ONLY_EXTPACKS
814 #
815 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
816 #
817 LIBRARIES += SSMStandalone
818 SSMStandalone_TEMPLATE = VBOXR3EXE
819 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE
820 SSMStandalone_INCS = include
821 SSMStandalone_SOURCES = \
822 VMMR3/SSM.cpp \
823 VMMR3/CPUMR3Db.cpp
824endif # !VBOX_ONLY_EXTPACKS
825
826
827if !defined(VBOX_ONLY_EXTPACKS) \
828 && ( defined(VBOX_WITH_DTRACE_R3) \
829 || defined(VBOX_WITH_DTRACE_R0) \
830 || defined(VBOX_WITH_DTRACE_RC))
831 #
832 # Install the dtrace library files.
833 #
834 INSTALLS += VMMLibDTrace
835 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
836 VMMLibDTrace_SOURCES = \
837 dtrace/lib/vbox-types.d \
838 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
839 $(VMMLibDTrace_0_OUTDIR)/vm.d \
840 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
841 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
842 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
843 $(VMMLibDTrace_0_OUTDIR)/x86.d \
844
845
846 ##
847 # Turn the header $2 into the DTrace library script $1.
848 #
849 define def_vmm_lib_dtrace_preprocess
850 $$$$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
851 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$$<)
852 $$(QUIET)$(VBOX_VBOXCPP) -d \
853 -D VBOX_FOR_DTRACE_LIB \
854 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
855 -D IN_RING0 \
856 -D RT_C_DECLS_BEGIN= \
857 -D RT_C_DECLS_END= \
858 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
859 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
860 -D 'R0PTRTYPE(a_Type)=a_Type' \
861 -D 'AssertCompile(a_Expr)=' \
862 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
863 -D 'bool=uint8_t' \
864 $$(foreach def,\
865 $$(DEFS) \
866 $$(DEFS.$$(KBUILD_TARGET)) \
867 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
868 $$(VMM_COMMON_DEFS) \
869 $$(ARCH_BITS_DEFS)\
870 ,-D '$$(def)') \
871 $$< \
872 $$@
873 $$(QUIET)$$(CHMOD) 644 $$@
874 endef
875 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
876 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
877 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
878 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
879 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
880
881endif
882
883
884
885#
886# For vmmGetSvnRev.
887#
888VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
889
890#
891# Disable annoying warnings about array subscript above array bounds in aPages[]
892#
893ifneq ($(KBUILD_TARGET),win)
894 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
895 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
896 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
897 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
898 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
899endif
900
901#
902# Always optimize the interpreter.
903#
904if $(USERNAME) != "bird" || "$(KBUILD_TYPE)" == "release" #|| "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64"
905 if1of ($(KBUILD_TARGET), win)
906 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
907 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
908 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
909 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
910 else
911 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
912 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
913 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
914 VMMAll/IEMAll.cpp_CXXFLAGS += -fomit-frame-pointer # Omitting the frame pointer results in larger code, but it might be worth it. (esp addressing vs ebp?)
915 endif
916endif # bird wants good stacks
917
918
919# Alias the CPU database entries.
920$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
921
922
923#
924# Test for undefined symbols.
925#
926if1of ($(SYSMODS),VMMRC)
927 test-undef-rc:: $(PATH_TARGET)/undef-rc.run
928 OTHERS += $(PATH_TARGET)/undef-rc.run
929 CLEANS += $(PATH_TARGET)/undef-rc.run
930 $(PATH_TARGET)/undef-rc.run: \
931 $$(VMMRC_1_TARGET)
932 ifn1of ($(KBUILD_TARGET), linux solaris)
933 else
934 $(call MSG_L1,VMM: Testing for undefined symbols in VMMRC using nm...)
935 $(QUIET)$(VBOX_NM) $^ 2> /dev/null \
936 | $(SED) -n \
937 -e '/^ *U .*/!d' \
938 -e 's/ *U //' \
939 \
940 -e '/^g_VM\>/d'\
941 -e '/^g_CPUM\>/d'\
942 -e '/^g_Logger\>/d'\
943 -e '/^g_RelLogger\>/d'\
944 -e '/^g_TRPM\>/d'\
945 -e '/^g_TRPMCPU\>/d'\
946 -e '/^g_pSUPGlobalInfoPage\>/d'\
947 -e '/^g_trpmHyperCtxCore\>/d' \
948 -e '/^g_trpmGuestCtxCore\>/d' \
949 \
950 -e 's/\(.*\)$(DOLLAR)/ Undefined symbol: \1/' \
951 -e 'p' \
952 -e 'q 1'
953 endif
954 $(QUIET)$(APPEND) -t $@
955endif
956
957include $(FILE_KBUILD_SUB_FOOTER)
958
959
960# Alias the PGM templates to the object in which they are defined.
961PGMInternal.o \
962PGMBth.o PGMGst.o PGMShw.o \
963PGMBth.obj PGMGst.obj PGMShw.obj: PGM.o
964
965PGMAllBth.o PGMAllGst.o PGMAllShw.o \
966PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
967
968PGMRCBth.o PGMRCGst.o PGMRCShw.o \
969PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
970
971PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
972
973PGMInline.o PGMInline.obj: PGMDbg.o
974
975# Alias the IEM templates to the object in which they are instantiated.
976IEMInternal.o \
977IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
978IEMAllInstructionsOneByte.cpp.o IEMAllInstructionsOneByte.cpp.obj \
979IEMAllInstructionsTwoByte0f.cpp.o IEMAllInstructionsTwoByte0f.cpp.obj \
980IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
981IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAll.o
982
983# Alias the switcher templates.
984PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
985LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
986AMD64andLegacy.o AMD64andLegacy.obj: AMD64To32Bit.o AMD64ToPAE.o
987
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