VirtualBox

Ignore:
Timestamp:
Mar 29, 2011 8:34:18 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70851
Message:

Additions/linux: adjustments to kernel module makefile split header and footer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/Makefile.include.footer

    r36463 r36467  
    2525# MOD_DEFS = <any additional defines which this module needs>
    2626# MOD_INCL = <any additional include paths which this module needs>
    27 # MOD_FLAGS = <any additional CFLAGS which this module needs>
     27# MOD_CFLAGS = <any additional CFLAGS which this module needs>
    2828# MOD_CLEAN = <list of directories that the clean target should look at>
    2929#
     
    3232# @todo the shared folders module Makefile also includes the following bits.
    3333# Integrate them if necessary.
    34 # MOD_FLAGS += -DEXPORT_SYMTAB -DVBGL_VBOXGUEST -DRT_WITH_VBOX
     34# MOD_CFLAGS += -DEXPORT_SYMTAB -DVBGL_VBOXGUEST -DRT_WITH_VBOX
    3535#
    3636# # special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
     
    6363
    6464ifneq ($(MAKECMDGOALS),clean)
    65 
    66 ifeq ($(KERNELRELEASE),)
    67 
    68  #
    69  # building from this directory
    70  #
    71 
    72  # kernel base directory
    73  ifndef KERN_DIR
    74   KERN_DIR := /lib/modules/$(shell uname -r)/build
    75   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    76    KERN_DIR := /usr/src/linux
    77    ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    78     $(error Error: unable to find the sources of your current Linux kernel. \
    79                    Specify KERN_DIR=<directory> and run Make again)
    80    endif
    81    $(warning Warning: using /usr/src/linux as the source directory of your \
    82                       Linux kernel. If this is not correct, specify \
    83                       KERN_DIR=<directory> and run Make again.)
    84   endif
    85  else
    86   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    87    $(error Error: KERN_DIR does not point to a directory)
    88   endif
    89  endif
    90 
    91  # includes
    92  ifndef KERN_INCL
    93   KERN_INCL = $(KERN_DIR)/include
    94  endif
    95  ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
    96   $(error Error: unable to find the include directory for your current Linux \
    97                  kernel. Specify KERN_INCL=<directory> and run Make again)
    98  endif
    99 
    100  # module install dir, only for current kernel
    101  ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
    102   ifndef MODULE_DIR
    103    MODULE_DIR_TST := /lib/modules/$(shell uname -r)
    104    ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
    105     MODULE_DIR := $(MODULE_DIR_TST)/misc
    106    else
    107     $(error Unable to find the folder to install the driver ($(MOD_NAME)) to)
    108    endif
    109   endif # MODULE_DIR unspecified
    110  endif
    111 
    112  # guess kernel version (24 or 26)
    113  ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
    114   KERN_VERSION := 24
    115  else
    116   KERN_VERSION := 26
    117  endif
    118 
    119 else # neq($(KERNELRELEASE),)
    120 
    121  #
    122  # building from kbuild (make -C <kernel_directory> M=`pwd`)
    123  #
    124 
    125  # guess kernel version (24 or 26)
    126 # MOD_OBJS = <list of object files which should be included>
    127  ifeq ($(shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes)
    128   KERN_VERSION := 24
    129  else
    130   KERN_VERSION := 26
    131  endif
    132 
    133 endif # neq($(KERNELRELEASE),)
    134 
    135 # debug - show guesses.
    136 ifdef DEBUG
    137 $(warning dbg: KERN_DIR     = $(KERN_DIR))
    138 $(warning dbg: KERN_INCL    = $(KERN_INCL))
    139 $(warning dbg: MODULE_DIR   = $(MODULE_DIR))
    140 $(warning dbg: KERN_VERSION = $(KERN_VERSION))
    141 endif
    14265
    14366KBUILD_VERBOSE ?= 1
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette