Makefile.kmk revision b74ccafbc82332da22fc688b3f26dd6adf56ece4
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync# Sub-Makefile for the support library and the drivers/modules/kexts it uses.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Copyright (C) 2006-2010 Sun Microsystems, Inc.
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync# available from http://www.virtualbox.org. This file is free software;
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync# 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.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# The contents of this file may alternatively be used under the terms
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# of the Common Development and Distribution License Version 1.0
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# VirtualBox OSE distribution, in which case the provisions of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# CDDL are applicable instead of those of the GPL.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# You may elect to license modified versions of this file under the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# terms and conditions of either the GPL or the CDDL or both.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync# additional information or have any questions.
cf57145d4697dceca3f0542b370c20f7a2c5c6e8vboxsyncSUB_DEPTH = ../../../..
cf57145d4697dceca3f0542b370c20f7a2c5c6e8vboxsyncinclude $(KBUILD_PATH)/subheader.kmk
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncLIBRARIES += SUPR3 SUPR3Static SUPR3HardenedStatic
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncif !defined(VBOX_ONLY_DOCS) && !defined(VBOX_ONLY_TESTSUITE)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT)),)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync LIBRARIES += SUPR0
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync ifdef VBOX_WITH_SUPSVC
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync PROGRAMS += VBoxSupSvc
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync ifdef VBOX_WITH_VBOXDRV
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync LIBRARIES += SUPR0IdcClient
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync INSTALLS.linux += vboxdrv-mod vboxdrv-sh
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync INSTALLS.freebsd += vboxdrv-mod vboxdrv-sh
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync # Include sub-makefile(s).
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync # Populate FILES_VBOXDRV_NOBIN and FILES_VBOXDRV_BIN
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync ifeq ($(KBUILD_TARGET),linux)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync ifeq ($(KBUILD_TARGET),freebsd)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync include $(PATH_SUB_CURRENT)/freebsd/files_vboxdrv
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncendif # !defined(VBOX_ONLY_DOCS) && !defined(VBOX_ONLY_TESTSUITE)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync# The Ring-3 Support Library (this is linked into the IPRT dll, VBoxRT).
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncifneq ($(filter l4%,$(KBUILD_TARGET) $(BUILD_TARGET_SUB)),)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync # L4 has trouble with -pedantic. It also make trouble when inlining is not enabled.
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync SUPR3_TEMPLATE = VBOXR3NP
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync SUPR3_TEMPLATE = VBOXR3
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3_DEFS = \
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync IN_SUP_R3 IN_RT_R3 \
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC) \
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3_INCS := $(PATH_SUB_CURRENT)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3_SOURCES = \
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync# Static version of SUPR3.
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3Static_TEMPLATE = VBOXR3STATIC
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3Static_EXTENDS = SUPR3
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync# The static part of the hardened support library (ring-3).
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3HardenedStatic_TEMPLATE = VBOXR3HARDENEDLIB
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3HardenedStatic_DEFS = IN_SUP_HARDENED_R3
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3HardenedStatic_DEFS += \
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC,) \
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3HardenedStatic_INCS = .
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR3HardenedStatic_SOURCES = \
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncif !defined(VBOX_ONLY_DOCS) && !defined(VBOX_ONLY_TESTSUITE)
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync# VBoxSupSvc - The system wide service/daemon.
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsyncVBoxSupSvc_TEMPLATE = VBOXR3EXE
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsyncVBoxSupSvc_SOURCES = \
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync $(KBUILD_TARGET)/SUPSvc-$(KBUILD_TARGET).cpp
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsyncif1of ($(KBUILD_TARGET), win)
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync VBoxSupSvc_SOURCES += \
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsyncifn1of ($(KBUILD_TARGET), win)
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync VBoxSupSvc_SOURCES += \
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsyncVBoxSupSvc_LIBS = \
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync $(LIB_RUNTIME)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync# SUPR0 - The Ring-0 Import / Thunk library.
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncSUPR0_TEMPLATE = VBoxR0
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsyncifeq ($(VBOX_LDR_FMT),pe)
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync SUPR0_SOURCES += SUPR0.def
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsyncifeq ($(VBOX_LDR_FMT),lx)
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsyncSUPR0_SOURCES += $$(PATH_SUPR0)/SUPR0.def
65d63f09bebb772a9549e353e9bd8cb8976913a7vboxsync$$(PATH_SUPR0)/SUPR0.def: $(PATH_SUB_CURRENT)/SUPR0.def | $$(dir $$@)
SUPR0IdcClient_SDKS.win = W2K3DDK WINPSDKINCS
# VBoxDrv.sys - The Windows driver.
SUPDrv.c \
VBoxDrv_LDFLAGS.x86 = -Entry:DriverEntry@8
VBoxDrv_LDFLAGS.amd64 = -Entry:DriverEntry
$(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
$(PATH_SDK_W2K3DDK_LIB)/hal.lib \
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf
VBoxDrv-inf_BLDDIRS = $(PATH_TARGET)/VBoxDrvCat.dir
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf: $(PATH_SUB_CURRENT)/win/VBoxDrv.inf $(MAKEFILE_CURRENT) | $$(call DIRDEP,$$(@D))
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys \
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys: $$(TARGET_VBoxDrv) | $$(call DIRDEP,$$(@D))
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat: \
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf \
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys
# vboxdrv.ko - The Linux Kernel Module (syntax check only).
vboxdrv_DEFS = KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) MODULE IN_RT_R0 IN_SUP_R0 CONFIG_VBOXDRV_AS_MISC
$(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
vboxdrv_LIBS.debug = $(vboxdrv_LIBS) $(VBOX_GCC_LIBGCC)
SUPDrv.c \
$(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).mod.c
vboxdrv-mod_INST = bin/src/vboxdrv/
$(PATH_vboxdrv-mod)/dkms.conf) \
$(PATH_vboxdrv-mod)/dkms.conf \
vboxdrv-sh_INST = bin/src/vboxdrv
$(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers)
$(PATH_TARGET)/vboxdrv-sh-1.dep \
$(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
$(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxdrv;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
$$(PATH_vboxdrv-mod)/dkms.conf: \
$(PATH_SUB_CURRENT)/linux/dkms.conf \
includedep $(PATH_TARGET)/vboxdrv-sh-1.dep
$(PATH_SUB_CURRENT)/linux/Makefile \
$$(if $$(eq $$(Support/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
%$(QUIET2)$(RM) -f -- $(PATH_TARGET)/vboxdrv-sh-1.dep
%$(QUIET2)$(APPEND) '$(PATH_TARGET)/vboxdrv-sh-1.dep' 'Support/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
# VBoxDrv.kext - The Darwin Kernel Extension.
SYSMODS.x86 += VBoxDrvTiger
VBoxDrvTiger_INST = $(INST_VBOXDRV_TIGER)Contents/MacOS/
VBoxDrvTiger_DEFS.debug += DEBUG_DARWIN_GIP
SUPDrv.c \
INSTALLS += VBoxDrvTiger.kext
VBoxDrvTiger.kext_INST = $(INST_VBOXDRV_TIGER)Contents/
$$(PATH_VBoxDrvTiger.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info-Tiger.plist $(VBOX_VERSION_MK) | $$(dir $$@)
VBoxDrv_INST = $(INST_VBOXDRV)Contents/MacOS/
INSTALLS += VBoxDrv.kext
VBoxDrv.kext_INST = $(INST_VBOXDRV)Contents/
$(PATH_SUB_CURRENT)/darwin/Info.plist \
# VBoxDrv.sys - The OS/2 driver.
# temp hack to ensure that SUPDrvA-os2.asm is first in the link.
$(PATH_ROOT)/src/VBox/Runtime/include
SUPDrv.c \
# vboxdrv.ko - The FreeBSD Kernel Module.
SUPDrv.c \
## @todo the SUPDrv-freebsd.def is most probably gonna break it and require build system hacking...
vboxdrv-mod_INST = bin/src/vboxdrv/
$(PATH_SUB_CURRENT)/freebsd/Makefile \
$$(if $$(eq $$(Support/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
# vboxdrv.o - The Solaris Kernel Module.
SUPDrv.c \
# SUPDrv.c needs the VBOX_SVN_REV.
SUPDrv.c_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
include $(KBUILD_PATH)/subfooter.kmk