VirtualBox

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

Last change on this file since 77847 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

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