Makefile.kmk revision ab4e41d5068a152fef3663ecf44196a9f7430dbf
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Sub-Makefile for the support library and the drivers/modules/kexts it uses.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Copyright (C) 2006-2007 Sun Microsystems, Inc.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# This file is part of VirtualBox Open Source Edition (OSE), as
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# available from http://www.virtualbox.org. This file is free software;
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# you can redistribute it and/or modify it under the terms of the GNU
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# General Public License (GPL) as published by the Free Software
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Foundation, in version 2 as it comes in the "COPYING" file of the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# The contents of this file may alternatively be used under the terms
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# of the Common Development and Distribution License Version 1.0
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# VirtualBox OSE distribution, in which case the provisions of the
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# CDDL are applicable instead of those of the GPL.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# You may elect to license modified versions of this file under the
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy# terms and conditions of either the GPL or the CDDL or both.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# Clara, CA 95054 USA or visit http://www.sun.com if you need
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# additional information or have any questions.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedySUB_DEPTH = ../../../..
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyinclude $(KBUILD_PATH)/subheader.kmk
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren KennedyLIBRARIES += SUPR3 SUPR3HardenedStatic
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyifndef VBOX_ONLY_DOCS
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT)),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy LIBRARIES += SUPR0
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ifdef VBOX_WITH_SUPSVC
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy PROGRAMS += VBoxSupSvc
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ifdef VBOX_WITH_VBOXDRV
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy LIBRARIES += SUPR0IdcClient
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy INSTALLS.linux += vboxdrv-mod vboxdrv-sh
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy # Include sub-makefile(s).
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy # Populate FILES_VBOXDRV_NOBIN and FILES_VBOXDRV_BIN
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyendif # !VBOX_ONLY_DOCS
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy# The Ring-3 Support Library (this is linked into the IPRT dll, VBoxRT).
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedyifneq ($(filter l4%,$(KBUILD_TARGET) $(BUILD_TARGET_SUB)),)
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy # L4 has trouble with -pedantic. It also make trouble when inlining is not enabled.
SUPR3_INCS.l4 = $(L4_INCDIR)
# VBoxSupSvc - The system wide service/daemon.
SUPR0_SOURCES += SUPR0.def
SUPR0_SOURCES += $$(PATH_SUPR0)/SUPR0.def
SUPR0IdcClient_SDKS.win = W2K3DDK WINPSDKINCS
# VBoxDrv.sys - The Windows driver.
VBoxDrv_DEFS.amd64 = RT_WITH_W64_UNWIND_HACK
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)
$(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 \
$$(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_VBoxDrv.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
# 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
# vboxdrv.ko - The FreeBSD Kernel Module.
## @todo the SUPDrv-freebsd.def is most probably gonna break it and require build system hacking...
# vboxdrv.o - The Solaris Kernel Module.
# SUPDrv.c needs the VBOX_SVN_REV.
SUPDrv.c_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
include $(KBUILD_PATH)/subfooter.kmk