c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# Makefile for the VirtualBox Linux Host Virtual Network Adapter Driver.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# (For 2.6.x this file must be called 'Makefile'!)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c58f1213e628a545081c70e26c6b67a841cff880vboxsync# Copyright (C) 2006-2011 Oracle Corporation
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# available from http://www.virtualbox.org. This file is free software;
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# you can redistribute it and/or modify it under the terms of the GNU
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# General Public License (GPL) as published by the Free Software
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# First, figure out which architecture we're targeting and the build type.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# (We have to support basic cross building (ARCH=i386|x86_64).)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# While at it, warn about BUILD_* vars found to help with user problems.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
9040f019271f91b98e1320c0a8c38a42636e3979vboxsyncifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync BUILD_TARGET_ARCH_DEF := amd64
9040f019271f91b98e1320c0a8c38a42636e3979vboxsyncelse
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync BUILD_TARGET_ARCH_DEF := x86
9040f019271f91b98e1320c0a8c38a42636e3979vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync BUILD_TARGET_ARCH :=
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifeq ($(BUILD_TARGET_ARCH),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifeq ($(ARCH),x86_64)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync BUILD_TARGET_ARCH := amd64
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync else
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifeq ($(ARCH),i386)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync BUILD_TARGET_ARCH := x86
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync else
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncelse
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync BUILD_TYPE :=
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifeq ($(BUILD_TYPE),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync BUILD_TYPE := release
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncelse
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync ifneq ($(BUILD_TYPE),release)
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
9040f019271f91b98e1320c0a8c38a42636e3979vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# override is required by the Debian guys
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncoverride MODULE = vboxnetadp
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncOBJS = \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync linux/VBoxNetAdp-linux.o \
99be02f9e15a3ca61b6a7c207cc7eb68dbd04817vboxsync VBoxNetAdp.o
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifeq ($(BUILD_TARGET_ARCH),x86)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncOBJS += math/gcc/divdi3.o \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync math/gcc/moddi3.o \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync math/gcc/qdivrem.o \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync math/gcc/udivdi3.o \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync math/gcc/divdi3.o \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync math/gcc/umoddi3.o
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsyncifneq ($(MAKECMDGOALS),clean)
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifeq ($(KERNELRELEASE),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync #
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync # building from this directory
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync #
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync # kernel base directory
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifndef KERN_DIR
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync # build for the current kernel, version check
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KERN_DIR := /lib/modules/$(shell uname -r)/build
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KERN_DIR := /usr/src/linux
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync $(error Error: unable to find the sources of your current Linux kernel. \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync Specify KERN_DIR=<directory> and run Make again)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync $(warning Warning: using /usr/src/linux as the source directory of your \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync Linux kernel. If this is not correct, specify \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KERN_DIR=<directory> and run Make again.)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync else
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync $(error Error: KERN_DIR does not point to a directory)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync # includes
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifndef KERN_INCL
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KERN_INCL = $(KERN_DIR)/include
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync $(error Error: unable to find the include directory for your current Linux \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync kernel. Specify KERN_INCL=<directory> and run Make again)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync # module install dir, only for current kernel
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifndef MODULE_DIR
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync MODULE_DIR_TST := /lib/modules/$(shell uname -r)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync MODULE_DIR := $(MODULE_DIR_TST)/misc
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync else
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync $(error Unable to find the folder to install the support driver to)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif # MODULE_DIR unspecified
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncelse # neq($(KERNELRELEASE),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync #
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync # building from kbuild (make -C <kernel_directory> M=`pwd`)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync #
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif # neq($(KERNELRELEASE),)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# debug - show guesses.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifdef DEBUG
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync$(warning dbg: KERN_DIR = $(KERN_DIR))
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync$(warning dbg: KERN_INCL = $(KERN_INCL))
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync$(warning dbg: MODULE_DIR = $(MODULE_DIR))
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncKBUILD_VERBOSE ?= 1
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# Compiler options
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync#
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifndef INCL
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync INCL := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL))
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync ifndef KBUILD_EXTMOD
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KBUILD_EXTMOD := $(shell pwd)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync endif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync INCL += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsync INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxnetadp,/ /include /r0drv/linux)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync export INCL
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsyncifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp),)
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsync MANGLING := $(KBUILD_EXTMOD)/vboxnetadp/include/VBox/SUPDrvMangling.h
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsyncelse
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsync MANGLING := $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsyncendif
479124979f37167f8ce75bf59090903d30e1ced3vboxsyncKFLAGS := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
d8b66c9f4ecb096e1f2308d74df4d6a1220c3b98vboxsync -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
d8b66c9f4ecb096e1f2308d74df4d6a1220c3b98vboxsync -Wno-declaration-after-statement
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifdef VBOX_REDHAT_KABI
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KFLAGS += -DVBOX_REDHAT_KABI
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifeq ($(BUILD_TARGET_ARCH),amd64)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KFLAGS += -DRT_ARCH_AMD64
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncelse
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KFLAGS += -DRT_ARCH_X86
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# must be consistent with Config.kmk!
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncKFLAGS += -DVBOX_WITH_64_BITS_GUESTS
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifeq ($(BUILD_TYPE),debug)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KFLAGS += -DDEBUG -DDEBUG_$(USER) -g
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync # IPRT_DEBUG_SEMS indicates thread wrt sems state via the comm field.
88e9d91abf9293ecc1c70e0bf40e42f1c3a0bdcevboxsync #KFLAGS += -DIPRT_DEBUG_SEMS
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# By default we use remap_pfn_range() kernel API to make kernel pages
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync# visible for userland. Unfortunately, it leads to situation that
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# during debug session all structures on that page (such as PVM pointer)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# are not accessible to the debugger (see #3214).
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# This code enables experimental support
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# for vm_insert_page() kernel API, allowing to export kernel pages
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# to the userland in more debugger-friendly way. Due to stability
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# concerns, not enabled by default yet.
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncifdef VBOX_USE_INSERT_PAGE
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync KFLAGS += -DVBOX_USE_INSERT_PAGE
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncendif
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncMODULE_EXT := ko
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync$(MODULE)-y := $(OBJS)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync# build defs
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsyncEXTRA_CFLAGS += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncall: $(MODULE)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncobj-m += $(MODULE).o
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
00019d7a7381b029a3c17229f14c24a3a7b07a94vboxsync# OL/UEK: disable module signing for external modules -- we don't have any private key
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync$(MODULE):
00019d7a7381b029a3c17229f14c24a3a7b07a94vboxsync $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) CONFIG_MODULE_SIG= -C $(KERN_DIR) modules
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncinstall: $(MODULE)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync @mkdir -p $(MODULE_DIR); \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync install -m 0664 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
6831f283dbc5c27bde8a8f8bea179b84a5741697vboxsync PATH="$(PATH):/bin:/sbin" depmod -a; \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync rm -f /etc/vbox/module_not_compiled
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncinstall_rpm: $(MODULE)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync @mkdir -p $(MODULE_DIR); \
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync install -m 0664 $(MODULE).$(MODULE_EXT) $(MODULE_DIR)
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsync
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsyncelse # eq ($(MAKECMDGOALS),clean)
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync ifndef KERN_DIR
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync KERN_DIR := /lib/modules/$(shell uname -r)/build
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync ifeq ($(wildcard $(KERN_DIR)/Makefile),)
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync KERN_DIR := /usr/src/linux
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync endif
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync endif
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync ifeq ($(wildcard $(KERN_DIR)/Makefile),)
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsyncclean:
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync find . \( -name \*.o -o -name \*.cmd \) -print0 | xargs -0 rm -f
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync rm -rf .tmp_ver* $(MODULE).* Module.symvers Modules.symvers modules.order
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync else
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync
c1f5ec452b23d55c71e6f07628b84ac5e97cf551vboxsyncclean:
479124979f37167f8ce75bf59090903d30e1ced3vboxsync $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -C $(KERN_DIR) clean
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync endif
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsync
bbf3d430bae83177ab9ce3097f49d89cc873e7c0vboxsyncendif # eq($(MAKECMDGOALS),clean)