1 | # $Id: Makefile.module.kms 68306 2017-08-06 14:52:30Z 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 | MY_KERNELRELEASE := $(KERNELRELEASE)
|
---|
21 | ifeq ($(MY_KERNELRELEASE),)
|
---|
22 | # as of 2.6.16 KERNELRELEASE is only set if the kernel is configured
|
---|
23 | MY_KERNELRELEASE := $(KERNELVERSION)
|
---|
24 | endif
|
---|
25 | ifeq ($(filter 1.% 2.% 3.0.% 3.1.% 3.2.% 3.3.% 3.4.% 3.5.% 3.6.% 3.7.% \
|
---|
26 | 3.8.% 3.9.%,$(MY_KERNELRELEASE)),)
|
---|
27 |
|
---|
28 | # Linux kbuild sets this to our source directory if we are called from there
|
---|
29 | obj ?= $(CURDIR)
|
---|
30 | include $(obj)/Makefile.include.header
|
---|
31 |
|
---|
32 | # sledgehammer, see the 2.4 handling in Makefile.include.footer
|
---|
33 | ifneq ($(KERN_VERSION),24)
|
---|
34 |
|
---|
35 | MOD_NAME = vboxvideo
|
---|
36 |
|
---|
37 | MOD_OBJS = hgsmi_base.o \
|
---|
38 | modesetting.o vbox_drv.o vbox_fb.o vbox_irq.o vbox_main.o \
|
---|
39 | vbox_mode.o vbox_ttm.o vbva_base.o vbox_prime.o vbox_hgsmi.o
|
---|
40 |
|
---|
41 | MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -fno-pie
|
---|
42 | MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include)
|
---|
43 | # What on earth is this?
|
---|
44 | # MOD_INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxvideo,/ /include)
|
---|
45 | MOD_INCL += -Iinclude/drm
|
---|
46 | MOD_DEFS := -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
|
---|
47 | -DIN_SUP_R0 -DVBOX -DVBOX_WITH_HGCM -DLOG_TO_BACKDOOR -DIN_MODULE \
|
---|
48 | -DIN_GUEST_R0
|
---|
49 | # our module does not export any symbol
|
---|
50 | MOD_DEFS += -DRT_NO_EXPORT_SYMBOL
|
---|
51 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
52 | MOD_DEFS += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
|
---|
53 | else
|
---|
54 | MOD_DEFS += -DRT_ARCH_X86
|
---|
55 | endif
|
---|
56 | MOD_CLEAN = . linux r0drv r0drv/linux
|
---|
57 |
|
---|
58 | include $(obj)/Makefile.include.footer
|
---|
59 |
|
---|
60 | else # KERN_VERSION=24
|
---|
61 |
|
---|
62 | all:
|
---|
63 |
|
---|
64 | endif # KERN_VERSION=24
|
---|
65 |
|
---|
66 | else # ifneq ($(filter ...,$(MY_KERNELRELEASE)),)
|
---|
67 |
|
---|
68 | all:
|
---|
69 |
|
---|
70 | endif # ifneq ($(filter ...,$(MY_KERNELRELEASE)),)
|
---|
71 |
|
---|