1 | # $Id: Makefile.module.kms 60617 2016-04-21 09:07:38Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # VirtualBox Guest Additions Module Makefile.
|
---|
4 | #
|
---|
5 | # (For 2.6.x this file must be 'Makefile'!)
|
---|
6 | #
|
---|
7 |
|
---|
8 | #
|
---|
9 | # Copyright (C) 2006-2010 Oracle Corporation
|
---|
10 | #
|
---|
11 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | # available from http://www.virtualbox.org. This file is free software;
|
---|
13 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | # General Public License (GPL) as published by the Free Software
|
---|
15 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | #
|
---|
19 |
|
---|
20 | # Linux kbuild sets this to our source directory if we are called from there
|
---|
21 | obj ?= $(CURDIR)
|
---|
22 | include $(obj)/Makefile.include.header
|
---|
23 |
|
---|
24 | MOD_NAME = vboxvideo
|
---|
25 |
|
---|
26 | MY_KERNELRELEASE := $(KERNELRELEASE)
|
---|
27 | ifeq ($(MY_KERNELRELEASE),)
|
---|
28 | # as of 2.6.16 KERNELRELEASE is only set if the kernel is configured
|
---|
29 | MY_KERNELRELEASE := $(KERNELVERSION)
|
---|
30 | endif
|
---|
31 | ifeq ($(filter 1.% 2.% 3.0.% 3.1.% 3.2.% 3.3.% 3.4.% 3.5.% 3.6.% 3.7.% \
|
---|
32 | 3.8.% 3.9.% 3.10.%,$(MY_KERNELRELEASE)),)
|
---|
33 | MOD_OBJS = HGSMIBase.o HGSMICommon.o HGSMIMemAlloc.o heapoffset.o \
|
---|
34 | Modesetting.o vbox_drv.o vbox_fb.o vbox_irq.o vbox_main.o \
|
---|
35 | vbox_mode.o vbox_ttm.o VBVABase.o
|
---|
36 | else
|
---|
37 | MOD_OBJS = vbox_dummy.o
|
---|
38 | endif
|
---|
39 |
|
---|
40 | ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxvideo),)
|
---|
41 | MANGLING := $(KBUILD_EXTMOD)/vboxvideo/include/VBox/VBoxGuestMangling.h
|
---|
42 | else
|
---|
43 | MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h
|
---|
44 | endif
|
---|
45 | MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING)
|
---|
46 | MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include)
|
---|
47 | # What on earth is this?
|
---|
48 | MOD_INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxvideo,/ /include)
|
---|
49 | MOD_INCL += -Iinclude/drm
|
---|
50 | MOD_DEFS := -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
|
---|
51 | -DIN_SUP_R0 -DVBOX -DVBOX_WITH_HGCM -DLOG_TO_BACKDOOR -DIN_MODULE \
|
---|
52 | -DIN_GUEST_R0
|
---|
53 | # our module does not export any symbol
|
---|
54 | MOD_DEFS += -DRT_NO_EXPORT_SYMBOL
|
---|
55 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
56 | MOD_DEFS += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
|
---|
57 | else
|
---|
58 | MOD_DEFS += -DRT_ARCH_X86
|
---|
59 | endif
|
---|
60 | MOD_CLEAN = . linux r0drv r0drv/linux
|
---|
61 |
|
---|
62 | include $(obj)/Makefile.include.footer
|
---|