VirtualBox

Changeset 68682 in vbox


Ignore:
Timestamp:
Sep 6, 2017 2:54:29 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117913
Message:

Drivers/Linux: make host kernel modules use make file templates.
bugref:4567: Linux kernel driver maintenance

Rework the make files from the host kernel drivers to use the
Makefile.include.header and Makefile.include.footer templates, and clean up
some obsolete scripting in the make files.

Location:
trunk/src/VBox/HostDrivers
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r67293 r68682  
    66#
    77#
    8 # Copyright (C) 2006-2015 Oracle Corporation
     8# Copyright (C) 2006-2017 Oracle Corporation
    99#
    1010# This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626#
    2727
    28 ## @todo If you make non-trivial changes to this make file, please consider
    29 #        rewriting it to use Makefile.include.header and
    30 #        Makefile.include.footer.
     28# Linux kbuild sets this to our source directory if we are called from
     29# there
     30obj ?= $(CURDIR)
     31include $(obj)/Makefile.include.header
    3132
    32 #
    33 # First, figure out which architecture we're targeting and the build type.
    34 # (We have to support basic cross building (ARCH=i386|x86_64).)
    35 # While at it, warn about BUILD_* vars found to help with user problems.
    36 #
    37 ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
    38  BUILD_TARGET_ARCH_DEF := amd64
    39 else
    40  BUILD_TARGET_ARCH_DEF := x86
    41 endif
    42 ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
    43  $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
    44  BUILD_TARGET_ARCH :=
    45 endif
    46 ifeq ($(BUILD_TARGET_ARCH),)
    47  ifeq ($(ARCH),x86_64)
    48   BUILD_TARGET_ARCH := amd64
    49  else
    50   ifeq ($(ARCH),i386)
    51    BUILD_TARGET_ARCH := x86
    52   else
    53    BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
    54   endif
    55  endif
    56 else
    57  ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
    58   $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
    59  endif
    60 endif
    61 
    62 ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
    63  $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
    64  BUILD_TYPE :=
    65 endif
    66 ifeq ($(BUILD_TYPE),)
    67  BUILD_TYPE := release
    68 else
    69  ifneq ($(BUILD_TYPE),release)
    70   $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
    71  endif
    72 endif
    73 
    74 # override is required by the Debian guys
    75 override MODULE = vboxdrv
    76 OBJS   = \
     33MOD_NAME = vboxdrv
     34MOD_OBJS = \
    7735        linux/SUPDrv-linux.o \
    7836        SUPDrv.o \
     
    159117        VBox/log-vbox.o
    160118ifeq ($(BUILD_TARGET_ARCH),x86)
    161 OBJS += math/gcc/divdi3.o \
     119 MOD_OBJS += math/gcc/divdi3.o \
    162120        math/gcc/moddi3.o \
    163121        math/gcc/qdivrem.o \
     
    168126endif
    169127ifeq ($(BUILD_TARGET_ARCH),amd64)
    170 OBJS += common/alloc/heapsimple.o
     128 MOD_OBJS += common/alloc/heapsimple.o
    171129endif
    172130ifdef VBOX_WITH_NATIVE_DTRACE
    173 OBJS += SUPDrvDTrace.o
     131 MOD_OBJS += SUPDrvDTrace.o
    174132endif
    175133
    176 ifneq ($(MAKECMDGOALS),clean)
    177 
    178 ifeq ($(KERNELRELEASE),)
    179 
    180  #
    181  # building from this directory
    182  #
    183 
    184  # kernel base directory
    185  ifndef KERN_DIR
    186   # build for the current kernel, version check
    187   KERN_DIR := /lib/modules/$(shell uname -r)/build
    188   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    189    KERN_DIR := /usr/src/linux
    190    ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    191     $(error Error: unable to find the sources of your current Linux kernel. \
    192                    Specify KERN_DIR=<directory> and run Make again)
    193    endif
    194    $(warning Warning: using /usr/src/linux as the source directory of your \
    195                       Linux kernel. If this is not correct, specify \
    196                       KERN_DIR=<directory> and run Make again.)
    197   endif
    198  else
    199   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    200    $(error Error: KERN_DIR does not point to a directory)
    201   endif
    202  endif
    203 
    204  # includes
    205  ifndef KERN_INCL
    206   KERN_INCL = $(KERN_DIR)/include
    207  endif
    208  ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
    209   $(error Error: unable to find the include directory for your current Linux \
    210                  kernel. Specify KERN_INCL=<directory> and run Make again)
    211  endif
    212 
    213  # module install dir, only for current kernel
    214  ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
    215   ifndef MODULE_DIR
    216    MODULE_DIR_TST := /lib/modules/$(shell uname -r)
    217    ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
    218     MODULE_DIR := $(MODULE_DIR_TST)/misc
    219    else
    220     $(error Unable to find the folder to install the support driver to)
    221    endif
    222   endif # MODULE_DIR unspecified
    223  endif
    224 
    225 else # neq($(KERNELRELEASE),)
    226 
    227  #
    228  # building from kbuild (make -C <kernel_directory> M=`pwd`)
    229  #
    230 
    231 endif # neq($(KERNELRELEASE),)
    232 
    233 # debug - show guesses.
    234 ifdef DEBUG
    235 $(warning dbg: KERN_DIR     = $(KERN_DIR))
    236 $(warning dbg: KERN_INCL    = $(KERN_INCL))
    237 $(warning dbg: MODULE_DIR   = $(MODULE_DIR))
     134MOD_INCL  = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     135ifdef VBOX_WITH_NATIVE_DTRACE
     136 MOD_INCL += -I/usr/include/linux -I/usr/include
     137endif
     138MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
     139        -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER \
     140        -DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITH_EFLAGS_AC_PRESERVING \
     141    -Wno-declaration-after-statement
     142ifndef CONFIG_VBOXDRV_FIXEDMAJOR
     143 MOD_DEFS += -DCONFIG_VBOXDRV_AS_MISC
     144endif
     145ifdef VBOX_WITH_NATIVE_DTRACE
     146 MOD_DEFS += -DVBOX_WITH_NATIVE_DTRACE
     147endif
     148ifeq ($(BUILD_TARGET_ARCH),amd64)
     149 MOD_DEFS += -DRT_ARCH_AMD64
     150else
     151 MOD_DEFS += -DRT_ARCH_X86
     152endif
     153# must be consistent with Config.kmk!
     154MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
     155ifdef VBOX_WITH_TEXT_MODMEM_HACK
     156 MOD_DEFS += -DRTMEMALLOC_EXEC_HEAP -DVBOX_WITH_TEXT_MODMEM_HACK
    238157endif
    239158
    240 KBUILD_VERBOSE ?= 1
     159# build defs
     160MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h \
     161        -fno-omit-frame-pointer -fno-pie
    241162
    242 #
    243 # Compiler options
    244 #
    245 ifndef INCL
    246  INCL    := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL))
    247  ifndef KBUILD_EXTMOD
    248   KBUILD_EXTMOD := $(shell pwd)
    249  endif
    250  INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
    251  INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxdrv,/ /include /r0drv/linux)
    252  ifdef VBOX_WITH_NATIVE_DTRACE
    253   INCL   += -I/usr/include/linux -I/usr/include
    254  endif
    255  export INCL
    256 endif
    257 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxdrv),)
    258  MANGLING := $(KBUILD_EXTMOD)/vboxdrv/include/VBox/SUPDrvMangling.h
    259 else
    260  MANGLING := $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h
    261 endif
    262 KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
    263             -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
    264             -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITH_EFLAGS_AC_PRESERVING \
    265             -Wno-declaration-after-statement
    266 ifdef VBOX_REDHAT_KABI
    267  KFLAGS  += -DVBOX_REDHAT_KABI
    268 endif
    269 ifndef CONFIG_VBOXDRV_FIXEDMAJOR
    270  KFLAGS  += -DCONFIG_VBOXDRV_AS_MISC
    271 endif
    272 ifdef VBOX_WITH_NATIVE_DTRACE
    273  KFLAGS  += -DVBOX_WITH_NATIVE_DTRACE
    274 endif
    275 ifeq ($(BUILD_TARGET_ARCH),amd64)
    276  KFLAGS  += -DRT_ARCH_AMD64
    277 else
    278  KFLAGS  += -DRT_ARCH_X86
    279 endif
    280 # must be consistent with Config.kmk!
    281 KFLAGS  += -DVBOX_WITH_64_BITS_GUESTS
    282 ifeq ($(BUILD_TYPE),debug)
    283  KFLAGS  += -DDEBUG -DDEBUG_$(USER) -g
    284  # IPRT_DEBUG_SEMS indicates thread wrt sems state via the comm field.
    285  #KFLAGS  += -DIPRT_DEBUG_SEMS
    286 endif
    287 ifdef VBOX_WITH_TEXT_MODMEM_HACK
    288  KFLAGS += -DRTMEMALLOC_EXEC_HEAP -DVBOX_WITH_TEXT_MODMEM_HACK
    289 endif
    290 
    291 # 2.6 and later
    292 MODULE_EXT    := ko
    293 $(MODULE)-y   := $(OBJS)
    294 
    295 # build defs
    296 EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-omit-frame-pointer -fno-pie
    297 
    298 all: $(MODULE)
    299 
    300 obj-m += $(MODULE).o
    301 
    302 JOBS := $(shell (getconf _NPROCESSORS_ONLN || grep -Ec '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
    303 ifeq ($(JOBS),0)
    304   JOBS := 1
    305 endif
    306 
    307 # OL/UEK: disable module signing for external modules -- we don't have any private key
    308 $(MODULE):
    309         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) CONFIG_MODULE_SIG= -C $(KERN_DIR) -j$(JOBS) modules
    310 
    311 install: $(MODULE)
    312         @mkdir -p $(MODULE_DIR); \
    313         install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
    314         PATH="$(PATH):/bin:/sbin" depmod -a; \
    315         rm -f /etc/vbox/module_not_compiled
    316 
    317 install_rpm: $(MODULE)
    318         @mkdir -p $(MODULE_DIR); \
    319         install -m 0644 $(MODULE).$(MODULE_EXT) $(MODULE_DIR)
    320 
    321 else # eq ($(MAKECMDGOALS),clean)
    322 
    323  ifndef KERN_DIR
    324   KERN_DIR := /lib/modules/$(shell uname -r)/build
    325   ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    326    KERN_DIR := /usr/src/linux
    327   endif
    328  endif
    329  ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    330 
    331 clean:
    332         find . \( -name \*.o -o -name \*.cmd \) -print0 | xargs -0 rm -f
    333         rm -rf .tmp_ver* $(MODULE).* Module.symvers Modules.symvers modules.order
    334 
    335  else
    336 
    337 clean:
    338         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -C $(KERN_DIR) clean
    339 
    340  endif
    341 
    342 endif # eq($(MAKECMDGOALS),clean)
     163include $(obj)/Makefile.include.footer
    343164
    344165check: $(MODULE)
     
    349170            false; \
    350171         fi
    351 
  • trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv

    r67295 r68682  
    9292    ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPDrvInternal.h=>SUPDrvInternal.h \
    9393    ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPLibAll.cpp=>SUPLibAll.c \
     94    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.footer=>Makefile.include.footer \
     95    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.header=>Makefile.include.header \
    9496    ${PATH_ROOT}/src/VBox/Runtime/common/alloc/alloc.cpp=>common/alloc/alloc.c \
    9597    ${PATH_ROOT}/src/VBox/Runtime/common/alloc/heapsimple.cpp=>common/alloc/heapsimple.c \
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile

    r67293 r68682  
    11#
    22# Makefile for the VirtualBox Linux Host Virtual Network Adapter Driver.
    3 # (For 2.6.x this file must be called 'Makefile'!)
    43#
    54
    65#
    76#
    8 # Copyright (C) 2006-2015 Oracle Corporation
     7# Copyright (C) 2006-2017 Oracle Corporation
    98#
    109# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1716#
    1817
    19 ## @todo If you make non-trivial changes to this make file, please consider
    20 #        rewriting it to use Makefile.include.header and
    21 #        Makefile.include.footer.
    22 
    23 #
    24 # First, figure out which architecture we're targeting and the build type.
    25 # (We have to support basic cross building (ARCH=i386|x86_64).)
    26 # While at it, warn about BUILD_* vars found to help with user problems.
    27 #
    28 ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
    29  BUILD_TARGET_ARCH_DEF := amd64
    30 else
    31  BUILD_TARGET_ARCH_DEF := x86
    32 endif
    33 ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
    34  $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
    35  BUILD_TARGET_ARCH :=
    36 endif
    37 ifeq ($(BUILD_TARGET_ARCH),)
    38  ifeq ($(ARCH),x86_64)
    39   BUILD_TARGET_ARCH := amd64
    40  else
    41   ifeq ($(ARCH),i386)
    42    BUILD_TARGET_ARCH := x86
    43   else
    44    BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
    45   endif
    46  endif
    47 else
    48  ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
    49   $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
    50  endif
    51 endif
    52 
    53 ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
    54  $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
    55  BUILD_TYPE :=
    56 endif
    57 ifeq ($(BUILD_TYPE),)
    58  BUILD_TYPE := release
    59 else
    60  ifneq ($(BUILD_TYPE),release)
    61   $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
    62  endif
    63 endif
     18# Linux kbuild sets this to our source directory if we are called from there
     19obj ?= $(CURDIR)
     20include $(obj)/Makefile.include.header
    6421
    6522# override is required by the Debian guys
    66 override MODULE = vboxnetadp
    67 OBJS  = \
     23MOD_NAME = vboxnetadp
     24MOD_OBJS = \
    6825        linux/VBoxNetAdp-linux.o \
    6926        VBoxNetAdp.o
    7027ifeq ($(BUILD_TARGET_ARCH),x86)
    71 OBJS += math/gcc/divdi3.o \
     28MOD_OBJS += math/gcc/divdi3.o \
    7229        math/gcc/moddi3.o \
    7330        math/gcc/qdivrem.o \
     
    7835endif
    7936
    80 ifneq ($(MAKECMDGOALS),clean)
    81 
    82 ifeq ($(KERNELRELEASE),)
    83 
    84  #
    85  # building from this directory
    86  #
    87 
    88  # kernel base directory
    89  ifndef KERN_DIR
    90   # build for the current kernel, version check
    91   KERN_DIR := /lib/modules/$(shell uname -r)/build
    92   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    93    KERN_DIR := /usr/src/linux
    94    ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    95     $(error Error: unable to find the sources of your current Linux kernel. \
    96                    Specify KERN_DIR=<directory> and run Make again)
    97    endif
    98    $(warning Warning: using /usr/src/linux as the source directory of your \
    99                       Linux kernel. If this is not correct, specify \
    100                       KERN_DIR=<directory> and run Make again.)
    101   endif
    102  else
    103   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    104    $(error Error: KERN_DIR does not point to a directory)
    105   endif
    106  endif
    107 
    108  # includes
    109  ifndef KERN_INCL
    110   KERN_INCL = $(KERN_DIR)/include
    111  endif
    112  ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
    113   $(error Error: unable to find the include directory for your current Linux \
    114                  kernel. Specify KERN_INCL=<directory> and run Make again)
    115  endif
    116 
    117  # module install dir, only for current kernel
    118  ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
    119   ifndef MODULE_DIR
    120    MODULE_DIR_TST := /lib/modules/$(shell uname -r)
    121    ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
    122     MODULE_DIR := $(MODULE_DIR_TST)/misc
    123    else
    124     $(error Unable to find the folder to install the support driver to)
    125    endif
    126   endif # MODULE_DIR unspecified
    127  endif
    128 
    129 else # neq($(KERNELRELEASE),)
    130 
    131  #
    132  # building from kbuild (make -C <kernel_directory> M=`pwd`)
    133  #
    134 
    135 endif # neq($(KERNELRELEASE),)
    136 
    137 # debug - show guesses.
    138 ifdef DEBUG
    139 $(warning dbg: KERN_DIR     = $(KERN_DIR))
    140 $(warning dbg: KERN_INCL    = $(KERN_INCL))
    141 $(warning dbg: MODULE_DIR   = $(MODULE_DIR))
    142 endif
    143 
    144 KBUILD_VERBOSE ?= 1
    145 
    146 #
    147 # Compiler options
    148 #
    149 ifndef INCL
    150  INCL    := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL))
    151  ifndef KBUILD_EXTMOD
    152   KBUILD_EXTMOD := $(shell pwd)
    153  endif
    154  INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
    155  INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxnetadp,/ /include /r0drv/linux)
    156  export INCL
    157 endif
    158 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp),)
    159  MANGLING := $(KBUILD_EXTMOD)/vboxnetadp/include/VBox/SUPDrvMangling.h
     37MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     38MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
     39            -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
     40            -Wno-declaration-after-statement
     41ifeq ($(BUILD_TARGET_ARCH),amd64)
     42 MOD_DEFS += -DRT_ARCH_AMD64
    16043else
    161  MANGLING := $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h
    162 endif
    163 KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
    164             -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
    165             -Wno-declaration-after-statement
    166 ifdef VBOX_REDHAT_KABI
    167  KFLAGS  += -DVBOX_REDHAT_KABI
    168 endif
    169 ifeq ($(BUILD_TARGET_ARCH),amd64)
    170  KFLAGS  += -DRT_ARCH_AMD64
    171 else
    172  KFLAGS  += -DRT_ARCH_X86
     44 MOD_DEFS += -DRT_ARCH_X86
    17345endif
    17446# must be consistent with Config.kmk!
    175 KFLAGS  += -DVBOX_WITH_64_BITS_GUESTS
    176 ifeq ($(BUILD_TYPE),debug)
    177  KFLAGS  += -DDEBUG -DDEBUG_$(USER) -g
    178  # IPRT_DEBUG_SEMS indicates thread wrt sems state via the comm field.
    179  #KFLAGS  += -DIPRT_DEBUG_SEMS
    180 endif
     47MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
    18148
    18249# By default we use remap_pfn_range() kernel API to make kernel pages
     
    19259endif
    19360
    194 MODULE_EXT    := ko
    195 $(MODULE)-y   := $(OBJS)
     61# build defs
     62MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
    19663
    197 # build defs
    198 EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-pie
    199 
    200 all: $(MODULE)
    201 
    202 obj-m += $(MODULE).o
    203 
    204 JOBS := $(shell (getconf _NPROCESSORS_ONLN || grep -Ec '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
    205 ifeq ($(JOBS),0)
    206   JOBS := 1
    207 endif
    208 
    209 # OL/UEK: disable module signing for external modules -- we don't have any private key
    210 $(MODULE):
    211         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) CONFIG_MODULE_SIG= -C $(KERN_DIR) -j$(JOBS) modules
    212 
    213 install: $(MODULE)
    214         @mkdir -p $(MODULE_DIR); \
    215         install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
    216         PATH="$(PATH):/bin:/sbin" depmod -a; \
    217         rm -f /etc/vbox/module_not_compiled
    218 
    219 install_rpm: $(MODULE)
    220         @mkdir -p $(MODULE_DIR); \
    221         install -m 0644 $(MODULE).$(MODULE_EXT) $(MODULE_DIR)
    222 
    223 else # eq ($(MAKECMDGOALS),clean)
    224 
    225  ifndef KERN_DIR
    226   KERN_DIR := /lib/modules/$(shell uname -r)/build
    227   ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    228    KERN_DIR := /usr/src/linux
    229   endif
    230  endif
    231  ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    232 
    233 clean:
    234         find . \( -name \*.o -o -name \*.cmd \) -print0 | xargs -0 rm -f
    235         rm -rf .tmp_ver* $(MODULE).* Module.symvers Modules.symvers modules.order
    236 
    237  else
    238 
    239 clean:
    240         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -C $(KERN_DIR) clean
    241 
    242  endif
    243 
    244 endif # eq($(MAKECMDGOALS),clean)
     64include $(obj)/Makefile.include.footer
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp

    r67295 r68682  
    6767    ${PATH_ROOT}/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c=>VBoxNetAdp.c \
    6868    ${PATH_ROOT}/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdpInternal.h=>VBoxNetAdpInternal.h \
     69    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.footer=>Makefile.include.footer \
     70    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.header=>Makefile.include.header \
    6971    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/divdi3.c=>math/gcc/divdi3.c \
    7072    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/moddi3.c=>math/gcc/moddi3.c \
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile

    r67293 r68682  
    11#
    22# Makefile for the VirtualBox Linux Host Network Filter Driver.
    3 # (For 2.6.x this file must be called 'Makefile'!)
    43#
    54
    65#
    76#
    8 # Copyright (C) 2006-2015 Oracle Corporation
     7# Copyright (C) 2006-2017 Oracle Corporation
    98#
    109# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1716#
    1817
    19 ## @todo If you make non-trivial changes to this make file, please consider
    20 #        rewriting it to use Makefile.include.header and
    21 #        Makefile.include.footer.
     18# Linux kbuild sets this to our source directory if we are called from
     19# there
     20obj ?= $(CURDIR)
     21include $(obj)/Makefile.include.header
    2222
    23 #
    24 # First, figure out which architecture we're targeting and the build type.
    25 # (We have to support basic cross building (ARCH=i386|x86_64).)
    26 # While at it, warn about BUILD_* vars found to help with user problems.
    27 #
    28 ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
    29  BUILD_TARGET_ARCH_DEF := amd64
    30 else
    31  BUILD_TARGET_ARCH_DEF := x86
    32 endif
    33 ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
    34  $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
    35  BUILD_TARGET_ARCH :=
    36 endif
    37 ifeq ($(BUILD_TARGET_ARCH),)
    38  ifeq ($(ARCH),x86_64)
    39   BUILD_TARGET_ARCH := amd64
    40  else
    41   ifeq ($(ARCH),i386)
    42    BUILD_TARGET_ARCH := x86
    43   else
    44    BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
    45   endif
    46  endif
    47 else
    48  ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
    49   $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
    50  endif
    51 endif
    52 
    53 ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
    54  $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
    55  BUILD_TYPE :=
    56 endif
    57 ifeq ($(BUILD_TYPE),)
    58  BUILD_TYPE := release
    59 else
    60  ifneq ($(BUILD_TYPE),release)
    61   $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
    62  endif
    63 endif
    64 
    65 # override is required by the Debian guys
    66 override MODULE = vboxnetflt
    67 OBJS   = \
     23MOD_NAME = vboxnetflt
     24MOD_OBJS = \
    6825        linux/VBoxNetFlt-linux.o \
    6926        VBoxNetFlt.o \
     
    7330
    7431ifeq ($(BUILD_TARGET_ARCH),x86)
    75 OBJS += math/gcc/divdi3.o \
     32MOD_OBJS += math/gcc/divdi3.o \
    7633        math/gcc/moddi3.o \
    7734        math/gcc/qdivrem.o \
     
    8239endif
    8340
    84 ifneq ($(MAKECMDGOALS),clean)
    85 
    86 ifeq ($(KERNELRELEASE),)
    87 
    88  #
    89  # building from this directory
    90  #
    91 
    92  # kernel base directory
    93  ifndef KERN_DIR
    94   # build for the current kernel, version check
    95   KERN_DIR := /lib/modules/$(shell uname -r)/build
    96   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    97    KERN_DIR := /usr/src/linux
    98    ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    99     $(error Error: unable to find the sources of your current Linux kernel. \
    100                    Specify KERN_DIR=<directory> and run Make again)
    101    endif
    102    $(warning Warning: using /usr/src/linux as the source directory of your \
    103                       Linux kernel. If this is not correct, specify \
    104                       KERN_DIR=<directory> and run Make again.)
    105   endif
    106  else
    107   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    108    $(error Error: KERN_DIR does not point to a directory)
    109   endif
    110  endif
    111 
    112  # includes
    113  ifndef KERN_INCL
    114   KERN_INCL = $(KERN_DIR)/include
    115  endif
    116  ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
    117   $(error Error: unable to find the include directory for your current Linux \
    118                  kernel. Specify KERN_INCL=<directory> and run Make again)
    119  endif
    120 
    121  # module install dir, only for current kernel
    122  ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
    123   ifndef MODULE_DIR
    124    MODULE_DIR_TST := /lib/modules/$(shell uname -r)
    125    ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
    126     MODULE_DIR := $(MODULE_DIR_TST)/misc
    127    else
    128     $(error Unable to find the folder to install the support driver to)
    129    endif
    130   endif # MODULE_DIR unspecified
    131  endif
    132 
    133 else # neq($(KERNELRELEASE),)
    134 
    135  #
    136  # building from kbuild (make -C <kernel_directory> M=`pwd`)
    137  #
    138 
    139 endif # neq($(KERNELRELEASE),)
    140 
    141 # debug - show guesses.
    142 ifdef DEBUG
    143 $(warning dbg: KERN_DIR     = $(KERN_DIR))
    144 $(warning dbg: KERN_INCL    = $(KERN_INCL))
    145 $(warning dbg: MODULE_DIR   = $(MODULE_DIR))
    146 endif
    147 
    148 KBUILD_VERBOSE ?= 1
    149 
    150 #
    151 # Compiler options
    152 #
    153 ifndef INCL
    154  INCL    := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL))
    155  ifndef KBUILD_EXTMOD
    156   KBUILD_EXTMOD := $(shell pwd)
    157  endif
    158  INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
    159  INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxnetflt,/ /include /r0drv/linux)
    160  export INCL
    161 endif
    162 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt),)
    163  MANGLING := $(KBUILD_EXTMOD)/vboxnetflt/include/VBox/SUPDrvMangling.h
     41MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     42MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
     43        -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
     44        -Wno-declaration-after-statement
     45ifeq ($(BUILD_TARGET_ARCH),amd64)
     46 MOD_DEFS += -DRT_ARCH_AMD64
    16447else
    165  MANGLING := $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h
    166 endif
    167 KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
    168             -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
    169             -Wno-declaration-after-statement
    170 ifdef VBOX_REDHAT_KABI
    171  KFLAGS  += -DVBOX_REDHAT_KABI
    172 endif
    173 ifeq ($(BUILD_TARGET_ARCH),amd64)
    174  KFLAGS  += -DRT_ARCH_AMD64
    175 else
    176  KFLAGS  += -DRT_ARCH_X86
     48 MOD_DEFS += -DRT_ARCH_X86
    17749endif
    17850# must be consistent with Config.kmk!
    179 KFLAGS  += -DVBOX_WITH_64_BITS_GUESTS
    180 ifeq ($(BUILD_TYPE),debug)
    181  KFLAGS  += -DDEBUG -DDEBUG_$(USER) -g
    182  # IPRT_DEBUG_SEMS indicates thread wrt sems state via the comm field.
    183  #KFLAGS  += -DIPRT_DEBUG_SEMS
    184 endif
     51MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
    18552
    18653# By default we use remap_pfn_range() kernel API to make kernel pages
     
    19663endif
    19764
    198 MODULE_EXT    := ko
    199 $(MODULE)-y   := $(OBJS)
     65# build defs
     66MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
    20067
    201 # build defs
    202 EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-pie
    203 
    204 all: $(MODULE)
    205 
    206 obj-m += $(MODULE).o
    207 
    208 JOBS := $(shell (getconf _NPROCESSORS_ONLN || grep -Ec '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
    209 ifeq ($(JOBS),0)
    210   JOBS := 1
    211 endif
    212 
    213 # OL/UEK: disable module signing for external modules -- we don't have any private key
    214 $(MODULE):
    215         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) CONFIG_MODULE_SIG= -C $(KERN_DIR) -j$(JOBS) modules
    216 
    217 install: $(MODULE)
    218         @mkdir -p $(MODULE_DIR); \
    219         install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
    220         PATH="$(PATH):/bin:/sbin" depmod -a; \
    221         rm -f /etc/vbox/module_not_compiled
    222 
    223 install_rpm: $(MODULE)
    224         @mkdir -p $(MODULE_DIR); \
    225         install -m 0644 $(MODULE).$(MODULE_EXT) $(MODULE_DIR)
    226 
    227 else # eq ($(MAKECMDGOALS),clean)
    228 
    229  ifndef KERN_DIR
    230   KERN_DIR := /lib/modules/$(shell uname -r)/build
    231   ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    232    KERN_DIR := /usr/src/linux
    233   endif
    234  endif
    235  ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    236 
    237 clean:
    238         find . \( -name \*.o -o -name \*.cmd \) -print0 | xargs -0 rm -f
    239         rm -rf .tmp_ver* $(MODULE).* Module.symvers Modules.symvers modules.order
    240 
    241  else
    242 
    243 clean:
    244         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -C $(KERN_DIR) clean
    245 
    246  endif
    247 
    248 endif # eq($(MAKECMDGOALS),clean)
     68include $(obj)/Makefile.include.footer
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt

    r67295 r68682  
    7474    ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPR0IdcClientInternal.h=>SUPR0IdcClientInternal.h \
    7575    ${PATH_ROOT}/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c=>linux/SUPR0IdcClient-linux.c \
     76    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.footer=>Makefile.include.footer \
     77    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.header=>Makefile.include.header \
    7678    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/divdi3.c=>math/gcc/divdi3.c \
    7779    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/moddi3.c=>math/gcc/moddi3.c \
  • trunk/src/VBox/HostDrivers/VBoxPci/linux/Makefile

    r67293 r68682  
    11#
    22# Makefile for the VirtualBox Linux Host PCI Driver.
    3 # (For 2.6.x this file must be called 'Makefile'!)
    43#
    54
    65#
    76#
    8 # Copyright (C) 2011-2015 Oracle Corporation
     7# Copyright (C) 2011-2017 Oracle Corporation
    98#
    109# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1716#
    1817
    19 ## @todo If you make non-trivial changes to this make file, please consider
    20 #        rewriting it to use Makefile.include.header and
    21 #        Makefile.include.footer.
    22 
    23 #
    24 # First, figure out which architecture we're targeting and the build type.
    25 # (We have to support basic cross building (ARCH=i386|x86_64).)
    26 # While at it, warn about BUILD_* vars found to help with user problems.
    27 #
    28 ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
    29  BUILD_TARGET_ARCH_DEF := amd64
    30 else
    31  BUILD_TARGET_ARCH_DEF := x86
    32 endif
    33 ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
    34  $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
    35  BUILD_TARGET_ARCH :=
    36 endif
    37 ifeq ($(BUILD_TARGET_ARCH),)
    38  ifeq ($(ARCH),x86_64)
    39   BUILD_TARGET_ARCH := amd64
    40  else
    41   ifeq ($(ARCH),i386)
    42    BUILD_TARGET_ARCH := x86
    43   else
    44    BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
    45   endif
    46  endif
    47 else
    48  ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
    49   $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
    50  endif
    51 endif
    52 
    53 ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
    54  $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
    55  BUILD_TYPE :=
    56 endif
    57 ifeq ($(BUILD_TYPE),)
    58  BUILD_TYPE := release
    59 else
    60  ifneq ($(BUILD_TYPE),release)
    61   $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
    62  endif
    63 endif
     18# Linux kbuild sets this to our source directory if we are called from there
     19obj ?= $(CURDIR)
     20include $(obj)/Makefile.include.header
    6421
    6522# override is required by the Debian guys
    66 override MODULE = vboxpci
    67 OBJS  =                                \
     23MOD_NAME = vboxpci
     24MOD_OBJS =                              \
    6825        linux/VBoxPci-linux.o           \
    6926        VBoxPci.o                       \
     
    7330
    7431ifeq ($(BUILD_TARGET_ARCH),x86)
    75 OBJS += math/gcc/divdi3.o       \
     32MOD_OBJS += math/gcc/divdi3.o       \
    7633        math/gcc/moddi3.o       \
    7734        math/gcc/qdivrem.o      \
     
    8239endif
    8340
    84 ifneq ($(MAKECMDGOALS),clean)
    85 
    86 ifeq ($(KERNELRELEASE),)
    87 
    88  #
    89  # building from this directory
    90  #
    91 
    92  # kernel base directory
    93  ifndef KERN_DIR
    94  # build for the current kernel, version check
    95   KERN_DIR := /lib/modules/$(shell uname -r)/build
    96   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    97    KERN_DIR := /usr/src/linux
    98    ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    99     $(error Error: unable to find the sources of your current Linux kernel. \
    100                    Specify KERN_DIR=<directory> and run Make again)
    101    endif
    102    $(warning Warning: using /usr/src/linux as the source directory of your \
    103                       Linux kernel. If this is not correct, specify \
    104                       KERN_DIR=<directory> and run Make again.)
    105   endif
    106  else
    107   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    108    $(error Error: KERN_DIR does not point to a directory)
    109   endif
    110  endif
    111 
    112  # includes
    113  ifndef KERN_INCL
    114   KERN_INCL = $(KERN_DIR)/include
    115  endif
    116  ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
    117   $(error Error: unable to find the include directory for your current Linux \
    118                  kernel. Specify KERN_INCL=<directory> and run Make again)
    119  endif
    120 
    121  # module install dir, only for current kernel
    122  ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
    123   ifndef MODULE_DIR
    124    MODULE_DIR_TST := /lib/modules/$(shell uname -r)
    125    ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
    126     MODULE_DIR := $(MODULE_DIR_TST)/misc
    127    else
    128     $(error Unable to find the folder to install the support driver to)
    129    endif
    130   endif # MODULE_DIR unspecified
    131  endif
    132 
    133 else # neq($(KERNELRELEASE),)
    134 
    135  #
    136  # building from kbuild (make -C <kernel_directory> M=`pwd`)
    137  #
    138 
    139 endif # neq($(KERNELRELEASE),)
    140 
    141 # debug - show guesses.
    142 ifdef DEBUG
    143 $(warning dbg: KERN_DIR     = $(KERN_DIR))
    144 $(warning dbg: KERN_INCL    = $(KERN_INCL))
    145 $(warning dbg: MODULE_DIR   = $(MODULE_DIR))
    146 endif
    147 
    148 KBUILD_VERBOSE ?= 1
    149 
    150 #
    151 # Compiler options
    152 #
    153 ifndef INCL
    154  INCL    := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL))
    155  ifndef KBUILD_EXTMOD
    156   KBUILD_EXTMOD := $(shell pwd)
    157  endif
    158  INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
    159  INCL    += $(addprefix -I$(KBUILD_EXTMOD)/vboxpci,/ /include /r0drv/linux)
    160  export INCL
    161 endif
    162 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci),)
    163  MANGLING := $(KBUILD_EXTMOD)/vboxpci/include/VBox/SUPDrvMangling.h
     41MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     42MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
     43        -DRT_WITH_VBOX -DVBOX_WITH_HARDENING
     44ifeq ($(BUILD_TARGET_ARCH),amd64)
     45 MOD_DEFS  += -DRT_ARCH_AMD64
    16446else
    165  MANGLING := $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h
    166 endif
    167 KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
    168             -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING
    169 ifdef VBOX_REDHAT_KABI
    170  KFLAGS  += -DVBOX_REDHAT_KABI
    171 endif
    172 ifeq ($(BUILD_TARGET_ARCH),amd64)
    173  KFLAGS  += -DRT_ARCH_AMD64
    174 else
    175  KFLAGS  += -DRT_ARCH_X86
    176 endif
    177 # must be consistent with Config.kmk!
    178 KFLAGS  += -DVBOX_WITH_64_BITS_GUESTS
    179 ifeq ($(BUILD_TYPE),debug)
    180  KFLAGS  += -DDEBUG -DDEBUG_$(USER) -g
    181  # IPRT_DEBUG_SEMS indicates thread wrt sems state via the comm field.
    182  #KFLAGS  += -DIPRT_DEBUG_SEMS
     47 MOD_DEFS  += -DRT_ARCH_X86
    18348endif
    18449
     
    19257# concerns, not enabled by default yet.
    19358ifdef VBOX_USE_INSERT_PAGE
    194  KFLAGS += -DVBOX_USE_INSERT_PAGE
     59 MOD_DEFS += -DVBOX_USE_INSERT_PAGE
    19560endif
    19661
    197 MODULE_EXT    := ko
    198 $(MODULE)-y   := $(OBJS)
     62# build defs
     63MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
    19964
    200 # build defs
    201 EXTRA_CFLAGS  += -include $(MANGLING) $(INCL) $(KFLAGS) $(KDEBUG) -fno-pie
    202 
    203 all: $(MODULE)
    204 
    205 obj-m += $(MODULE).o
    206 
    207 JOBS := $(shell (getconf _NPROCESSORS_ONLN || grep -Ec '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
    208 ifeq ($(JOBS),0)
    209   JOBS := 1
    210 endif
    211 
    212 # OL/UEK: disable module signing for external modules -- we don't have any private key
    213 $(MODULE):
    214         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) CONFIG_MODULE_SIG= -C $(KERN_DIR) -j$(JOBS) modules
    215 
    216 install: $(MODULE)
    217         @mkdir -p $(MODULE_DIR); \
    218         install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
    219         PATH="$(PATH):/bin:/sbin" depmod -a;
    220 
    221 install_rpm: $(MODULE)
    222         @mkdir -p $(MODULE_DIR); \
    223         install -m 0644 $(MODULE).$(MODULE_EXT) $(MODULE_DIR)
    224 
    225 else # eq ($(MAKECMDGOALS),clean)
    226 
    227  ifndef KERN_DIR
    228   KERN_DIR := /lib/modules/$(shell uname -r)/build
    229   ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    230    KERN_DIR := /usr/src/linux
    231   endif
    232  endif
    233  ifeq ($(wildcard $(KERN_DIR)/Makefile),)
    234 
    235 clean:
    236         find . \( -name \*.o -o -name \*.cmd \) -print0 | xargs -0 rm -f
    237         rm -rf .tmp_ver* $(MODULE).* Module.symvers Modules.symvers modules.order
    238 
    239  else
    240 
    241 clean:
    242         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -C $(KERN_DIR) clean
    243 
    244  endif
    245 
    246 endif # eq($(MAKECMDGOALS),clean)
     65include $(obj)/Makefile.include.footer
  • trunk/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci

    r67295 r68682  
    7272    ${PATH_ROOT}/src/VBox/HostDrivers/Support/SUPR0IdcClientInternal.h=>SUPR0IdcClientInternal.h \
    7373    ${PATH_ROOT}/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c=>linux/SUPR0IdcClient-linux.c \
     74    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.footer=>Makefile.include.footer \
     75    ${PATH_ROOT}/src/VBox/Installer/linux/Makefile.include.header=>Makefile.include.header \
    7476    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/divdi3.c=>math/gcc/divdi3.c \
    7577    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/moddi3.c=>math/gcc/moddi3.c \
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