VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/drm/Makefile.kmk@ 17414

Last change on this file since 17414 was 17414, checked in by vboxsync, 16 years ago

fixed 2.6.27+ detection

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1# $Id: Makefile.kmk 17414 2009-03-05 16:16:47Z vboxsync $
2## @file
3# Sub-Makefile for the vboxvideo DRM module (linux kernel OpenGL module).
4#
5
6#
7# Copyright (C) 2006-2007 Sun Microsystems, Inc.
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18# Clara, CA 95054 USA or visit http://www.sun.com if you need
19# additional information or have any questions.
20#
21
22SUB_DEPTH = ../../../../..
23include $(KBUILD_PATH)/subheader.kmk
24
25INSTALLS += vboxvideo_drm-mod vboxvideo_drm-sh
26ifdef VBOX_WITH_ADDITION_DRIVERS
27# Only do a test build on kernels as of 2.6.27
28 SYSMODS += $(if $(strip $(foreach inc,$(VBOX_LINUX_INCS),\
29 $(if $(wildcard $(inc)/drm/drmP.h),\
30 yes,))),vboxvideo_drm,)
31endif
32
33#
34# Populate FILES_VBOXVIDEO_DRM_NOBIN
35#
36include $(PATH_SUB_CURRENT)/files_vboxvideo_drm
37
38vboxvideo_drm-mod_INST = $(INST_ADDITIONS)src/vboxvideo_drm/
39vboxvideo_drm-mod_MODE = a+r,u+w
40vboxvideo_drm-mod_SOURCES = $(subst ",,$(FILES_VBOXVIDEO_DRM_NOBIN))
41vboxvideo_drm-mod_SOURCES += $(if $(VBOX_OSE),,\
42 $(PATH_vboxvideo_drm-mod)/dkms.conf)
43vboxvideo_drm-mod_CLEAN += $(PATH_vboxvideo_drm-mod)/dkms.conf
44
45vboxvideo_drm-sh_INST = $(INST_ADDITIONS)src/vboxvideo_drm/
46vboxvideo_drm-sh_MODE = a+rx,u+w
47vboxvideo_drm-sh_SOURCES = $(subst ",,$(FILES_VBOXVIDEO_DRM_BIN))
48vboxvideo_drm-sh_SOURCES += \
49 $(PATH_vboxvideo_drm-sh)/build_in_tmp \
50 $(if $(VBOX_OSE),,\
51 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers)
52vboxvideo_drm-sh_CLEAN += $(PATH_vboxvideo_drm-sh)/build_in_tmp
53
54
55#
56# The module (for syntax checking).
57#
58vboxvideo_drm_TEMPLATE = VBOXGUESTR0
59vboxvideo_drm_NOINST = 1
60vboxvideo_drm_CFLAGS = -fshort-wchar
61vboxvideo_drm_DEFS = \
62 MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \
63 KBUILD_MODNAME=KBUILD_STR\(vboxvideo\) \
64 KBUILD_BASENAME=KBUILD_STR\(vboxvideo\)
65vboxvideo_drm_SOURCES = vboxvideo_drm.c
66
67# detect fc6 2.6.18
68vboxvideo_drm_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\
69 $(if $(wildcard $(inc)/linux/utsrelease.h),\
70 $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
71 then echo yes; fi),KERNEL_FC6,),))
72# detect rhel5 2.6.18
73vboxvideo_drm_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\
74 $(if $(wildcard $(inc)/linux/utsrelease.h),\
75 $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
76 then echo yes; fi),KERNEL_FC6,),))
77
78
79## Scripts needed for building kernel modules
80
81$$(PATH_vboxvideo_drm-sh)/build_in_tmp: \
82 $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
83 $(VBOX_VERSION_STAMP) \
84 | $$(dir $$@)
85 $(call MSG_TOOL,Creating,,$@)
86 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxvideo;g" < $< > $@
87 $(QUIET)chmod 0755 $@
88
89$$(PATH_vboxvideo_drm-mod)/dkms.conf: \
90 $(PATH_SUB_CURRENT)/dkms.conf \
91 $(VBOX_VERSION_STAMP) \
92 | $$(dir $$@)
93 $(call MSG_TOOL,Creating,,$@)
94 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" < $< > $@
95
96include $(KBUILD_PATH)/subfooter.kmk
97
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