VirtualBox

Changeset 77393 in vbox for trunk/src/VBox/Additions/linux


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

More linux kernel module Makefile cleansup.

Location:
trunk/src/VBox/Additions/linux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/Makefile.module.kms

    r77390 r77393  
    1818#
    1919
     20# Find the directory of this makefile.
     21VBOXDRM_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
     22
    2023# Linux kbuild sets this to our source directory if we are called from there
    2124obj ?= $(CURDIR)
    2225include $(obj)/Makefile-header.gmk
    2326
    24 BUILD =
    25 
    2627# We want to build on Linux 3.11 and later and on all EL 7 kernels.
    27 ifneq ($(filter-out 1.% 2.% 3.0.% 3.1.% 3.2.% 3.3.% 3.4.% 3.5.% 3.6.% 3.7.% \
    28                     3.8.% 3.9.% 3.10.%,$(KERN_VER)),)
    29  BUILD = 1
     28VBOX_BUILD =
     29ifneq ($(filter-out 1.% 2.% 3.0.% 3.1.% 3.2.% 3.3.% 3.4.% 3.5.% 3.6.% 3.7.% 3.8.% 3.9.% 3.10.%,$(KERN_VER)),)
     30 VBOX_BUILD = 1
    3031endif
    3132ifeq ($(filter-out %.el7.x86_64,$(KERN_VER)),)
    32  BUILD = 1
     33 VBOX_BUILD = 1
    3334endif
    3435
    35 ifneq ($(BUILD),)
     36ifneq ($(VBOX_BUILD),)
    3637
    37 MOD_NAME   = vboxvideo
    38 MOD_OBJS   = hgsmi_base.o \
    39              modesetting.o vbox_drv.o vbox_fb.o vbox_irq.o vbox_main.o \
    40              vbox_mode.o vbox_ttm.o vbva_base.o vbox_prime.o vbox_hgsmi.o
    41 MOD_INCL   = -I$(KBUILD_EXTMOD) -Iinclude/drm
     38MOD_NAME = vboxvideo
     39MOD_OBJS = \
     40        hgsmi_base.o \
     41        modesetting.o \
     42        vbox_drv.o \
     43        vbox_fb.o \
     44        vbox_irq.o \
     45        vbox_main.o \
     46        vbox_mode.o \
     47        vbox_ttm.o \
     48        vbva_base.o \
     49        vbox_prime.o \
     50        vbox_hgsmi.o
     51MOD_INCL = \
     52        -I$(VBOXDRM_DIR) \
     53        -Iinclude/drm
     54## @todo r=bird: -Iinclude/drm is ambigious.
    4255
    4356include $(obj)/Makefile-footer.gmk
    4457
    45 else  # ! wildcard $(KERN_INCL)/drm/drm_rect.h
     58else  # !VBOX_BUILD
    4659
    4760 all:
     
    4962 clean:
    5063
    51 endif  # ! wildcard $(KERN_INCL)/drm/drm_rect.h
     64endif # !VBOX_BUILD
     65
  • trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module

    r77390 r77393  
    4848        qdivrem.o
    4949endif
    50 
    51 MOD_INCL = -I$(VBOXSF_DIR) -I$(VBOXSF_DIR)include -I$(VBOXSF_DIR)r0drv/linux -I`pwd` -I`pwd`
    52 
    53 MOD_DEFS   = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DVBOX_WITH_HGCM -DIN_MODULE -DIN_GUEST -DIN_GUEST_R0
    54 # our module does not export any symbol
    55 MOD_DEFS  += -DRT_NO_EXPORT_SYMBOL
     50MOD_INCL = \
     51        -I$(VBOXSF_DIR) \
     52        -I$(VBOXSF_DIR)include \
     53        -I$(VBOXSF_DIR)r0drv/linux
     54MOD_DEFS = \
     55        -DRT_OS_LINUX \
     56        -DIN_RING0 \
     57        -DIN_RT_R0 \
     58        -DIN_SUP_R0 \
     59        -DVBOX \
     60        -DVBOX_WITH_HGCM \
     61        -DIN_MODULE \
     62        -DIN_GUEST \
     63        -DIN_GUEST_R0 \
     64        -DRT_NO_EXPORT_SYMBOL
    5665ifeq ($(BUILD_TARGET_ARCH),amd64)
    57  MOD_DEFS += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
     66MOD_DEFS += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
    5867else
    59  MOD_DEFS += -DRT_ARCH_X86
     68MOD_DEFS += -DRT_ARCH_X86
     69endif
     70ifeq ($(KERN_VERSION),24)
     71MOD_CFLAGS =
     72else
     73MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(VBOXSF_DIR)/include/VBox/VBoxGuestMangling.h -fno-pie
     74endif
     75ifdef VBOX_NO_OMIT_FRAME_POINTER
     76MOD_CFLAGS += -fno-omit-frame-pointer
    6077endif
    6178
    62 ifeq ($(KERN_VERSION), 24)
    63  MOD_CFLAGS =
    64 else
    65  MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(VBOXSF_DIR)/include/VBox/VBoxGuestMangling.h -fno-pie
    66 
     79ifneq ($(KERN_VERSION),24)
    6780# special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
    6881# ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
    6982 ifeq ($(KERNELRELEASE),)
    70   MOD_EXTRA += $(foreach inc,$(KERN_INCL),\
    71               $(if $(wildcard $(inc)/linux/utsrelease.h),\
    72                 $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
    73                             grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
    74                             grep '"2.6.18.*v5.*"'  $(inc)/linux/utsrelease.h; \
    75                             grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
    76                 -DKERNEL_FC6,),))
     83MOD_EXTRA += $(foreach inc,$(KERN_INCL),\
     84               $(if $(wildcard $(inc)/linux/utsrelease.h),\
     85                 $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
     86                              grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
     87                              grep '"2.6.18.*v5.*"'  $(inc)/linux/utsrelease.h; \
     88                              grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
     89                   -DKERNEL_FC6,),))
    7790 else
    78   MOD_EXTRA += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
    79                         echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
    80                         echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
    81                         echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
     91MOD_EXTRA += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
     92                          echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
     93                          echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
     94                          echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
    8295                -DKERNEL_FC6,)
    8396 endif
    84 endif
    85 ifdef VBOX_NO_OMIT_FRAME_POINTER
    86  MOD_CFLAGS += -fno-omit-frame-pointer
    8797endif
    8898
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