1 | # $Id: Makefile.kmk 35380 2010-12-30 16:06:17Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the vboxvideo DRM module (linux kernel OpenGL module).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2010 Oracle Corporation
|
---|
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 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | INSTALLS += vboxvideo_drm-mod vboxvideo_drm-sh
|
---|
22 | ifdef VBOX_WITH_ADDITION_DRIVERS
|
---|
23 | # Only do a test build on kernels as of 2.6.27
|
---|
24 | SYSMODS += $(if $(strip $(foreach inc,$(VBOX_LINUX_INCS),\
|
---|
25 | $(wildcard $(inc)/drm/drmP.h))),vboxvideo_drm,)
|
---|
26 | endif
|
---|
27 |
|
---|
28 | #
|
---|
29 | # Populate FILES_VBOXVIDEO_DRM_NOBIN
|
---|
30 | #
|
---|
31 | include $(PATH_SUB_CURRENT)/files_vboxvideo_drm
|
---|
32 |
|
---|
33 | vboxvideo_drm-mod_INST = $(INST_ADDITIONS)src/vboxvideo/
|
---|
34 | vboxvideo_drm-mod_MODE = a+r,u+w
|
---|
35 | vboxvideo_drm-mod_SOURCES = $(subst ",,$(FILES_VBOXVIDEO_DRM_NOBIN))
|
---|
36 |
|
---|
37 | vboxvideo_drm-sh_INST = $(INST_ADDITIONS)src/vboxvideo/
|
---|
38 | vboxvideo_drm-sh_MODE = a+rx,u+w
|
---|
39 | vboxvideo_drm-sh_SOURCES = $(subst ",,$(FILES_VBOXVIDEO_DRM_BIN))
|
---|
40 | vboxvideo_drm-sh_SOURCES += \
|
---|
41 | $(vboxvideo_drm-sh_0_OUTDIR)/build_in_tmp \
|
---|
42 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
|
---|
43 | vboxvideo_drm-sh_CLEAN += $(vboxvideo_drm-sh_0_OUTDIR)/build_in_tmp
|
---|
44 |
|
---|
45 |
|
---|
46 | #
|
---|
47 | # The module (for syntax checking).
|
---|
48 | # The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels
|
---|
49 | #
|
---|
50 | vboxvideo_drm_TEMPLATE = VBOXGUESTR0
|
---|
51 | vboxvideo_drm_NOINST = 1
|
---|
52 | vboxvideo_drm_CFLAGS = -fshort-wchar
|
---|
53 | vboxvideo_drm_DEFS = \
|
---|
54 | MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \
|
---|
55 | KBUILD_MODNAME=KBUILD_STR\(vboxvideo\) \
|
---|
56 | KBUILD_BASENAME=KBUILD_STR\(vboxvideo\) \
|
---|
57 | DEBUG_HASH=2 DEBUG_HASH2=3
|
---|
58 | vboxvideo_drm_SOURCES = vboxvideo_drm.c
|
---|
59 |
|
---|
60 | # detect fc6 2.6.18
|
---|
61 | vboxvideo_drm_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\
|
---|
62 | $(if $(wildcard $(inc)/linux/utsrelease.h),\
|
---|
63 | $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
|
---|
64 | then echo yes; fi),KERNEL_FC6,),))
|
---|
65 | # detect rhel5 2.6.18
|
---|
66 | vboxvideo_drm_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\
|
---|
67 | $(if $(wildcard $(inc)/linux/utsrelease.h),\
|
---|
68 | $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
|
---|
69 | then echo yes; fi),KERNEL_FC6,),))
|
---|
70 |
|
---|
71 |
|
---|
72 | ## Scripts needed for building kernel modules
|
---|
73 |
|
---|
74 | $$(vboxvideo_drm-sh_0_OUTDIR)/build_in_tmp: \
|
---|
75 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
|
---|
76 | $(VBOX_VERSION_STAMP) \
|
---|
77 | | $$(dir $$@)
|
---|
78 | $(call MSG_TOOL,Creating,,$@)
|
---|
79 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxvideo;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" < $< > $@
|
---|
80 | $(QUIET)chmod 0755 $@
|
---|
81 |
|
---|
82 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
83 |
|
---|