Makefile revision 78df3a3ca20e014e0d9eb72cd7bb72711255d5f6
# $Revision$
## @file
# Makefile for the VirtualBox Linux Host Driver.
#
#
#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# The contents of this file may alternatively be used under the terms
# of the Common Development and Distribution License Version 1.0
# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
# VirtualBox OSE distribution, in which case the provisions of the
# CDDL are applicable instead of those of the GPL.
#
# You may elect to license modified versions of this file under the
# terms and conditions of either the GPL or the CDDL or both.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
#
# First, figure out which architecture we're targeting and the build type.
# (We have to support basic cross building (ARCH=i386|x86_64).)
# While at it, warn about BUILD_* vars found to help with user problems.
#
else
else
else
else
BUILD_TYPE :=
else
# override is required by the Debian guys
OBJS = \
SUPDrv.o \
#
# building from this directory
#
# kernel base directory
# build for the current kernel, version check
# check if versions match -- works only for later 2.6 kernels
VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) --no-print-directory kernelrelease 2> /dev/null || true)
else
# build for a dedicated kernel, no version check
# includes
# module install dir, only for current kernel
else
endif # MODULE_DIR unspecified
else # neq($(KERNELRELEASE),)
#
# building from kbuild (make -C <kernel_directory> M=`pwd`)
#
endif # neq($(KERNELRELEASE),)
# debug - show guesses.
KBUILD_VERBOSE ?= 1
#
# Compiler options
#
KBUILD_EXTMOD := $(shell pwd)
export INCL
KFLAGS := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING
KFLAGS += -DRT_ARCH_AMD64
else
KFLAGS += -DRT_ARCH_X86
# must be consistent with Config.kmk!
# IPRT_DEBUG_SEMS indicates thread wrt sems state via the comm field.
# 2.6 and later
MODULE_EXT := ko
# build defs
$(MODULE):
@mkdir -p $(MODULE_DIR); \
install_rpm: $(MODULE)
@mkdir -p $(MODULE_DIR); \
endif # eq($(MAKECMDGOALS),clean)
for f in . linux r0drv r0drv/generic r0drv/linux VBox common/err common/string common/log generic math/gcc; \