Makefile revision 0013b984212f7f0b741f4121be352249fc7e487b
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# Makefile for the VirtualBox Linux Host Driver.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# (For 2.6.x this file must be called 'Makefile'!)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# Copyright (C) 2006-2007 innotek GmbH
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# This file is part of VirtualBox Open Source Edition (OSE), as
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# available from http://www.virtualbox.org. This file is free software;
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# you can redistribute it and/or modify it under the terms of the GNU
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# General Public License (GPL) as published by the Free Software
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# Foundation, in version 2 as it comes in the "COPYING" file of the
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# The contents of this file may alternatively be used under the terms
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# of the Common Development and Distribution License Version 1.0
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# VirtualBox OSE distribution, in which case the provisions of the
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# CDDL are applicable instead of those of the GPL.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# You may elect to license modified versions of this file under the
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# terms and conditions of either the GPL or the CDDL or both.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# First, figure out which architecture we're targeting and the build type.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# (We have to support basic cross building (ARCH=i386|x86_64).)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# While at it, warn about BUILD_* vars found to help with user problems.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amoreifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amoreifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore r0drv/linux/RTLogWriteDebugger-r0drv-linux.o \
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore# Debian kernel module build system
$(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.)
$(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.)
$(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match the current kernel (version $(shell uname -r)))
$(error Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=<directory> and run Make again.)
export INCL
KFLAGS := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX
MODULE_EXT := o
$(MODULE):