Makefile.kmk revision 7023ec9ac267138066183f004a61782681b1e2f3
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync# Sub-Makefile for the support library and the drivers/modules/kexts it uses.
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# Copyright (C) 2006-2011 Oracle Corporation
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# available from http://www.virtualbox.org. This file is free software;
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# you can redistribute it and/or modify it under the terms of the GNU
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# General Public License (GPL) as published by the Free Software
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# The contents of this file may alternatively be used under the terms
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# of the Common Development and Distribution License Version 1.0
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# VirtualBox OSE distribution, in which case the provisions of the
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# CDDL are applicable instead of those of the GPL.
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# You may elect to license modified versions of this file under the
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsync# terms and conditions of either the GPL or the CDDL or both.
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsyncSUB_DEPTH = ../../../..
e86794d5ed13ea3053cb8f12be80630236ef2943vboxsyncinclude $(KBUILD_PATH)/subheader.kmk
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncLIBRARIES += SUPR3 SUPR3Static SUPR3HardenedStatic
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncifndef VBOX_ONLY_DOCS
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync if1of ($(VBOX_LDR_FMT), pe lx)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync LIBRARIES += SUPR0
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncif !defined(VBOX_ONLY_DOCS) \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync && !defined(VBOX_ONLY_EXTPACKS) \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync && !defined(VBOX_ONLY_TESTSUITE)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync ifdef VBOX_WITH_SUPSVC
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync PROGRAMS += VBoxSupSvc
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync ifdef VBOX_WITH_VBOXDRV
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync LIBRARIES += SUPR0IdcClient
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync INSTALLS.linux += vboxdrv-mod
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync INSTALLS.freebsd += vboxdrv-mod
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync # Include sub-makefile(s).
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync # Populate FILES_VBOXDRV_NOBIN and FILES_VBOXDRV_BIN
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync ifeq ($(KBUILD_TARGET),linux)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync ifeq ($(KBUILD_TARGET),freebsd)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync include $(PATH_SUB_CURRENT)/freebsd/files_vboxdrv
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncendif # !VBOX_ONLY_DOCS && !VBOX_ONLY_EXTPACKS && !VBOX_ONLY_TESTSUITE
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync# The Ring-3 Support Library (this is linked into the IPRT dll, VBoxRT).
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncifneq ($(filter l4%,$(KBUILD_TARGET) $(BUILD_TARGET_SUB)),)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync # L4 has trouble with -pedantic. It also make trouble when inlining is not enabled.
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync SUPR3_TEMPLATE = VBOXR3NP
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync SUPR3_TEMPLATE = VBOXR3
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3_DEFS = \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync IN_SUP_R3 IN_RT_R3 \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC) \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,) \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3_INCS := $(PATH_SUB_CURRENT)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3_SOURCES = \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync# Static version of SUPR3.
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3Static_TEMPLATE = VBOXR3STATIC
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3Static_EXTENDS = SUPR3
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync# The static part of the hardened support library (ring-3).
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3HardenedStatic_TEMPLATE = VBOXR3HARDENEDLIB
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3HardenedStatic_DEFS = IN_SUP_HARDENED_R3
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3HardenedStatic_DEFS += \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC,) \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,) \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3HardenedStatic_INCS = .
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR3HardenedStatic_SOURCES = \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync# VBoxSupSvc - The system wide service/daemon.
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncVBoxSupSvc_TEMPLATE = VBOXR3EXE
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncVBoxSupSvc_SOURCES = \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(KBUILD_TARGET)/SUPSvc-$(KBUILD_TARGET).cpp
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncif1of ($(KBUILD_TARGET), win)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync VBoxSupSvc_SOURCES += \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncifn1of ($(KBUILD_TARGET), win)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync VBoxSupSvc_SOURCES += \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncVBoxSupSvc_LIBS = \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(LIB_RUNTIME)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync# SUPR0 - The Ring-0 Import library.
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR0_TEMPLATE = VBoxR0
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncif1of ($(VBOX_LDR_FMT), pe lx)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync SUPR0_SOURCES = $(SUPR0_0_OUTDIR)/SUPR0.def
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync SUPR0_CLEAN = $(SUPR0_0_OUTDIR)/SUPR0.def
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync$$(SUPR0_0_OUTDIR)/SUPR0.def: \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(PATH_SUB_CURRENT)/SUPDrv.c \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync $(PATH_SUB_CURRENT)/SUPR0-def-$(VBOX_LDR_FMT).sed \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync | $$(dir $$@)
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync -f $(dir $<)/SUPR0-def-$(VBOX_LDR_FMT).sed \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync --output $@ \
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsync# SUPR0IdcClient - The Ring-0 IDC client driver library.
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR0IdcClient_TEMPLATE = VBoxR0DrvLib
d1c5a03c19683c719b94496bb998fde2f2e5e622vboxsyncSUPR0IdcClient_DEFS = IN_RT_R0 IN_SUP_R0 IN_SUP_STATIC
SUPR0IdcClient_SDKS.win = W2K3DDK WINPSDKINCS
# 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_NAME.freebsd = vboxdrv
VBoxDrv_NAME.linux = vboxdrv
VBoxDrv_NAME.solaris = vboxdrv
VBoxDrv_SDKS.win = W2K3DDK WINPSDKINCS
#VBoxDrv_DEFS.debug += DEBUG_DARWIN_GIP
VBoxDrv_DEFS.darwin := VBOX_WITH_HOST_VMX
VBoxDrv_DEFS.linux := \
KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) MODULE CONFIG_VBOXDRV_AS_MISC
VBoxDrv_DEFS.linux += EXPORT_SYMTAB
VBoxDrv_DEFS.solaris += VBOX_WITH_NETFLT
VBoxDrv_DEFS.solaris += VBOX_WITH_NATIVE_SOLARIS_LOADING
VBoxDrv_DEFS.win += VBOX_WITHOUT_NATIVE_R0_LOADER
VBoxDrv_DEFS.win += VBOX_WITH_VMMR0_DISABLE_PREEMPTION
VBoxDrv_INCS.darwin = ./darwin
VBoxDrv_LIBS.linux.debug = $(VBoxDrv_LIBS) $(VBOX_GCC_LIBGCC)
VBoxDrv_LIBS.win = \
$(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
$(PATH_SDK_W2K3DDK_LIB)/hal.lib \
#VBoxDrv_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
VBoxDrv_LDFLAGS.win.x86 = -Entry:DriverEntry@8
VBoxDrv_LDFLAGS.win.amd64= -Entry:DriverEntry
SUPDrv.c \
SUPDrv-dtrace.cpp_DEFS.darwin += VBOX_PATH_MACOSX_DTRACE_H=\"$(VBOX_PATH_MACOSX_SDK)/usr/include/sys/dtrace.h\"
VBoxDrv.kext_INST = $(INST_VBOXDRV)Contents/
$(PATH_SUB_CURRENT)/darwin/Info.plist \
$(KBUILD_TARGET)/load.sh
vboxdrv-mod_INST = bin/src/vboxdrv/
$(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
$(PATH_TARGET)/vboxdrv-mod-1.dep \
includedep $(PATH_TARGET)/vboxdrv-mod-1.dep
$(PATH_SUB_CURRENT)/linux/Makefile \
$$(if $$(eq $$(Support/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
%$(QUIET2)$(APPEND) -t '$(PATH_TARGET)/vboxdrv-mod-1.dep' 'Support/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
INSTALLS.win += VBoxDrv-inf
$(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) | $$(dir $$@)
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys \
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys: $$(VBoxDrv_1_TARGET) | $$(dir $$@)
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat: \
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf \
$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys
include $(KBUILD_PATH)/subfooter.kmk