VirtualBox

Ignore:
Timestamp:
Sep 1, 2017 4:46:58 PM (7 years ago)
Author:
vboxsync
Message:

Linux driver make files: reverted r117833.

File:
1 edited

Legend:

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

    r68609 r68610  
    1616
    1717# Testing:
    18 # * Building with KERN_DIR set uses the value specified and
     18# * Building with KERN_VER set to an installed but non-current kernel works and
     19#   installs to the right location.
     20# * Building with KERN_DIR and/or MODULE_DIR set uses the value specified and
    1921#   the default value for the unspecified one if any.
    2022
     
    3335# MOD_INCL = <any additional include paths which this module needs>
    3436# MOD_CFLAGS = <any additional CFLAGS which this module needs>
     37# MOD_CLEAN = <list of directories that the clean target should look at>
    3538# include $(obj)/Makefile.include.footer
    3639#
     
    8487endif
    8588
     89ifneq ($(MAKECMDGOALS),clean)
     90
    8691ifeq ($(KERNELRELEASE),)
    8792
     
    9095 #
    9196
     97 # target kernel version
     98 ifndef KERN_VER
     99  KERN_VER := $(shell uname -r)
     100 else
     101  ifneq ($(shell if test -d /lib/modules/$(KERN_VER)/build; then echo yes; fi),yes)
     102   KERN_VER := $(shell uname -r)
     103  endif
     104 endif
     105
    92106 # kernel base directory
    93107 ifndef KERN_DIR
    94   KERN_DIR := /lib/modules/$(shell uname -r)/build
     108  KERN_DIR := /lib/modules/$(KERN_VER)/build
    95109  ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    96    $(error Error: unable to find the sources of your current Linux kernel. \
     110   KERN_DIR := /usr/src/linux
     111   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
     112    $(error Error: unable to find the sources of your current Linux kernel. \
    97113                   Specify KERN_DIR=<directory> and run Make again)
     114   endif
     115   $(warning Warning: using /usr/src/linux as the source directory of your \
     116                      Linux kernel. If this is not correct, specify \
     117                      KERN_DIR=<directory> and run Make again.)
    98118  endif
    99119 else
     
    105125 # includes
    106126 ifndef KERN_INCL
    107   KERN_INCL := $(KERN_DIR)/include
     127  KERN_INCL = $(KERN_DIR)/include
    108128 endif
    109129 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
     
    112132 endif
    113133
    114  # module install dir
    115  INSTALL_MOD_DIR ?= misc
     134 # module install dir, only for current kernel
     135 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
     136  ifndef MODULE_DIR
     137   MODULE_DIR_TST := /lib/modules/$(KERN_VER)
     138   ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
     139    MODULE_DIR := $(MODULE_DIR_TST)/misc
     140   else
     141    $(error Unable to find the folder to install the module to)
     142   endif
     143  endif # MODULE_DIR unspecified
     144 endif
    116145
    117  # guess kernel major version (24 or later)
    118  ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null 2>&1; then echo yes; fi),yes)
     146 # guess kernel version (24 or 26)
     147 ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
    119148  KERN_VERSION := 24
    120149 else
     
    135164 endif
    136165
    137  KERN_DIR := /lib/modules/$(KERNELRELEASE)/build
    138  KERN_INCL := $(KERN_DIR)/include
    139 
    140166endif # neq($(KERNELRELEASE),)
    141167
    142168# debug - show guesses.
    143169ifdef DEBUG
    144 $(warning dbg: KERN_DIR         = $(KERN_DIR))
    145 $(warning dbg: KERN_INCL        = $(KERN_INCL))
    146 $(warning dbg: INSTALL_MOD_PATH = $(INSTALL_MOD_PATH))
    147 $(warning dbg: INSTALL_MOD_DIR  = $(INSTALL_MOD_DIR))
    148 $(warning dbg: KERN_VERSION     = $(KERN_VERSION))
     170$(warning dbg: KERN_DIR     = $(KERN_DIR))
     171$(warning dbg: KERN_INCL    = $(KERN_INCL))
     172$(warning dbg: MODULE_DIR   = $(MODULE_DIR))
     173$(warning dbg: KERN_VERSION = $(KERN_VERSION))
    149174endif
     175
     176endif # 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