summaryrefslogtreecommitdiff
path: root/src/VBox/Additions/linux/drm/Makefile.kmk
blob: e95b0f7be234dcac0c4b31e772d0ed21a4d24c99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the vboxvideo DRM module (linux kernel OpenGL module).
#

#
# Copyright (C) 2006-2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#

SUB_DEPTH = ../../../../..
include $(KBUILD_PATH)/subheader.kmk

#
# Populate FILES_VBOXVIDEO_DRM_NOBIN
#
INSTALLS += vboxvideo_drm-mod
if !defined(VBOX_WITH_GUEST_KMS_DRIVER)
 include $(PATH_SUB_CURRENT)/files_vboxvideo_drm
else
 include $(PATH_SUB_CURRENT)/files_vboxvideo_drv
endif
vboxvideo_drm-mod_INST         = $(INST_ADDITIONS)src/vboxvideo/
vboxvideo_drm-mod_SOURCES      = \
	$(subst $(DQUOTE),,$(FILES_VBOXVIDEO_DRM_NOBIN))
vboxvideo_drm-mod_EXEC_SOURCES = \
	$(subst $(DQUOTE),,$(FILES_VBOXVIDEO_DRM_BIN)) \
	$(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers


#
# The kernel module.
#
# Note! Syntax checking only.  Don't bother if drmP.h is missing (introduced
#       in 2.6.27).  For the mode-setting driver make sure this is supported.
# Note! The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels.
#
if defined(VBOX_WITH_ADDITION_DRIVERS)
 if !defined(VBOX_WITH_GUEST_KMS_DRIVER)
  if "$(strip $(foreach inc,$(VBOX_LINUX_INCS),$(wildcard $(inc)/drm/drmP.h)))" != ""
   SYSMODS += vboxvideo_drm
  endif
 else
  if "$(shell grep -s 'DRIVER_MODESET' $(foreach inc,$(VBOX_LINUX_INCS),$(inc)/drm/drmP.h))" != ""
   SYSMODS += vboxvideo_drm
  endif
 endif
endif

vboxvideo_drm_TEMPLATE        = VBOXGUESTR0
vboxvideo_drm_CFLAGS          = -fshort-wchar
vboxvideo_drm_DEFS            = \
	MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \
	KBUILD_MODNAME=KBUILD_STR\(vboxvideo\) \
	KBUILD_BASENAME=KBUILD_STR\(vboxvideo\) \
	DEBUG_HASH=2 DEBUG_HASH2=3
# detect fc6 2.6.18
vboxvideo_drm_DEFS           += \
	$(foreach inc,$(VBOX_LINUX_INCS),\
		$(if $(wildcard $(inc)/linux/utsrelease.h),\
		 $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
		               then echo yes; fi),KERNEL_FC6,),))
# detect rhel5 2.6.18
vboxvideo_drm_DEFS           += \
	$(foreach inc,$(VBOX_LINUX_INCS),\
		$(if $(wildcard $(inc)/linux/utsrelease.h),\
		 $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
		               then echo yes; fi),KERNEL_FC6,),))
if !defined(VBOX_WITH_GUEST_KMS_DRIVER)
 vboxvideo_drm_SOURCES         = vboxvideo_drm.c
else
 vboxvideo_drm_INCS           += \
   ../../../Runtime/include \
   ../../../Runtime/r0drv/linux
 vboxvideo_drm_SOURCES         = \
   ../../common/VBoxVideo/HGSMIBase.cpp \
   ../../common/VBoxVideo/Modesetting.cpp \
   ../../common/VBoxVideo/VBVABase.cpp \
   ../../../GuestHost/HGSMI/HGSMICommon.cpp \
   ../../../Runtime/common/alloc/heapoffset.cpp \
 	vbox_drv.c \
 	vbox_fb.c \
 	vbox_main.c \
 	vbox_mode.c \
 	vbox_ttm.c
endif

include $(FILE_KBUILD_SUB_FOOTER)