Makefile revision bbf3d430bae83177ab9ce3097f49d89cc873e7c0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Makefile for the VirtualBox Linux Host Driver.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Copyright (C) 2006-2010 Oracle Corporation
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# This file is part of VirtualBox Open Source Edition (OSE), as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# available from http://www.virtualbox.org. This file is free software;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# you can redistribute it and/or modify it under the terms of the GNU
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# General Public License (GPL) as published by the Free Software
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# Foundation, in version 2 as it comes in the "COPYING" file of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# The contents of this file may alternatively be used under the terms
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# of the Common Development and Distribution License Version 1.0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# VirtualBox OSE distribution, in which case the provisions of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# CDDL are applicable instead of those of the GPL.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# You may elect to license modified versions of this file under the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# terms and conditions of either the GPL or the CDDL or both.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# First, figure out which architecture we're targeting and the build type.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# (We have to support basic cross building (ARCH=i386|x86_64).)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# While at it, warn about BUILD_* vars found to help with user problems.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte# override is required by the Debian guys
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # building from this directory
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # kernel base directory
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte # build for the current kernel, version check
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(error Error: unable to find the sources of your current Linux kernel. \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte $(warning Warning: using /usr/src/linux as the source directory of your \
VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) --no-print-directory kernelrelease 2> /dev/null || true)
export INCL
# must be consistent with Config.kmk!
$(MODULE):