VirtualBox

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

Last change on this file since 79891 was 79891, checked in by vboxsync, 5 years ago

*.kmk: Preparing for dropping 32-bit host support. Introducing a variable VBOX_SUPPORTED_HOST_ARCHS controlling what's supported and not. bugref:9511

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