VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/installer/Makefile.include.header@ 36462

Last change on this file since 36462 was 36462, checked in by vboxsync, 14 years ago

Additions/linux: update kernel module makefile split header and footer in preparation for using them with vboxguest.ko

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1#
2# VirtualBox Guest Additions kernel module Makefile, common parts.
3#
4# (For 2.6.x, the main file must be called 'Makefile'!)
5#
6# Copyright (C) 2006-2011 Oracle Corporation
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License (GPL) as published by the Free Software
12# Foundation, in version 2 as it comes in the "COPYING" file of the
13# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16
17#
18# These file should be included by the Makefiles for any kernel modules we
19# build as part of the Guest Additions. The intended way of doing this is as
20# follows:
21#
22# # Linux kbuild sets this to our source directory if we are called from
23# # there
24# obj ?= $(CURDIR)
25# include $(obj)/Makefile.include.header
26# MOD_NAME = <name of the module to be built, without extension>
27# MOD_OBJS = <list of object files which should be included>
28# MOD_DEFS = <any additional defines which this module needs>
29# MOD_INCL = <any additional include paths which this module needs>
30# MOD_FLAGS = <any additional CFLAGS which this module needs>
31# MOD_CLEAN = <list of directories that the clean target should look at>
32# include $(obj)/Makefile.include.footer
33#
34# The kmk kBuild define KBUILD_TARGET_ARCH is available.
35#
36# @todo the shared folders module Makefile also includes the following bits.
37# Integrate them if necessary.
38# MOD_FLAGS += -DEXPORT_SYMTAB -DVBGL_VBOXGUEST -DRT_WITH_VBOX
39#
40# # special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
41# # ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
42# ifeq ($(KERNELRELEASE),)
43# KFLAGS += $(foreach inc,$(KERN_INCL),\
44# $(if $(wildcard $(inc)/linux/utsrelease.h),\
45# $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
46# grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
47# grep '"2.6.18.*v5.*"' $(inc)/linux/utsrelease.h; \
48# grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
49# -DKERNEL_FC6,),))
50# else
51# KFLAGS += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
52# echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
53# echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
54# echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
55# -DKERNEL_FC6,)
56# endif
57#
58## important: Don't remove Module.symvers! DKMS does 'make clean' before building ...
59# rm -rf .vboxsf* .tmp_ver* vboxsf.* Modules.symvers modules.order
60#
61
62#
63# First, figure out which architecture we're targeting and the build type.
64# (We have to support basic cross building (ARCH=i386|x86_64).)
65# While at it, warn about BUILD_* vars found to help with user problems.
66#
67ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
68 BUILD_TARGET_ARCH_DEF := amd64
69else
70 BUILD_TARGET_ARCH_DEF := x86
71endif
72ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
73 $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
74 BUILD_TARGET_ARCH :=
75endif
76ifeq ($(BUILD_TARGET_ARCH),)
77 ifeq ($(ARCH),x86_64)
78 BUILD_TARGET_ARCH := amd64
79 else
80 ifeq ($(ARCH),i386)
81 BUILD_TARGET_ARCH := x86
82 else
83 BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
84 endif
85 endif
86else
87 ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
88 $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
89 endif
90endif
91
92ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
93 $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
94 BUILD_TYPE :=
95endif
96ifeq ($(BUILD_TYPE),)
97 BUILD_TYPE := release
98else
99 ifneq ($(BUILD_TYPE),release)
100 $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
101 endif
102endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette