VirtualBox

Changeset 36467 in vbox for trunk/src/VBox/Installer


Ignore:
Timestamp:
Mar 29, 2011 8:34:18 PM (14 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Installer/linux
Files:
2 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
  • trunk/src/VBox/Installer/linux/Makefile.include.header

    r36463 r36467  
    2828# MOD_DEFS = <any additional defines which this module needs>
    2929# MOD_INCL = <any additional include paths which this module needs>
    30 # MOD_FLAGS = <any additional CFLAGS which this module needs>
     30# MOD_CFLAGS = <any additional CFLAGS which this module needs>
    3131# MOD_CLEAN = <list of directories that the clean target should look at>
    3232# include $(obj)/Makefile.include.footer
     
    3636# @todo the shared folders module Makefile also includes the following bits.
    3737# Integrate them if necessary.
    38 # MOD_FLAGS += -DEXPORT_SYMTAB -DVBGL_VBOXGUEST -DRT_WITH_VBOX
     38# MOD_CFLAGS += -DEXPORT_SYMTAB -DVBGL_VBOXGUEST -DRT_WITH_VBOX
    3939#
    4040# # special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
     
    101101 endif
    102102endif
     103
     104ifneq ($(MAKECMDGOALS),clean)
     105
     106ifeq ($(KERNELRELEASE),)
     107
     108 #
     109 # building from this directory
     110 #
     111
     112 # kernel base directory
     113 ifndef KERN_DIR
     114  KERN_DIR := /lib/modules/$(shell uname -r)/build
     115  ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
     116   KERN_DIR := /usr/src/linux
     117   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
     118    $(error Error: unable to find the sources of your current Linux kernel. \
     119                   Specify KERN_DIR=<directory> and run Make again)
     120   endif
     121   $(warning Warning: using /usr/src/linux as the source directory of your \
     122                      Linux kernel. If this is not correct, specify \
     123                      KERN_DIR=<directory> and run Make again.)
     124  endif
     125 else
     126  ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
     127   $(error Error: KERN_DIR does not point to a directory)
     128  endif
     129 endif
     130
     131 # includes
     132 ifndef KERN_INCL
     133  KERN_INCL = $(KERN_DIR)/include
     134 endif
     135 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
     136  $(error Error: unable to find the include directory for your current Linux \
     137                 kernel. Specify KERN_INCL=<directory> and run Make again)
     138 endif
     139
     140 # module install dir, only for current kernel
     141 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
     142  ifndef MODULE_DIR
     143   MODULE_DIR_TST := /lib/modules/$(shell uname -r)
     144   ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
     145    MODULE_DIR := $(MODULE_DIR_TST)/misc
     146   else
     147    $(error Unable to find the folder to install the module to)
     148   endif
     149  endif # MODULE_DIR unspecified
     150 endif
     151
     152 # guess kernel version (24 or 26)
     153 ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
     154  KERN_VERSION := 24
     155 else
     156  KERN_VERSION := 26
     157 endif
     158
     159else # neq($(KERNELRELEASE),)
     160
     161 #
     162 # building from kbuild (make -C <kernel_directory> M=`pwd`)
     163 #
     164
     165 # guess kernel version (24 or 26)
     166 ifeq ($(shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes)
     167  KERN_VERSION := 24
     168 else
     169  KERN_VERSION := 26
     170 endif
     171
     172endif # neq($(KERNELRELEASE),)
     173
     174# debug - show guesses.
     175ifdef DEBUG
     176$(warning dbg: KERN_DIR     = $(KERN_DIR))
     177$(warning dbg: KERN_INCL    = $(KERN_INCL))
     178$(warning dbg: MODULE_DIR   = $(MODULE_DIR))
     179$(warning dbg: KERN_VERSION = $(KERN_VERSION))
     180endif
     181
     182endif # eq($(MAKECMDGOALS),clean)
Note: See TracChangeset for help on using the changeset viewer.

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