Makefile.kmk revision ad668002ef2563fe2b6e2bd892eb38c9a9239501
6d1a8b922859f63b629351cba4793043627d7c8fvboxsync# Top-level sub-makefile for the devices, drivers and services.
772269936494ffaddd0750ba9e28e805ba81398cvboxsync# Copyright (C) 2006-2012 Oracle Corporation
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# available from http://www.virtualbox.org. This file is free software;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# General Public License (GPL) as published by the Free Software
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
995825c1ba4ab8b5d5b52ce33327f4630ad7ca64vboxsyncSUB_DEPTH = ../../..
27537ffef7291d0bb3a24e459a6b94c65586defevboxsyncinclude $(KBUILD_PATH)/subheader.kmk
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync# Make sure our Config.kmk is included.
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsyncifndef VBOX_DEVICES_CONFIG_KMK_INCLUDED
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync include $(PATH_SUB_CURRENT)/Config.kmk
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync# Include sub-makefiles.
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsyncinclude $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsyncif defined(VBOX_WITH_INTEL_PXE) || defined(VBOX_ONLY_EXTPACKS)
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync include $(PATH_SUB_CURRENT)/PC/PXE/Makefile.kmk
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsyncelse if defined(VBOX_WITH_PXE_ROM)
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync if !defined(VBOX_WITHOUT_ETHERBOOT)
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync include $(PATH_SUB_CURRENT)/PC/Etherboot-src/Makefile.kmk
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync if !defined(VBOX_WITHOUT_IPXE)
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync include $(PATH_SUB_CURRENT)/PC/ipxe/Makefile.kmk
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsyncif !defined(VBOX_ONLY_EXTPACKS) # Goes on almost to the end of the file.
4a57ce2d8a2b7574c447193f04690a1b16db40ffvboxsync include $(PATH_SUB_CURRENT)/BiosCommonCode/Makefile.kmk
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync include $(PATH_SUB_CURRENT)/PC/BIOS/Makefile.kmk
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync include $(PATH_SUB_CURRENT)/Graphics/BIOS/Makefile.kmk
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync # Main targets.
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync LIBRARIES += ServicesR0
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync DLLS += VBoxDDU VBoxDD VBoxDD2
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync SYSMODS += VBoxDDR0 VBoxDD2R0
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync ifdef VBOX_WITH_RAW_MODE
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync SYSMODS += VBoxDDGC VBoxDD2GC
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync # VBoxDDU (shared object)
5c40e09e0c65ac2b73caaddaf4f24117e11a2637vboxsync VBoxDDU_TEMPLATE = VBoxR3DllWarnNoPic
5c40e09e0c65ac2b73caaddaf4f24117e11a2637vboxsync VBoxDDU_NAME = $(basename $(notdir $(LIB_DDU)))
5c40e09e0c65ac2b73caaddaf4f24117e11a2637vboxsync VBoxDDU_INST.darwin = $(INST_DLL) $(INST_TESTCASE)
5c40e09e0c65ac2b73caaddaf4f24117e11a2637vboxsync VBoxDDU_DEFS = IN_VBOXDDU
5c40e09e0c65ac2b73caaddaf4f24117e11a2637vboxsync ifdef VBOX_WITH_VUSB
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDDU_DEFS += VBOX_WITH_VUSB
4e46eee5a96078ebec6cb36939b794a391f1ade0vboxsync ifdef VBOX_WITH_USB
4e46eee5a96078ebec6cb36939b794a391f1ade0vboxsync VBoxDDU_DEFS += VBOX_WITH_USB IN_USBLIB
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDDU_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync if defined(VBOX_WITH_EHCI_IMPL) && !defined(VBOX_WITH_EXTPACK_PUEL)
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDDU_DEFS += VBOX_WITH_EHCI_IMPL
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN
84d5d5272edbc1f41f963221b74a7eda71d0e2a2vboxsync VBoxDDU_DEFS.darwin += VBOX_WITH_NEW_USB_CODE_ON_DARWIN
7fdd763c6c507adde17f4bd278b15891b8ebf568vboxsync VBoxDDU_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK)
84d5d5272edbc1f41f963221b74a7eda71d0e2a2vboxsync VBoxDDU_SOURCES = \
3b3bc8a9383a065307e540b83fc3a3d6c548a082vboxsync ifdef VBOX_WITH_USB
10f224d85cd1135f0ca4ee1c1c1a7e15988bed58vboxsync VBoxDDU_LIBS = \
10f224d85cd1135f0ca4ee1c1c1a7e15988bed58vboxsync $(LIB_RUNTIME) \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync $(PATH_STAGE_LIB)/StorageLib$(VBOX_SUFF_LIB)
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync ifdef VBOX_WITH_USB
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDDU_LIBS += \
84d5d5272edbc1f41f963221b74a7eda71d0e2a2vboxsync $(PATH_STAGE_LIB)/USBLib$(VBOX_SUFF_LIB)
48eca14ff165b52c459d7c3090f1f5dba0d1fedbvboxsync $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib
bbc0a3fc49446bf8fa1fcfe669c10875701692bcvboxsync ifeq ($(KBUILD_TARGET),l4)
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDDU_LIBS += \
bbc0a3fc49446bf8fa1fcfe669c10875701692bcvboxsync VBoxDDU_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDDU.dylib
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync ifdef VBOX_WITH_USB
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync VBoxDDU_LDFLAGS.darwin += -framework IOKit
c4057c0180a9f46c27f9190563307209f0514d6dvboxsync VBoxDDU_LDFLAGS.linux = -Wl,--no-undefined
c4057c0180a9f46c27f9190563307209f0514d6dvboxsync VBoxDDU_LDFLAGS.l4 = -Wl,--no-undefined
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync # VBoxDDULnxHostR3 (Only needed for l4, currently for executing vditool on L4Linux.)
c4057c0180a9f46c27f9190563307209f0514d6dvboxsync ifeq ($(KBUILD_TARGET),l4)
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync LIBRARIES += VBoxDDULnxHostR3
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync VBoxDDULnxHostR3_TEMPLATE = VBOXLNXHOSTR3LIB
37eed2e0302518c6f0e74856c39d52a9417a551cvboxsync VBoxDDULnxHostR3_DEFS = IN_VBOXDDU
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDDULnxHostR3_SOURCES = $(VBoxDDU_SOURCES)
67b414aa650cb27688d387c2184f8488d801cd72vboxsync # VBoxDD (shared object)
67b414aa650cb27688d387c2184f8488d801cd72vboxsync VBoxDD_TEMPLATE = VBoxR3DllWarnNoPic
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDD_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
67b414aa650cb27688d387c2184f8488d801cd72vboxsync Storage/DrvHostDVD.cpp_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK)
67b414aa650cb27688d387c2184f8488d801cd72vboxsync VBoxDD_INCS = \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDD_DEFS = \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBOX_ACPI \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBOX_HGCM_HOST_CODE \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBOX_WITH_HGCM \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync $(if $(VBOX_BIOS_DMI_FALLBACK),VBOX_BIOS_DMI_FALLBACK,) \
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBOX_WITH_DMI_CHASSIS \
7fdd763c6c507adde17f4bd278b15891b8ebf568vboxsync VBOX_WITH_DMI_OEMSTRINGS
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDD_DEFS.win = _WIN32_WINNT=0x0510
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync ifeq ($(KBUILD_TARGET_ARCH),x86)
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDD_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE
9e201d78ac6efdd08550263f2e146cdb76e9d49bvboxsync VBoxDD_SOURCES = \
VBoxDD_LDFLAGS.linux = -Wl,--no-undefined
VBoxDD_LDFLAGS.l4 = -Wl,--no-undefined
VBoxDD_SOURCES += build/VBoxDD.d
VBoxDD_DEFS.darwin += VUSB_HAVE_USBPROXY_DEVICE
VBoxDD_DEFS.darwin += VBOX_WITH_NEW_USB_CODE_ON_DARWIN
VBoxDD_DEFS.linux += \
VBoxDD_SOURCES.linux += \
VBoxDD_DEFS.l4 += VUSB_HAVE_USBPROXY_DEVICE
VBoxDD_SOURCES.l4 += \
VBoxDD_DEFS.os2 += VUSB_HAVE_USBPROXY_DEVICE
VBoxDD_SOURCES.os2 += \
VBoxDD_DEFS.win += VUSB_HAVE_USBPROXY_DEVICE
VBoxDD_SOURCES.win += \
VBoxDD_DEFS.solaris += VUSB_HAVE_USBPROXY_DEVICE
VBoxDD_DEFS.freebsd += VUSB_HAVE_USBPROXY_DEVICE
include $(PATH_SUB_CURRENT)/Network/lwip/Makefile.kmk
include $(PATH_SUB_CURRENT)/Network/lwip-new/Makefile.kmk
VBoxDD_SOURCES += Network/DevINIP.cpp
VBoxDD_SOURCES.linux += \
Storage/DrvVD.cpp_INCS = $(LWIP_INCS)
VBoxDD_SOURCES += EFI/DevOVMF.cpp
VBoxDD_DEFS.linux += VBOX_WITH_ALSA
VBoxDD_SOURCES.linux += \
VBoxDD_DEFS.linux += VBOX_WITH_PULSE
VBoxDD_SOURCES.linux += \
VBoxDD_DEFS.freebsd += VBOX_WITH_PULSE
VBOX_SLIRP_SOURCES += Network/slirp/bsd/kern/subr_sbuf.c
Network/slirp/misc.c_DEFS += $(if $(VBOX_NAT_MEM_DEBUG),VBOX_NAT_MEM_DEBUG,)
$(1)/slirp/bsd/sys \
$(1)/slirp/bsd/sys/sys \
$(1)/slirp/bsd/$(VBOX_SLIRP_BSD_ARCH)/include \
$(1)/slirp/bsd/netinet \
$(1)/slirp/libalias
$(1)/slirp/libalias \
$(1)/slirp/dnsproxy
$(file)_INCS += $(1)/slirp/dnsproxy
$(filter-out Storage/DrvHostFloppy%, $(VBoxDD_SOURCES)) \
VBoxDD_SOURCES.l4 += \
VBoxDD_SOURCES.linux += \
VBoxDD_SOURCES := $(filter-out Storage/DrvHost%, $(VBoxDD_SOURCES))
VBoxDD_SOURCES := $(filter-out Storage/DrvHostFloppy%, $(VBoxDD_SOURCES))
VBoxDD_SOURCES += Audio/ossaudio.c
VBoxDD_DEFS.win += VBOX_WITH_WIN_PARPORT_SUP
VBoxDD_SOURCES.win += \
VBoxDD_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
$(PATH_STAGE_LIB)/VBoxDD2.lib \
$(PATH_SDK_$(VBOX_WINDDK)_LIB)/dxguid.lib
$(L4_LIBDIR)/libl4sys.p.a
VBoxDD_LIBS.darwin += \
VBoxDD_CLEAN += $(VBoxDD_0_OUTDIR)/vboxdsl.hex
$(VBoxDD_0_OUTDIR)/vboxaml.hex \
$(VBoxDD_0_OUTDIR)/vboxaml.aml \
$(VBoxDD_0_OUTDIR)/vboxssdt-standard.hex \
$(VBoxDD_0_OUTDIR)/vboxssdt-standard.aml \
$(VBoxDD_0_OUTDIR)/vboxssdt-standard.aml.tmp \
$(VBoxDD_0_OUTDIR)/vboxssdt-cpuhotplug.hex \
$(VBoxDD_0_OUTDIR)/vboxssdt-cpuhotplug.aml \
$(VBoxDD_0_OUTDIR)/vboxssdt-cpuhotplug.aml.tmp \
$(VBoxDD_0_OUTDIR)/vboxssdt-cpuhotplug.aml.pre
$(VBoxDD_0_OUTDIR)/vboxaml.hex \
$(VBoxDD_0_OUTDIR)/vboxssdt-standard.hex \
$(VBoxDD_0_OUTDIR)/vboxssdt-cpuhotplug.hex
$(QUIET)$(SED) "s/AmlCode/AmlCodeSsdtStandard/g" \
$$(VBoxDD_0_OUTDIR)/vboxssdt-cpuhotplug.hex: $(PATH_SUB_CURRENT)/PC/vbox-cpuhotplug.dsl | $$(dir $$@)
$(QUIET)$(SED) "s/AmlCode/AmlCodeSsdtCpuHotPlug/g" \
PC/ACPI/VBoxAcpi.cpp_INCS = $(VBoxDD_0_OUTDIR)
Bus/DevPCI.cpp_INCS = Bus
Bus/DevPciIch9.cpp_INCS = Bus
Bus/MsiCommon.cpp_INCS = Bus
Bus/MsixCommon.cpp_INCS = Bus
Bus/DevPciRaw.cpp_INCS = Bus
Graphics/DevVGA.cpp_INCS = $(VgaBiosBin_0_OUTDIR)
VBoxDDGC_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE
$(if $(VBOX_WITH_PXE_ROM),$(if $(VBOX_WITHOUT_IPXE),$(PATH_STAGE_LIB)/NetBiosBin$(VBOX_SUFF_LIB),$(PATH_STAGE_LIB)/iPxeBiosBin$(VBOX_SUFF_LIB)),) \
$(L4_LIBDIR)/libl4sys.p.a
VBoxDD2_LIBS.darwin += $(LIB_REM)
VBoxDD2_LDFLAGS.linux = -Wl,--no-undefined
VBoxDD2_LDFLAGS.l4 = -Wl,--no-undefined
VBoxDDR0_DEFS.darwin.x86= VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 VBOX_WITH_2X_4GB_ADDR_SPACE
VBoxDDR0_DEFS.win += VBOX_WITH_WIN_PARPORT_SUP
VBoxDDR0_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
# Ring-0 Services (library, linked into VMMR0.r0)
$(if $(VBOX_WITH_PCI_PASSTHROUGH),Bus/SrvPciRawR0.cpp,)
Network/SrvIntNetR0.cpp_CXXFLAGS := $(if-expr $(KBUILD_TARGET) == "win",,$(VBOX_GCC_Wno-array_bounds))
Network/testcase/tstIntNetR0.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
VBoxEhciR3_SOURCES = USB/DevEHCI.cpp
VBoxEhciR0_SOURCES = USB/DevEHCI.cpp
VBoxEhciRC_SOURCES = USB/DevEHCI.cpp
VBoxPciRawR3_SOURCES = Bus/DevPciRaw.cpp
VBoxPciRawDrv_SOURCES = Bus/DrvPciRaw.cpp
VBoxPciRawR0_SOURCES = Bus/DevPciRaw.cpp
Bus/DevPciRaw.cpp_INCS = Bus