# $Id: Makefile.kmk 38216 2011-07-28 11:15:30Z vboxsync $ ## @file # Sub-Makefile for the vboxvideo DRM module (linux kernel OpenGL module). # # # Copyright (C) 2006-2011 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)) \ $(vboxvideo_drm-mod_0_OUTDIR)/build_in_tmp \ $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers vboxvideo_drm-mod_CLEAN += $(vboxvideo_drm-mod_0_OUTDIR)/build_in_tmp # Script needed for building the kernel module. $$(vboxvideo_drm-mod_0_OUTDIR)/build_in_tmp: \ $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \ $(VBOX_VERSION_STAMP) \ | $$(dir $$@) $(call MSG_TOOL,Creating,,$@) $(QUIET)$(RM) -f -- $@ $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxvideo;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" \ --output=$@ $< $(QUIET)$(CHMOD) 0755 $@ # # The kernel module. # # Note! Syntax checking only. Don't bother if drmP.h is missing (introduced # in 2.6.27). # Note! The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels. # if defined(VBOX_WITH_ADDITION_DRIVERS) \ && "$(strip $(foreach inc,$(VBOX_LINUX_INCS),$(wildcard $(inc)/drm/drmP.h)))" != "" SYSMODS += vboxvideo_drm vboxvideo_drm_TEMPLATE = VBOXGUESTR0 vboxvideo_drm_NOINST = 1 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_SOURCES = \ ../../common/VBoxVideo/Modesetting.cpp \ vboxvideo_device.c \ vboxvideo_display.c \ vboxvideo_drv.c \ vboxvideo_kms.c endif endif include $(KBUILD_PATH)/subfooter.kmk