Makefile.kmk revision 7f43dd9931ccc74d80be05d0d58d4f3349f87dc1
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# Sub-Makefile for the support library and the drivers/modules/kexts it uses.
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# available from http://www.virtualbox.org. This file is free software;
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# you can redistribute it and/or modify it under the terms of the GNU
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# General Public License (GPL) as published by the Free Software
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# The contents of this file may alternatively be used under the terms
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# of the Common Development and Distribution License Version 1.0
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# VirtualBox OSE distribution, in which case the provisions of the
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# CDDL are applicable instead of those of the GPL.
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# You may elect to license modified versions of this file under the
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# terms and conditions of either the GPL or the CDDL or both.
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync# additional information or have any questions.
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsyncSUB_DEPTH = ../../../..
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsyncinclude $(KBUILD_PATH)/subheader.kmk
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncLIBRARIES += SUPR3 SUPR3HardenedStatic
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncifndef VBOX_ONLY_DOCS
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT)),)
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync LIBRARIES += SUPR0
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync ifdef VBOX_WITH_SUPSVC
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync PROGRAMS += VBoxSupSvc
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync ifdef VBOX_WITH_VBOXDRV
17ef1920962b3df57bf6d2704ced1586396d96f0vboxsync LIBRARIES += SUPR0IdcClient
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync INSTALLS.linux += vboxdrv-mod vboxdrv-sh
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync # Include sub-makefile(s).
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
8867771015571c5542d39e393d7fe6304421a928vboxsync # Populate FILES_VBOXDRV_NOBIN and FILES_VBOXDRV_BIN
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncendif # !VBOX_ONLY_DOCS
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync# The Ring-3 Support Library (this is linked into the IPRT dll, VBoxRT).
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncifneq ($(filter l4%,$(KBUILD_TARGET) $(BUILD_TARGET_SUB)),)
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync # L4 has trouble with -pedantic. It also make trouble when inlining is not enabled.
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync SUPR3_TEMPLATE = VBOXR3NP
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync SUPR3_TEMPLATE = VBOXR3
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncSUPR3_DEFS = IN_SUP_R3 IN_RT_R3
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncifdef VBOX_WITH_SUPSVC
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync SUPR3_DEFS += VBOX_WITH_SUPSVC
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncSUPR3_INCS := $(PATH_SUB_CURRENT)
8867771015571c5542d39e393d7fe6304421a928vboxsyncSUPR3_SOURCES = \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
8867771015571c5542d39e393d7fe6304421a928vboxsync# The static part of the hardened support library (ring-3).
8867771015571c5542d39e393d7fe6304421a928vboxsyncSUPR3HardenedStatic_TEMPLATE = VBOXR3HARDENEDLIB
8867771015571c5542d39e393d7fe6304421a928vboxsyncSUPR3HardenedStatic_DEFS = IN_SUP_HARDENED_R3
8867771015571c5542d39e393d7fe6304421a928vboxsyncifdef VBOX_WITH_SUPSVC
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync SUPR3HardenedStatic_DEFS += VBOX_WITH_SUPSVC
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncSUPR3HardenedStatic_INCS = .
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncSUPR3HardenedStatic_SOURCES = \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
8867771015571c5542d39e393d7fe6304421a928vboxsyncifndef VBOX_ONLY_DOCS
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync# VBoxSupSvc - The system wide service/daemon.
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncVBoxSupSvc_TEMPLATE = VBOXR3EXE
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncVBoxSupSvc_SOURCES = \
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync $(KBUILD_TARGET)/SUPSvc-$(KBUILD_TARGET).cpp
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncif1of ($(KBUILD_TARGET), win)
8867771015571c5542d39e393d7fe6304421a928vboxsync VBoxSupSvc_SOURCES += \
8867771015571c5542d39e393d7fe6304421a928vboxsyncifn1of ($(KBUILD_TARGET), win)
8867771015571c5542d39e393d7fe6304421a928vboxsync VBoxSupSvc_SOURCES += \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxSupSvc_LIBS = \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(LIB_RUNTIME)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync# SUPR0 - The Ring-0 Import / Thunk library.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncSUPR0_TEMPLATE = VBOXR0
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncifeq ($(VBOX_LDR_FMT),pe)
8867771015571c5542d39e393d7fe6304421a928vboxsync SUPR0_SOURCES += SUPR0.def
8867771015571c5542d39e393d7fe6304421a928vboxsyncifeq ($(VBOX_LDR_FMT),lx)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncSUPR0_SOURCES += $$(PATH_SUPR0)/SUPR0.def
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync$$(PATH_SUPR0)/SUPR0.def: $(PATH_SUB_CURRENT)/SUPR0.def | $$(dir $$@)
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync $(SED) -e 's/^[ \t][ \t]*\([gA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' $< > $@.tmp
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync $(MV) -f $@.tmp $@
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync# SUPR0IdcClient - The Ring-0 IDC client driver library.
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncSUPR0IdcClient_TEMPLATE = VBOXR0DRV
8867771015571c5542d39e393d7fe6304421a928vboxsyncSUPR0IdcClient_DEFS = IN_RT_R0 IN_SUP_R0 IN_SUP_STATIC
8867771015571c5542d39e393d7fe6304421a928vboxsyncSUPR0IdcClient_SDKS.win = W2K3DDK WINPSDKINCS
8867771015571c5542d39e393d7fe6304421a928vboxsyncSUPR0IdcClient_SOURCES.$(KBUILD_TARGET) = \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(KBUILD_TARGET)/SUPR0IdcClient-$(KBUILD_TARGET).c
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncSUPR0IdcClient_SOURCES = \
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsync# VBoxDrv.sys - The Windows driver.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync## @todo consoliate all the targets into a single mess.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncifeq ($(KBUILD_TARGET),win)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_TEMPLATE = VBOXR0DRV
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncifdef VBOX_SIGNING_MODE
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync VBoxDrv_NOINST = true
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_DEFS.amd64 = RT_WITH_W64_UNWIND_HACK
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncVBoxDrv_SDKS = W2K3DDK WINPSDKINCS
fe14fe6d46ce87a9b25cbdacb3a20b1f87bf34c7vboxsyncVBoxDrv_INCS := $(PATH_SUB_CURRENT)
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv_SOURCES = \
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv_LDFLAGS.x86 = -Entry:DriverEntry@8
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv_LDFLAGS.amd64 = -Entry:DriverEntry
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv_LIBS = \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
8867771015571c5542d39e393d7fe6304421a928vboxsyncINSTALLS += VBoxDrv-inf
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv-inf_INST = $(INST_BIN)
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv-inf_MODE = a+r,u+w
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv-inf_SOURCES = \
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv-inf_CLEAN = $(VBoxDrv-inf_SOURCES)
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv-inf_BLDDIRS = $(PATH_TARGET)/VBoxDrvCat.dir
8867771015571c5542d39e393d7fe6304421a928vboxsync$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf: $(PATH_SUB_CURRENT)/win/VBoxDrv.inf $(MAKEFILE_CURRENT) | $$(call DIRDEP,$$(@D))
8867771015571c5542d39e393d7fe6304421a928vboxsync $(call MSG_GENERATE,VBoxDrv-inf,$@,$<)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(call VBOX_EDIT_INF_FN,$<,$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync ifdef VBOX_SIGNING_MODE
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrv-inf_SOURCES += \
8867771015571c5542d39e393d7fe6304421a928vboxsync$(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys: $$(TARGET_VBoxDrv) | $$(call DIRDEP,$$(@D))
8867771015571c5542d39e393d7fe6304421a928vboxsync $(INSTALL) -m 644 $< $(@D)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(call MSG_TOOL,Inf2Cat,VBoxDrv-inf,$@,$<)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(call VBOX_MAKE_CAT_FN, $(@D),$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync endif # signing
8867771015571c5542d39e393d7fe6304421a928vboxsync# vboxdrv.ko - The Linux Kernel Module (syntax check only).
8867771015571c5542d39e393d7fe6304421a928vboxsyncifeq ($(KBUILD_TARGET),linux)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_TEMPLATE = VBOXR0DRV
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_NOINST = true
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_DEFS = KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) MODULE IN_RT_R0 IN_SUP_R0 CONFIG_VBOXDRV_AS_MISC
8867771015571c5542d39e393d7fe6304421a928vboxsyncifdef VBOX_LINUX_VERSION_2_4
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_DEFS += EXPORT_SYMTAB
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncvboxdrv_INCS := \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_SUB_CURRENT) \
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_LIBS.debug = $(vboxdrv_LIBS) $(VBOX_GCC_LIBGCC)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_SOURCES = \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).c \
8867771015571c5542d39e393d7fe6304421a928vboxsyncifndef VBOX_LINUX_VERSION_2_4
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_SOURCES += \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).mod.c
8867771015571c5542d39e393d7fe6304421a928vboxsync# Targets for installing the linux sources.
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-mod_INST = bin/src/vboxdrv/
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-mod_MODE = a+r,u+w
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-mod_SOURCES = $(subst ",,$(FILES_VBOXDRV_NOBIN)) #"
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-mod_SOURCES += \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(if $(VBOX_OSE),,\
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_vboxdrv-mod)/dkms.conf) \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_vboxdrv-mod)/Makefile
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-mod_CLEAN = \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_vboxdrv-mod)/dkms.conf \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_vboxdrv-mod)/Makefile
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-sh_INST = bin/src/vboxdrv
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-sh_MODE = a+rx,u+w
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-sh_SOURCES = $(subst ",,$(FILES_VBOXDRV_BIN)) #"
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-sh_SOURCES += \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_vboxdrv-sh)/build_in_tmp \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(if $(VBOX_OSE),,\
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv-sh_CLEAN = \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_TARGET)/vboxdrv-sh-1.dep \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_vboxdrv-sh)/build_in_tmp
8867771015571c5542d39e393d7fe6304421a928vboxsync# Scripts needed for building the kernel modules
8867771015571c5542d39e393d7fe6304421a928vboxsync$$(PATH_vboxdrv-sh)/build_in_tmp: \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(VBOX_VERSION_STAMP) \
8867771015571c5542d39e393d7fe6304421a928vboxsync | $$(dir $$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(call MSG_TOOL,Creating,,$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxdrv;g" --output $@ $<
8867771015571c5542d39e393d7fe6304421a928vboxsync $(QUIET)chmod 0755 $@
8867771015571c5542d39e393d7fe6304421a928vboxsync$$(PATH_vboxdrv-mod)/dkms.conf: \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_SUB_CURRENT)/linux/dkms.conf \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(VBOX_VERSION_STAMP) \
8867771015571c5542d39e393d7fe6304421a928vboxsync | $$(dir $$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(call MSG_TOOL,Creating,,$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
8867771015571c5542d39e393d7fe6304421a928vboxsyncincludedep $(PATH_TARGET)/vboxdrv-sh-1.dep
8867771015571c5542d39e393d7fe6304421a928vboxsync$$(PATH_vboxdrv-mod)/Makefile: \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_SUB_CURRENT)/linux/Makefile \
8867771015571c5542d39e393d7fe6304421a928vboxsync $$(if $$(eq $$(Support/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
8867771015571c5542d39e393d7fe6304421a928vboxsync | $$(dir $$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync $(call MSG_TOOL,Creating,,$@)
8867771015571c5542d39e393d7fe6304421a928vboxsync ifndef VBOX_WITH_HARDENING
8867771015571c5542d39e393d7fe6304421a928vboxsync $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
8867771015571c5542d39e393d7fe6304421a928vboxsync $(QUIET)$(CP) -f $< $@
8867771015571c5542d39e393d7fe6304421a928vboxsync %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/vboxdrv-sh-1.dep
8867771015571c5542d39e393d7fe6304421a928vboxsync %$(QUIET2)$(APPEND) '$(PATH_TARGET)/vboxdrv-sh-1.dep' 'Support/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
8867771015571c5542d39e393d7fe6304421a928vboxsyncendif # real linux
8867771015571c5542d39e393d7fe6304421a928vboxsync# VBoxDrv.kext - The Darwin Kernel Extension.
8867771015571c5542d39e393d7fe6304421a928vboxsyncifeq ($(KBUILD_TARGET),darwin)
8867771015571c5542d39e393d7fe6304421a928vboxsync# The Tiger variant.
8867771015571c5542d39e393d7fe6304421a928vboxsyncSYSMODS.x86 += VBoxDrvTiger
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrvTiger_TEMPLATE = VBOXR0DRV
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrvTiger_INST = $(INST_VBOXDRV_TIGER)Contents/MacOS/
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrvTiger_DEFS := IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV)
8867771015571c5542d39e393d7fe6304421a928vboxsyncVBoxDrvTiger_DEFS.debug += DEBUG_DARWIN_GIP
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvTiger_INCS = .
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvTiger_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvTiger_LDFLAGS = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvTiger_SOURCES = \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).cpp
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrvTiger.kext_INST = $(INST_VBOXDRV_TIGER)Contents/
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrvTiger.kext_SOURCES = $(PATH_VBoxDrvTiger.kext)/Info.plist
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrvTiger.kext_CLEAN = $(PATH_VBoxDrvTiger.kext)/Info.plist
c999f225d03074008a0c21cdd5d3594da476e243vboxsync$$(PATH_VBoxDrvTiger.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info-Tiger.plist $(VBOX_VERSION_MK) | $$(dir $$@)
c999f225d03074008a0c21cdd5d3594da476e243vboxsync $(call MSG_GENERATE,VBoxDrvTiger,$@,$<)
c999f225d03074008a0c21cdd5d3594da476e243vboxsync $(xQUIET)$(RM) -f $@
c999f225d03074008a0c21cdd5d3594da476e243vboxsync $(xQUIET)$(SED) \
c999f225d03074008a0c21cdd5d3594da476e243vboxsync -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
c999f225d03074008a0c21cdd5d3594da476e243vboxsync -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
c999f225d03074008a0c21cdd5d3594da476e243vboxsync -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
c999f225d03074008a0c21cdd5d3594da476e243vboxsync -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
c999f225d03074008a0c21cdd5d3594da476e243vboxsync --output $@ \
c999f225d03074008a0c21cdd5d3594da476e243vboxsync# The Leopard variant.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncSYSMODS += VBoxDrv
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv_EXTENDS = VBoxDrvTiger
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv_EXTENDS_BY = appending
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv_TEMPLATE = VBOXR0DRV$(if-expr "$(KBUILD_TARGET_ARCH)" == "x86",OSX105,)
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv_INST = $(INST_VBOXDRV)Contents/MacOS/
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv_DEFS = VBOX_WITH_HOST_VMX
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv.kext_INST = $(INST_VBOXDRV)Contents/
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv.kext_SOURCES = $(PATH_VBoxDrv.kext)/Info.plist
c999f225d03074008a0c21cdd5d3594da476e243vboxsyncVBoxDrv.kext_CLEAN = $(PATH_VBoxDrv.kext)/Info.plist
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync$$(PATH_VBoxDrv.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(call MSG_GENERATE,VBoxDrv,$@,$<)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(xQUIET)$(RM) -f $@
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(xQUIET)$(SED) \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(if-expr "$(KBUILD_TARGET_ARCH)" == "amd64",-e '/com\.apple\.kernel/d',) \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync --output $@ \
8867771015571c5542d39e393d7fe6304421a928vboxsync# Common manual loader script.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncINSTALLS += Scripts
8867771015571c5542d39e393d7fe6304421a928vboxsyncScripts_INST = $(INST_DIST)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncScripts_SOURCES = \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncendif # darwin
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync# VBoxDrv.sys - The OS/2 driver.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncifeq ($(KBUILD_TARGET),os2)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_TEMPLATE = VBOXR0DRV
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_INCS := $(PATH_SUB_CURRENT)
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync#VBoxDrv_LDFLAGS = -s -t -v
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_SOURCES = \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrv_LIBS = \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(TARGET_VBoxDrvLib) \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync $(VBOX_GCC_LIBGCC) \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsync# temp hack to ensure that SUPDrvA-os2.asm is first in the link.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncLIBRARIES += VBoxDrvLib
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvLib_TEMPLATE = VBOXR0DRV
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvLib_NOINST = 1
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvLib_DEFS = IN_RT_R0 IN_SUP_R0
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvLib_INCS := \
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncVBoxDrvLib_SOURCES = \
8867771015571c5542d39e393d7fe6304421a928vboxsync# vboxdrv.ko - The FreeBSD Kernel Module.
9de47c4ec7b0fc9a384e4b815153de399da7b8devboxsyncifeq ($(KBUILD_TARGET),freebsd)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_TEMPLATE = VBOXR0DRV
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_INCS := $(PATH_SUB_CURRENT)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_SOURCES := \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).c \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(PATH_SUB_CURRENT)/$(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).def \
8867771015571c5542d39e393d7fe6304421a928vboxsync## @todo the SUPDrv-freebsd.def is most probably gonna break it and require build system hacking...
8867771015571c5542d39e393d7fe6304421a928vboxsyncendif # freebsd
8867771015571c5542d39e393d7fe6304421a928vboxsync# vboxdrv.o - The Solaris Kernel Module.
8867771015571c5542d39e393d7fe6304421a928vboxsyncifeq ($(KBUILD_TARGET),solaris)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_TEMPLATE = VBOXR0DRV
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER
8867771015571c5542d39e393d7fe6304421a928vboxsyncifdef VBOX_WITH_NETFLT
8867771015571c5542d39e393d7fe6304421a928vboxsync vboxdrv_DEFS += VBOX_WITH_NETFLT
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_DEPS += $(VBOX_SVN_REV_KMK)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_INCS := $(PATH_SUB_CURRENT)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
8867771015571c5542d39e393d7fe6304421a928vboxsyncvboxdrv_SOURCES = \
8867771015571c5542d39e393d7fe6304421a928vboxsync $(KBUILD_TARGET)/SUPDrv-$(KBUILD_TARGET).c \
8867771015571c5542d39e393d7fe6304421a928vboxsyncendif # solaris
8867771015571c5542d39e393d7fe6304421a928vboxsync# SUPDrv.c needs the VBOX_SVN_REV.
8867771015571c5542d39e393d7fe6304421a928vboxsyncSUPDrv.c_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
8867771015571c5542d39e393d7fe6304421a928vboxsyncendif # !VBOX_ONLY_DOCS
8867771015571c5542d39e393d7fe6304421a928vboxsyncinclude $(KBUILD_PATH)/subfooter.kmk