Makefile.kmk revision b4de7a5b43185caa2308ad7bb65085dbbf1f9e69
# $Id$
## @file
# Top-level makefile for the VMM.
#
#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
DEPTH = ../../..
include $(KBUILD_PATH)/subheader.kmk
## @todo get rid of these.
# Enable the PDM lock.
ifdef VBOX_WITH_PDM_LOCK
DEFS += VBOX_WITH_PDM_LOCK
endif
ifdef VBOX_WITH_INTERNAL_NETWORKING
DEFS += VBOX_WITH_INTERNAL_NETWORKING
endif
# Include sub-makefiles.
include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
#
#
LIBRARIES += VMMR3
VMMR3_TEMPLATE = VBOXR3
VMMR3_DEFS = IN_VMM_R3 IN_PDM_R3 IN_CFGM_R3 IN_IOM_R3 IN_VM_R3 IN_CPUM_R3 IN_SELM_R3 IN_PGM_R3 IN_TRPM_R3 IN_MM_R3 IN_DBG_R3 \
IN_DBGF_R3 IN_PATM_R3 IN_DIS_R3 IN_STAM_R3 IN_CSAM_R3 IN_EM_R3 IN_TM_R3 IN_SSM_R3 IN_HWACCM_R3 IN_GMM_R3
ifdef VBOX_WITH_IDT_PATCHING
VMMR3_DEFS += VBOX_WITH_IDT_PATCHING
endif
ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
VMMR3_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
endif
VMMR3_INCS := \
PATM \
$(PATH_SUB_CURRENT)
VMMR3_SOURCES = \
CFGM.cpp \
CPUM.cpp \
DBGF.cpp \
EM.cpp \
IOM.cpp \
GMM.cpp \
MM.cpp \
PDM.cpp \
PGM.cpp \
SELM.cpp \
SSM.cpp \
STAM.cpp \
TM.cpp \
TRPM.cpp \
VM.cpp \
VMM.cpp \
VMMR3_SOURCES.x86 += \
VMMSwitcher/32BitTo32Bit.asm \
VMMSwitcher/32BitToPAE.asm \
ifdef VBOX_WITH_USB
VMMR3_DEFS += VBOX_WITH_USB
VMMR3_SOURCES += PDMUsb.cpp
endif
ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
VMMR3_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
VMMR3_DEFS.linux += __USE_FILE_OFFSET64 __USE_LARGEFILE64
VMMR3_SOURCES += PDMAsyncCompletion.cpp
VMMR3_SOURCES.linux += \
VMMR3_SOURCES.win += \
VMMR3_SOURCES.darwin += \
endif
#
# The VMM DLL.
#
DLLS += VBoxVMM
VBoxVMM_TEMPLATE = VBOXR3
VBoxVMM_DEFS = $(VMMR3_DEFS)
VBoxVMM_SOURCES = VBoxVMMDeps.cpp
VBoxVMM_LIBS = \
$(PATH_LIB)/VMMR3$(VBOX_SUFF_LIB) \
$(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB)
ifdef VBOX_WITH_DEBUGGER
VBoxVMM_LIBS += \
$(PATH_LIB)/Debugger$(VBOX_SUFF_LIB)
endif
VBoxVMM_LIBS += \
$(LIB_REM) \
$(LIB_RUNTIME)
VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
VBoxVMM_LDFLAGS.win = /DELAYLOAD:dbghelp.dll
VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
VBoxVMM_LDFLAGS.darwin = -install_name @executable_path/VBoxVMM.dylib
VBoxVMM_LDFLAGS.solaris = -mimpure-text
ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
ifeq ($(KBUILD_HOST), linux)
VBoxVMM_LIBS += aio
endif
endif
ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
#
#
LIBRARIES += VMMGCBuiltin
VMMGCBuiltin_TEMPLATE = VBOXGC
ifeq ($(VBOX_LDR_FMT32),pe)
VMMGCBuiltin_SOURCES = VMMGC/VMMGCBuiltin.def
endif
ifeq ($(VBOX_LDR_FMT32),lx)
VMMGCBuiltin_SOURCES = $(PATH_TARGET)/VMMGCBuiltin.def
$(PATH_TARGET)/VMMGCBuiltin.def: VMMGC/VMMGCBuiltin.def | $(call DIRDEP,$(PATH_TARGET))
$(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' $< > $@.tmp
$(MV) -f $@.tmp $@
endif
#
#
LIBRARIES += VMMGCImp
VMMGCImp_TEMPLATE = VBOXGC
ifeq ($(VBOX_LDR_FMT32),pe)
VMMGCImp_SOURCES = VMMGC/VMMGC.def
endif
ifeq ($(VBOX_LDR_FMT32),lx)
VMMGCImp_SOURCES = $(PATH_TARGET)/VMMGC.def
$(PATH_TARGET)/VMMGC.def: VMMGC/VMMGC.def | $(call DIRDEP,$(PATH_TARGET))
$(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' $< > $@.tmp
$(APPEND) "$@.tmp" ""
$(APPEND) "$@.tmp" " ___ehInit"
$(MV) -f $@.tmp $@
endif
endif # GC: pe + lx
ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
#
#
LIBRARIES += VMMR0Imp
VMMR0Imp_TEMPLATE = VBOXR0
ifeq ($(VBOX_LDR_FMT),pe)
VMMR0Imp_SOURCES = VMMR0/VMMR0.def
endif
ifeq ($(VBOX_LDR_FMT),lx)
VMMR0Imp_SOURCES = $(PATH_TARGET)/VMMR0.def
$(PATH_TARGET)/VMMR0.def: VMMR0/VMMR0.def | $(call DIRDEP,$(PATH_TARGET))
$(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' $< > $@.tmp
$(APPEND) "$@.tmp" ""
$(APPEND) "$@.tmp" " ___ehInit"
$(MV) -f $@.tmp $@
endif
endif # R0: pe + lx
#
# VMMGC.gc
#
SYSMODS += VMMGC
VMMGC_TEMPLATE = VBOXGC
VMMGC_INCS := \
$(PATH_SUB_CURRENT) \
VMMGC \
PATM
VMMGC_DEFS = IN_VMM_GC IN_PDM_GC IN_CFGM_GC IN_IOM_GC IN_MM_GC IN_RT_GC IN_TRPM_GC IN_SELM_GC IN_VM_GC IN_IOM_GC IN_DIS_GC DIS_CORE_ONLY IN_PGM_GC IN_CPUM_GC IN_EM_GC IN_TM_GC IN_PATM_GC IN_CSAM_GC IN_REM_GC IN_DBGF_GC
ifdef VBOX_WITH_IDT_PATCHING
VMMGC_DEFS += VBOX_WITH_IDT_PATCHING
endif
VMMGC_SYSSUFF = .gc
VMMGC_LIBS = \
$(PATH_LIB)/DisasmGC$(VBOX_SUFF_LIB) \
$(PATH_LIB)/RuntimeGC$(VBOX_SUFF_LIB)
ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
VMMGC_LIBS += \
$(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB)
endif
ifeq ($(VBOX_LDR_FMT32),pe)
VMMGC_LDFLAGS = -Entry:VMMGCEntry
endif
VMMGC_SOURCES = \
ifeq ($(VBOX_LDR_FMT32),pe)
VMMGC_SOURCES += VMMGC/VMMGC.def
endif
ifeq ($(VBOX_LDR_FMT32),lx)
VMMGC_SOURCES += $(PATH_TARGET)/VMMGC.def
endif
# the very last one.
VMMGC_SOURCES += VMMGC/VMMGC99.asm
VMMGC/VMMGCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMGCDeps.cpp to .c
#
# VMMR0.r0
#
SYSMODS += VMMR0
VMMR0_TEMPLATE = VBOXR0
VMMR0_INCS := \
$(PATH_SUB_CURRENT) \
PATM
VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_TRPM_R0 IN_CPUM_R0 IN_VM_R0 IN_TM_R0 IN_INTNET_R0 IN_HWACCM_R0 IN_EM_R0 IN_PDM_R0 IN_PGM_R0 IN_DIS_R0 IN_MM_R0 IN_SELM_R0 IN_CSAM_R0 IN_PATM_R0 IN_DBGF_R0 IN_REM_R0 IN_IOM_R0 IN_GVMM_R0 IN_GMM_R0 DIS_CORE_ONLY
ifdef VBOX_WITH_IDT_PATCHING
VMMR0_DEFS += VBOX_WITH_IDT_PATCHING
endif
ifeq ($(VBOX_LDR_FMT),pe)
VMMR0_LDFLAGS = -Entry:VMMR0EntryEx
endif
ifeq ($(VBOX_LDR_FMT),elf)
VMMR0_LDFLAGS = -e VMMR0EntryEx
endif
VMMR0_SYSSUFF = .r0
VMMR0_SOURCES = \
ifeq ($(VBOX_LDR_FMT),pe)
VMMR0_SOURCES += VMMR0/VMMR0.def
endif
ifeq ($(VBOX_LDR_FMT),lx)
VMMR0_SOURCES += $(PATH_TARGET)/VMMR0.def
endif
VMMR0_LIBS = \
$(PATH_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
$(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
$(PATH_LIB)/DisasmR0$(VBOX_SUFF_LIB)
ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
VMMR0_LIBS += \
$(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB)
endif
include $(KBUILD_PATH)/subfooter.kmk
# Alias the PGM templates to the object in which they are defined.