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 |
|
---|
22 | SUB_DEPTH = ../../../../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 |
|
---|
25 | INSTALLS += vboxvideo_drm-mod vboxvideo_drm-sh
|
---|
26 | ifdef 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,)
|
---|
31 | endif
|
---|
32 |
|
---|
33 | #
|
---|
34 | # Populate FILES_VBOXVIDEO_DRM_NOBIN
|
---|
35 | #
|
---|
36 | include $(PATH_SUB_CURRENT)/files_vboxvideo_drm
|
---|
37 |
|
---|
38 | vboxvideo_drm-mod_INST = $(INST_ADDITIONS)src/vboxvideo_drm/
|
---|
39 | vboxvideo_drm-mod_MODE = a+r,u+w
|
---|
40 | vboxvideo_drm-mod_SOURCES = $(subst ",,$(FILES_VBOXVIDEO_DRM_NOBIN))
|
---|
41 | vboxvideo_drm-mod_SOURCES += $(if $(VBOX_OSE),,\
|
---|
42 | $(PATH_vboxvideo_drm-mod)/dkms.conf)
|
---|
43 | vboxvideo_drm-mod_CLEAN += $(PATH_vboxvideo_drm-mod)/dkms.conf
|
---|
44 |
|
---|
45 | vboxvideo_drm-sh_INST = $(INST_ADDITIONS)src/vboxvideo_drm/
|
---|
46 | vboxvideo_drm-sh_MODE = a+rx,u+w
|
---|
47 | vboxvideo_drm-sh_SOURCES = $(subst ",,$(FILES_VBOXVIDEO_DRM_BIN))
|
---|
48 | vboxvideo_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)
|
---|
52 | vboxvideo_drm-sh_CLEAN += $(PATH_vboxvideo_drm-sh)/build_in_tmp
|
---|
53 |
|
---|
54 |
|
---|
55 | #
|
---|
56 | # The module (for syntax checking).
|
---|
57 | #
|
---|
58 | vboxvideo_drm_TEMPLATE = VBOXGUESTR0
|
---|
59 | vboxvideo_drm_NOINST = 1
|
---|
60 | vboxvideo_drm_CFLAGS = -fshort-wchar
|
---|
61 | vboxvideo_drm_DEFS = \
|
---|
62 | MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \
|
---|
63 | KBUILD_MODNAME=KBUILD_STR\(vboxvideo\) \
|
---|
64 | KBUILD_BASENAME=KBUILD_STR\(vboxvideo\)
|
---|
65 | vboxvideo_drm_SOURCES = vboxvideo_drm.c
|
---|
66 |
|
---|
67 | # detect fc6 2.6.18
|
---|
68 | vboxvideo_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
|
---|
73 | vboxvideo_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 |
|
---|
96 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
97 |
|
---|