VirtualBox

Changeset 77394 in vbox for trunk/src


Ignore:
Timestamp:
Feb 20, 2019 4:27:55 PM (6 years ago)
Author:
vboxsync
Message:

More linux kernel module Makefile cleansup.

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

Legend:

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

    r77390 r77394  
    2525#
    2626
    27 # Linux kbuild sets this to our source directory if we are called from
    28 # there
     27# Find the directory of this makefile.
     28VBOXDRV_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
     29
     30# Linux kbuild sets this to our source directory if we are called from there
    2931obj ?= $(CURDIR)
    3032include $(obj)/Makefile-header.gmk
     
    119121        VBox/log-vbox.o
    120122ifeq ($(BUILD_TARGET_ARCH),x86)
    121  MOD_OBJS += math/gcc/divdi3.o \
     123MOD_OBJS += \
     124        math/gcc/divdi3.o \
    122125        math/gcc/moddi3.o \
    123126        math/gcc/qdivrem.o \
     
    128131endif
    129132ifeq ($(BUILD_TARGET_ARCH),amd64)
    130  MOD_OBJS += common/alloc/heapsimple.o
     133MOD_OBJS += common/alloc/heapsimple.o
    131134endif
    132135ifdef VBOX_WITH_NATIVE_DTRACE
    133  MOD_OBJS += SUPDrvDTrace.o
     136MOD_OBJS += SUPDrvDTrace.o
    134137endif
    135 
    136 MOD_INCL  = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     138MOD_INCL  = \
     139        -I$(VBOXDRV_DIR) \
     140        -I$(VBOXDRV_DIR)include \
     141        -I$(VBOXDRV_DIR)r0drv/linux
    137142ifdef VBOX_WITH_NATIVE_DTRACE
    138  MOD_INCL += -I/usr/include/linux -I/usr/include
     143MOD_INCL += \
     144        -I/usr/include/linux \
     145        -I/usr/include
    139146endif
    140 MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
    141         -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER \
    142         -DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITH_EFLAGS_AC_PRESERVING \
    143     -Wno-declaration-after-statement
     147MOD_DEFS = \
     148        -DRT_OS_LINUX \
     149        -DIN_RING0 \
     150        -DIN_RT_R0 \
     151        -DIN_SUP_R0 \
     152        -DVBOX \
     153        -DRT_WITH_VBOX \
     154        -DVBOX_WITH_HARDENING \
     155        -DSUPDRV_WITH_RELEASE_LOGGER \
     156        -DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV \
     157        -DIPRT_WITH_EFLAGS_AC_PRESERVING \
     158        -DVBOX_WITH_64_BITS_GUESTS # <-- must be consistent with Config.kmk!
    144159ifndef CONFIG_VBOXDRV_FIXEDMAJOR
    145  MOD_DEFS += -DCONFIG_VBOXDRV_AS_MISC
     160MOD_DEFS += -DCONFIG_VBOXDRV_AS_MISC
    146161endif
    147162ifdef VBOX_WITH_NATIVE_DTRACE
    148  MOD_DEFS += -DVBOX_WITH_NATIVE_DTRACE
     163MOD_DEFS += -DVBOX_WITH_NATIVE_DTRACE
    149164endif
    150165ifeq ($(BUILD_TARGET_ARCH),amd64)
    151  MOD_DEFS += -DRT_ARCH_AMD64
     166MOD_DEFS += -DRT_ARCH_AMD64
    152167else
    153  MOD_DEFS += -DRT_ARCH_X86
     168MOD_DEFS += -DRT_ARCH_X86
    154169endif
    155 # must be consistent with Config.kmk!
    156 MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
    157170ifdef VBOX_WITH_TEXT_MODMEM_HACK
    158  MOD_DEFS += -DRTMEMALLOC_EXEC_HEAP -DVBOX_WITH_TEXT_MODMEM_HACK
     171MOD_DEFS += -DRTMEMALLOC_EXEC_HEAP -DVBOX_WITH_TEXT_MODMEM_HACK
    159172endif
     173MOD_CFLAGS = -include $(VBOXDRV_DIR)include/VBox/SUPDrvMangling.h \
     174        -fno-omit-frame-pointer -fno-pie -Wno-declaration-after-statement
    160175
    161 # build defs
    162 MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h \
    163         -fno-omit-frame-pointer -fno-pie
    164176
    165177include $(obj)/Makefile-footer.gmk
     
    172184            false; \
    173185         fi
     186
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile

    r77390 r77394  
    1 #
     1# $Id$
     2## @file
    23# Makefile for the VirtualBox Linux Host Virtual Network Adapter Driver.
    34#
     
    2425#
    2526
     27# Find the directory of this makefile.
     28VBOXNETADPT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
     29
    2630# Linux kbuild sets this to our source directory if we are called from there
    2731obj ?= $(CURDIR)
    2832include $(obj)/Makefile-header.gmk
    2933
    30 # override is required by the Debian guys
    3134MOD_NAME = vboxnetadp
    3235MOD_OBJS = \
     
    3437        VBoxNetAdp.o
    3538ifeq ($(BUILD_TARGET_ARCH),x86)
    36 MOD_OBJS += math/gcc/divdi3.o \
     39MOD_OBJS += \
     40        math/gcc/divdi3.o \
    3741        math/gcc/moddi3.o \
    3842        math/gcc/qdivrem.o \
    3943        math/gcc/udivdi3.o \
    4044        math/gcc/udivmoddi4.o \
    41         math/gcc/divdi3.o \
     45        math/gcc/divdi3.o \
    4246        math/gcc/umoddi3.o
    4347endif
    44 
    45 MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
    46 MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
    47             -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
    48             -Wno-declaration-after-statement
     48MOD_INCL = \
     49        -I$(VBOXNETADPT_DIR) \
     50        -I$(VBOXNETADPT_DIR)include \
     51        -I$(VBOXNETADPT_DIR)r0drv/linux
     52MOD_DEFS = \
     53        -DRT_OS_LINUX \
     54        -DIN_RING0 \
     55        -DIN_RT_R0 \
     56        -DIN_SUP_R0 \
     57        -DVBOX \
     58        -DRT_WITH_VBOX \
     59        -DVBOX_WITH_HARDENING
    4960ifeq ($(BUILD_TARGET_ARCH),amd64)
    5061 MOD_DEFS += -DRT_ARCH_AMD64
     
    5263 MOD_DEFS += -DRT_ARCH_X86
    5364endif
    54 # must be consistent with Config.kmk!
    55 MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
    56 
    57 # By default we use remap_pfn_range() kernel API to make kernel pages
    58 # visible for userland. Unfortunately, it leads to situation that
    59 # during debug session all structures on that page (such as PVM pointer)
    60 # are not accessible to the debugger (see #3214).
    61 # This code enables experimental support
    62 # for vm_insert_page() kernel API, allowing to export kernel pages
    63 # to the userland in more debugger-friendly way. Due to stability
    64 # concerns, not enabled by default yet.
    65 ifdef VBOX_USE_INSERT_PAGE
    66  KFLAGS  += -DVBOX_USE_INSERT_PAGE
    67 endif
    68 
    69 # build defs
    70 MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
     65MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS # <-- must be consistent with Config.kmk!
     66MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement
    7167
    7268include $(obj)/Makefile-footer.gmk
     69
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile

    r77390 r77394  
    1 #
     1# $Id$
     2## @file
    23# Makefile for the VirtualBox Linux Host Network Filter Driver.
    34#
     
    2425#
    2526
    26 # Linux kbuild sets this to our source directory if we are called from
    27 # there
     27# Find the directory of this makefile.
     28VBOXNETFLT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
     29
     30# Linux kbuild sets this to our source directory if we are called from there
    2831obj ?= $(CURDIR)
    2932include $(obj)/Makefile-header.gmk
     
    3639        SUPR0IdcClientComponent.o \
    3740        linux/SUPR0IdcClient-linux.o
    38 
    3941ifeq ($(BUILD_TARGET_ARCH),x86)
    40 MOD_OBJS += math/gcc/divdi3.o \
     42MOD_OBJS += \
     43        math/gcc/divdi3.o \
    4144        math/gcc/moddi3.o \
    4245        math/gcc/qdivrem.o \
    4346        math/gcc/udivdi3.o \
    4447        math/gcc/udivmoddi4.o \
    45         math/gcc/divdi3.o \
     48        math/gcc/divdi3.o \
    4649        math/gcc/umoddi3.o
    4750endif
    48 
    49 MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
    50 MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
    51         -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
    52         -Wno-declaration-after-statement
     51MOD_INCL = \
     52        -I$(VBOXNETFLT_DIR) \
     53        -I$(VBOXNETFLT_DIR)include \
     54        -I$(VBOXNETFLT_DIR)r0drv/linux
     55MOD_DEFS = \
     56        -DRT_OS_LINUX \
     57        -DIN_RING0 \
     58        -DIN_RT_R0 \
     59        -DIN_SUP_R0 \
     60        -DVBOX \
     61        -DRT_WITH_VBOX \
     62        -DVBOX_WITH_HARDENING \
     63        -DVBOX_WITH_64_BITS_GUESTS # <-- must be consistent with Config.kmk!
    5364ifeq ($(BUILD_TARGET_ARCH),amd64)
    54  MOD_DEFS += -DRT_ARCH_AMD64
     65MOD_DEFS += -DRT_ARCH_AMD64
    5566else
    56  MOD_DEFS += -DRT_ARCH_X86
     67MOD_DEFS += -DRT_ARCH_X86
    5768endif
    58 # must be consistent with Config.kmk!
    59 MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
    60 
    61 # By default we use remap_pfn_range() kernel API to make kernel pages
    62 # visible for userland. Unfortunately, it leads to situation that
    63 # during debug session all structures on that page (such as PVM pointer)
    64 # are not accessible to the debugger (see #3214).
    65 # This code enables experimental support
    66 # for vm_insert_page() kernel API, allowing to export kernel pages
    67 # to the userland in more debugger-friendly way. Due to stability
    68 # concerns, not enabled by default yet.
    69 ifdef VBOX_USE_INSERT_PAGE
    70  KFLAGS  += -DVBOX_USE_INSERT_PAGE
    71 endif
    72 
    73 # build defs
    74 MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
     69MOD_CFLAGS = -include $(VBOXNETFLT_DIR)include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement
    7570
    7671include $(obj)/Makefile-footer.gmk
     72
  • trunk/src/VBox/HostDrivers/VBoxPci/linux/Makefile

    r77390 r77394  
    1 #
     1# $Id$
     2## @file
    23# Makefile for the VirtualBox Linux Host PCI Driver.
    34#
     
    2425#
    2526
     27# Find the directory of this makefile.
     28VBOXPCI_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
     29
    2630# Linux kbuild sets this to our source directory if we are called from there
    2731obj ?= $(CURDIR)
     
    3034# override is required by the Debian guys
    3135MOD_NAME = vboxpci
    32 MOD_OBJS =                              \
    33         linux/VBoxPci-linux.o           \
    34         VBoxPci.o                       \
    35         SUPR0IdcClient.o                \
    36         SUPR0IdcClientComponent.o       \
    37         linux/SUPR0IdcClient-linux.o
    38 
     36MOD_OBJS = \
     37        linux/VBoxPci-linux.o \
     38        VBoxPci.o \
     39        SUPR0IdcClient.o \
     40        SUPR0IdcClientComponent.o \
     41        linux/SUPR0IdcClient-linux.o
    3942ifeq ($(BUILD_TARGET_ARCH),x86)
    40 MOD_OBJS += math/gcc/divdi3.o       \
    41         math/gcc/moddi3.o       \
    42         math/gcc/qdivrem.o      \
    43         math/gcc/udivdi3.o      \
    44         math/gcc/udivmoddi4.o   \
    45         math/gcc/divdi3.o       \
     43MOD_OBJS += \
     44        math/gcc/divdi3.o \
     45        math/gcc/moddi3.o \
     46        math/gcc/qdivrem.o \
     47        math/gcc/udivdi3.o \
     48        math/gcc/udivmoddi4.o \
     49        math/gcc/divdi3.o \
    4650        math/gcc/umoddi3.o
    4751endif
    48 
    49 MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
    50 MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX \
    51         -DRT_WITH_VBOX -DVBOX_WITH_HARDENING
     52MOD_INCL = \
     53        -I$(VBOXPCI_DIR) \
     54        -I$(VBOXPCI_DIR)include \
     55        -I$(VBOXPCI_DIR)r0drv/linux
     56MOD_DEFS = \
     57        -DRT_OS_LINUX \
     58        -DIN_RING0 \
     59        -DIN_RT_R0 \
     60        -DIN_SUP_R0 \
     61        -DVBOX \
     62        -DRT_WITH_VBOX \
     63        -DVBOX_WITH_HARDENING
    5264ifeq ($(BUILD_TARGET_ARCH),amd64)
    53  MOD_DEFS += -DRT_ARCH_AMD64
     65MOD_DEFS += -DRT_ARCH_AMD64
    5466else
    55  MOD_DEFS += -DRT_ARCH_X86
     67MOD_DEFS += -DRT_ARCH_X86
    5668endif
    57 
    58 # By default we use remap_pfn_range() kernel API to make kernel pages
    59 # visible for userland. Unfortunately, it leads to situation that
    60 # during debug session all structures on that page (such as PVM pointer)
    61 # are not accessible to the debugger (see #3214).
    62 # This code enables experimental support
    63 # for vm_insert_page() kernel API, allowing to export kernel pages
    64 # to the userland in more debugger-friendly way. Due to stability
    65 # concerns, not enabled by default yet.
    66 ifdef VBOX_USE_INSERT_PAGE
    67  MOD_DEFS += -DVBOX_USE_INSERT_PAGE
    68 endif
    69 
    70 # build defs
    71 MOD_CFLAGS = -include $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h -fno-pie
     69MOD_CFLAGS = -include $(VBOXPCI_DIR)include/VBox/SUPDrvMangling.h -fno-pie
    7270
    7371include $(obj)/Makefile-footer.gmk
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