Makefile revision 38434b7b59fbfa76d67e81896d1f5b650ec8e692
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# Makefile for the VirtualBox Linux Host Driver.
33d0a7767d53cb366039fd0ac4f63cf8a9c351b0Tinderbox User# (For 2.6.x this file must be called 'Makefile'!)
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# Copyright (C) 2006-2007 innotek GmbH
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# This file is part of VirtualBox Open Source Edition (OSE), as
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# available from http://www.virtualbox.org. This file is free software;
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# you can redistribute it and/or modify it under the terms of the GNU
33d0a7767d53cb366039fd0ac4f63cf8a9c351b0Tinderbox User# General Public License (GPL) as published by the Free Software
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# Foundation, in version 2 as it comes in the "COPYING" file of the
33d0a7767d53cb366039fd0ac4f63cf8a9c351b0Tinderbox User# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# The contents of this file may alternatively be used under the terms
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# of the Common Development and Distribution License Version 1.0
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# VirtualBox OSE distribution, in which case the provisions of the
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# CDDL are applicable instead of those of the GPL.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# You may elect to license modified versions of this file under the
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# terms and conditions of either the GPL or the CDDL or both.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# First, figure out which architecture we're targeting and the build type.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# (We have to support basic cross building (ARCH=i386|x86_64).)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# While at it, warn about BUILD_* vars found to help with user problems.
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupontifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont# override is required by the Debian guys
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User r0drv/linux/RTLogWriteDebugger-r0drv-linux.o \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User # building from this directory
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User # kernel base directory
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User # build for the current kernel, version check
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User KERN_DIR := /lib/modules/$(shell uname -r)/build
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont $(error Error: unable to find the sources of your current Linux kernel. \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User Specify KERN_DIR=<directory> and run Make again)
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont $(warning Warning: using /usr/src/linux as the source directory of your \
b091b4bb803b830d2d5a9e71b6648b669655d7dcFrancis Dupont Linux kernel. If this is not correct, specify \
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):