Makefile.kmk revision 62690540b00cb711916728639049c18b31c206b0
# $Id$
## @file
# Top-level makefile for the devices, drivers and services.
#
#
# Copyright (C) 2006 InnoTek Systemberatung GmbH
#
# 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 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.
#
# If you received this file as part of a commercial VirtualBox
# distribution, then only the terms of your commercial VirtualBox
# license agreement apply instead of the previous paragraph.
#
DEPTH = ../../..
include $(PATH_KBUILD)/subheader.kmk
# Include sub-makefiles.
include $(PATH_SUB_CURRENT)/PC/BIOS/Makefile.kmk
include $(PATH_SUB_CURRENT)/Graphics/BIOS/Makefile.kmk
include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
include $(PATH_SUB_CURRENT)/Storage/testcase/Makefile.kmk
# Subdirs with complex makefiles.
SUBDIRS_LIBRARIES = PC/Etherboot-src
#
# Main targets.
#
LIBRARIES += DevicesR3 Drivers ServicesR0
DLLS += VBoxDDU VBoxDD VBoxDD2
SYSMODS += VBoxDDGC VBoxDD2GC VBoxDDR0 VBoxDD2R0
##
## Enable the pdm lock (experimental).
##
#DEFS += VBOX_WITH_PDM_LOCK
#
# VBoxDDU (shared object)
#
VBoxDDU_TEMPLATE = VBOXR3
VBoxDDU_DEFS = IN_VBOXDDU
ifdef VBOX_WITH_USB
VBoxDDU_DEFS.win = VBOX_WITH_USB
VBoxDDU_SDKS.win = WINPSDK W2K3DDK
else
VBoxDDU_SDKS.win = WINPSDK
endif
VBoxDDU_SOURCES = \
VBoxDDU_LIBS = \
$(LIB_RUNTIME)
ifeq ($(BUILD_TARGET),l4)
VBoxDDU_LIBS += \
$(L4_LIBDIR)/libl4sys.p.a
endif
VBoxDDU_LDFLAGS.darwin = -install_name @executable_path/VBoxDDU.dylib
VBoxDDU_LDFLAGS.linux = -Wl,--no-undefined
VBoxDDU_LDFLAGS.l4 = -Wl,--no-undefined
#
# VBoxDD (shared object)
#
VBoxDD_TEMPLATE = VBOXR3
VBoxDD_SDKS.win = WINPSDK DXSDK W2K3DDK VBOX_NTDLL
VBoxDD_SOURCES = \
VBoxDD_DEFS = VBOX_ACPI
ifdef VBOX_WITH_USB
VBoxDD_DEFS += VBOX_WITH_USB IN_USB_R3
endif
ifdef VBOX_WITH_ISCSI
VBoxDD_DEFS += VBOX_WITH_ISCSI
endif
VBoxDD_LIBS = \
$(PATH_LIB)/DevicesR3$(VBOX_SUFF_LIB) \
$(PATH_LIB)/Drivers$(VBOX_SUFF_LIB) \
$(PATH_LIB)/PcDefBiosLogo$(VBOX_SUFF_LIB) \
$(LIB_VMM) \
$(LIB_RUNTIME)
ifeq ($(BUILD_TARGET),win)
VBoxDD_LIBS += \
$(PATH_LIB)/VBoxDDU.lib \
$(PATH_LIB)/VBoxDD2.lib \
$(PATH_SDK_DXSDK_LIB)/dxguid.lib
else
VBoxDD_LIBS += \
$(INSTARGET_VBoxDDU) \
$(INSTARGET_VBoxDD2)
endif
ifeq ($(BUILD_TARGET),l4)
VBoxDD_LIBS += \
$(L4_LIBDIR)/libl4sys.p.a
endif
$(LIB_REM)
VBoxDD_LDFLAGS.darwin = -install_name @executable_path/VBoxDD.dylib \
-framework CoreAudio \
-framework IOKit \
-framework Carbon \
-framework DiskArbitration
VBoxDD_LDFLAGS.linux = -Wl,--no-undefined
VBoxDD_LDFLAGS.l4 = -Wl,--no-undefined
# damn, fix this.
ifeq ($(BUILD_TARGET),win)
$(PATH_LIB)/VBoxDD2.lib: $(PATH_BIN)/VBoxDD2.dll
$(PATH_LIB)/VBoxDDU.lib: $(PATH_BIN)/VBoxDDU.dll
endif
#
# VBoxDD2 (shared object)
#
VBoxDD2_TEMPLATE = VBOXR3
VBoxDD2_DEFS = IN_VBOXDD2
VBoxDD2_INCS := \
$(PATH_SUB_CURRENT)
VBoxDD2_SOURCES = \
VBoxDD2_LIBS = \
$(PATH_LIB)/PcBiosBin$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VgaBiosBin$(VBOX_SUFF_LIB) \
$(PATH_LIB)/NetBiosBin$(VBOX_SUFF_LIB) \
$(LIB_VMM) \
$(LIB_RUNTIME)
ifeq ($(BUILD_TARGET),l4)
VBoxDD2_LIBS += \
$(L4_LIBDIR)/libl4sys.p.a
endif
VBoxDD2_LIBS.darwin += $(LIB_REM)
VBoxDD2_LDFLAGS.darwin = -install_name @executable_path/VBoxDD2.dylib
VBoxDD2_LDFLAGS.linux = -Wl,--no-undefined
VBoxDD2_LDFLAGS.l4 = -Wl,--no-undefined
#
# DevicesR3 (library)
#
DevicesR3_TEMPLATE = VBOXR3
DevicesR3_SDKS.win = WINPSDK W2K3DDK
DevicesR3_INCS := \
$(PATH_SUB_CURRENT)
DevicesR3_SOURCES = \
ifeq (0,1)
DevicesR3_SOURCES += \
endif
ifdef VBOX_WITH_USB
DevicesR3_DEFS += VBOX_WITH_USB IN_USB_R3
DevicesR3_SOURCES += \
endif
DevicesR3_DEFS += VBOX_HGCM
DevicesR3_DEFS.linux += _GNU_SOURCE
DevicesR3_DEFS.l4 += _GNU_SOURCE
DevicesR3_CLEAN += $(PATH_TARGET)/vboxaml.hex $(PATH_TARGET)/vboxaml.aml
PC/DevACPI.cpp_DEPS = $(PATH_TARGET)/vboxaml.hex
PC/DevACPI.cpp_INCS = $(PATH_TARGET)
$(PATH_TARGET)/vboxaml.hex: PC/vbox.dsl
$(call MSG_TOOL,iasl,DevicesR3,$<,$@)
$(QUIET)$(VBOX_IASLCMD) -tc -vs -p $@ $<
# For finding PCIInternal.h from VBox/pci.h.
Bus/DevPCI.cpp_INCS = Bus
#
# VBoxDDGC (sysmod)
#
VBoxDDGC_TEMPLATE = VBOXGC
VBoxDDGC_DEFS =
VBoxDDGC_SYSSUFF = .gc
VBoxDDGC_INCS := \
$(PATH_SUB_CURRENT)
VBoxDDGC_SOURCES = \
ifdef VBOX_WITH_USB
VBoxDDGC_DEFS += VBOX_WITH_USB IN_USB_GC
VBoxDDGC_SOURCES += \
endif
ifeq ($(VBOX_LDR_FMT32),pe)
VBoxDDGC_LDFLAGS = -Entry:vgaMMIOWrite
endif
ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
VBoxDDGC_LIBS = \
$(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VMMGCImp$(VBOX_SUFF_LIB)
endif
#
# VBoxDDR0 (sysmod)
#
VBoxDDR0_TEMPLATE = VBOXR0
VBoxDDR0_SYSSUFF = .r0
VBoxDDR0_DEFS = IN_RT_R0
VBoxDDR0_INCS := \
$(PATH_SUB_CURRENT)
VBoxDDR0_SOURCES = \
ifdef VBOX_WITH_USB
VBoxDDR0_DEFS += VBOX_WITH_USB IN_USB_R0
VBoxDDR0_SOURCES += \
endif
ifeq ($(VBOX_LDR_FMT32),pe)
VBoxDDR0_LDFLAGS = -Entry:vgaMMIOWrite
endif
ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
VBoxDDR0_LIBS = $(PATH_LIB)/VMMR0Imp$(VBOX_SUFF_LIB)
endif
VBoxDDR0_LIBS += $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
ifeq ($(VBOX_LDR_FMT32),elf) # this is template stuff!
VBoxDDR0_LIBS += $(VBOX_GCC_LIBGCC)
endif
#
# VBoxDD2GC (LGPL sysmod)
#
VBoxDD2GC_TEMPLATE = VBOXGC
VBoxDD2GC_DEFS =
VBoxDD2GC_SYSSUFF = .gc
VBoxDD2GC_INCS := \
$(PATH_SUB_CURRENT)
VBoxDD2GC_SOURCES = \
ifeq ($(VBOX_LDR_FMT32),pe)
VBoxDD2GC_LDFLAGS = -Entry:apicMMIOWrite
endif
ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
VBoxDD2GC_LIBS = \
$(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VMMGCImp$(VBOX_SUFF_LIB)
endif
#
# VBoxDD2R0 (LGPL sysmod)
#
VBoxDD2R0_TEMPLATE = VBOXR0
VBoxDD2R0_DEFS = IN_RT_R0
VBoxDD2R0_SYSSUFF = .r0
VBoxDD2R0_INCS := \
$(PATH_SUB_CURRENT)
VBoxDD2R0_SOURCES = \
ifeq ($(VBOX_LDR_FMT),pe)
VBoxDD2R0_LDFLAGS = -Entry:apicMMIOWrite
endif
ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
VBoxDD2R0_LIBS = $(PATH_LIB)/VMMR0Imp$(VBOX_SUFF_LIB)
endif
VBoxDD2R0_LIBS += $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB)
ifeq ($(VBOX_LDR_FMT),elf)
VBoxDD2R0_LIBS += $(VBOX_GCC_LIBGCC)
endif
#
# Drivers (library)
#
ifeq ($(BUILD_TARGET),l4) # We are using real Linux headers, not the cleaned up user space ones
Drivers_TEMPLATE = VBOXR3NP
else
Drivers_TEMPLATE = VBOXR3
endif
Drivers_SDKS.win = WINPSDK W2K3DDK
Storage/DrvHostDVD.cpp_SDKS.win = W2K3DDK
Drivers_DEFS = IN_IDE_R3
Drivers_DEFS.win.x86 += _WIN32_WINNT=0x0500
Drivers_DEFS.win.amd64 += _WIN32_WINNT=0x0510
Drivers_INCS := \
$(PATH_SUB_CURRENT) \
Drivers_SOURCES = \
# -- OS specific --
ifeq ($(BUILD_TARGET),darwin)
Drivers_SOURCES := $(filter-out \
, $(Drivers_SOURCES)) \
endif # darwin
ifeq ($(BUILD_TARGET),freebsd)
Drivers_SOURCES := $(filter-out \
, $(Drivers_SOURCES))
endif # freebsd
ifeq ($(BUILD_TARGET),l4)
Drivers_SOURCES = \
endif # l4
ifeq ($(BUILD_TARGET),os2)
Drivers_SOURCES := $(filter-out \
, $(Drivers_SOURCES))
endif
# -- features --
ifdef VBOX_WITH_ISCSI
Drivers_SOURCES += \
Drivers_DEFS += VBOX_WITH_ISCSI
endif # VBOX_WITH_ISCSI
ifdef VBOX_WITH_ALSA
Drivers_DEFS.linux += VBOX_WITH_ALSA
VBoxDD_LIBS.linux += asound
endif
ifdef VBOX_WITH_USB
Drivers_DEFS += VBOX_WITH_USB IN_USB_R3
Drivers_SOURCES += \
ifdef VBOX_WITH_VRDP
Drivers_DEFS += VBOX_VRDP
Drivers_SOURCES += \
endif
Drivers_DEFS.darwin += VUSB_HAVE_USBPROXY_DEVICE
Drivers_DEFS.linux += VUSB_HAVE_USBPROXY_DEVICE
ifdef VBOX_WITHOUT_LINUX_COMPILER_H
Drivers_DEFS.linux += VBOX_WITHOUT_LINUX_COMPILER_H
endif
Drivers_DEFS.l4 += VUSB_HAVE_USBPROXY_DEVICE
Drivers_SOURCES.l4 += \
Drivers_DEFS.win += VUSB_HAVE_USBPROXY_DEVICE
Drivers_SOURCES.win += \
endif # VBOX_WITH_USB
#
# Ring-0 Services (library, linked into VMMR0.r0)
#
ServicesR0_TEMPLATE = VBOXR0
ServicesR0_DEFS = IN_INTNET_R0 IN_RT_R0
ServicesR0_SOURCES = \
#
# Internal Networking - Ring-3 Testcase for the Ring-0 code (a bit hackish).
#
ifdef VBOX_WITH_TESTCASES
PROGRAMS += tstIntNetR0
tstIntNetR0_TEMPLATE = VBOXR3TSTEXE
tstIntNetR0_DEFS = IN_INTNET_R0
tstIntNetR0_SOURCES = \
tstIntNetR0_LIBS = \
$(LIB_RUNTIME)
endif
include $(PATH_KBUILD)/subfooter.kmk