VirtualBox

Changeset 85939 in vbox


Ignore:
Timestamp:
Aug 28, 2020 6:36:30 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140134
Message:

Additions/linux/Makefile, HostDrivers/linux/Makefile: Many cleanups in the Linux kernel module Makefiles, making them more uniform, and allow install of individual modules. Additionally, allow building of the kernel modules straight from the respective subdirectory (no dependencies across directories, so vboxdrv/vboxguest still needs to be built first, otherwise you end up with undefined symbols). Finally some parallelization improvements. At the top level still uses the Module.symvers copying and somewhat quirky KBUILD_EXTRA_SYMBOLS pointing to the copy, because this is backwards compatible to before KBUILD_EXTRA_SYMBOLS was invented.

Location:
trunk/src/VBox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/Makefile

    r85404 r85939  
    6060        fi
    6161
    62 vboxvideo:
     62vboxvideo: vboxguest
    6363        + $(VBOX_QUIET_SH)if [ -d vboxvideo ]; then \
    6464            if [ -f vboxguest/Module.symvers ]; then \
     
    7575        fi
    7676
    77 install:
     77install_vboxguest:
    7878        + $(VBOX_QUIET)$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest install
     79
     80install_vboxsf:
    7981        + $(VBOX_QUIET_SH)if [ -d vboxsf ]; then \
    8082            $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxsf install; \
    8183        fi
     84
     85install_vboxvideo:
    8286        + $(VBOX_QUIET_SH)if [ -d vboxvideo ]; then \
    8387            $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvideo install; \
    8488        fi
    8589
    86 clean-vboxdrv:
     90install: install_vboxguest install_vboxsf install_vboxvideo
     91
     92clean_vboxguest:
    8793        + $(VBOX_QUIET)$(MAKE) -C vboxguest clean
     94        rm -f vboxguest.*o
    8895
    89 clean-vboxsf:
     96clean_vboxsf:
    9097        + $(VBOX_QUIET_SH)if [ -d vboxsf ]; then \
    9198            $(MAKE) -C vboxsf clean; \
    9299        fi
     100        rm -f vboxsf.*o
    93101
    94 clean-vboxvideo:
     102clean_vboxvideo:
    95103        + $(VBOX_QUIET_SH)if [ -d vboxvideo ]; then \
    96104            $(MAKE) -C vboxvideo clean; \
    97105        fi
     106        rm -f vboxvideo.*o
    98107
    99 clean-misc:
    100         rm -f vboxguest.*o vboxsf.*o vboxvideo.*o
    101 
    102 clean: clean-vboxdrv clean-vboxsf clean-vboxvideo clean-misc
     108clean: clean_vboxguest clean_vboxsf clean_vboxvideo
    103109
    104110check:
    105111        $(VBOX_QUIET)$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxguest check
    106112
    107 load:
     113unload:
    108114        $(VBOX_QUIET)/sbin/rmmod vboxvideo || true
    109115        $(VBOX_QUIET)/sbin/rmmod vboxvfs || true
    110116        $(VBOX_QUIET)/sbin/rmmod vboxsf || true
    111117        $(VBOX_QUIET)/sbin/rmmod vboxguest || true
     118
     119load: unload
    112120        $(VBOX_QUIET)/sbin/insmod vboxguest.ko
    113121        $(VBOX_QUIET)if [ -f vboxsf.ko ]; then /sbin/insmod vboxsf.ko; fi
    114122        $(VBOX_QUIET)if [ -f vboxvideo.ko ]; then /sbin/insmod vboxvideo.ko; fi
    115123
    116 .PHONY: vboxguest vboxsf vboxvideo all install clean check load
     124.PHONY: all install clean check unload load \
     125    vboxguest vboxsf vboxvideo \
     126    install_vboxguest install_vboxsf install_vboxvideo \
     127    clean_vboxguest clean_vboxsf clean_vboxvideo
    117128
    118129endif # ! KERNELRELEASE
  • trunk/src/VBox/Additions/linux/drm/Makefile.module.kms

    r82968 r85939  
    2222include $(obj)/Makefile-header.gmk
    2323VBOXDRM_DIR = $(VBOX_MODULE_SRC_DIR)
     24
     25# Allow building directly from the subdirectory without assuming the toplevel
     26# makefile has done the copying. Not the default use case, but can be handy.
     27ifndef KBUILD_EXTRA_SYMBOLS
     28KBUILD_EXTRA_SYMBOLS=$(abspath $(VBOXDRM_DIR)/../vboxguest/Module.symvers)
     29endif
    2430
    2531# We want to build on Linux 3.11 and later and on all EL 7 kernels.
  • trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module

    r84947 r85939  
    2222include $(obj)/Makefile-header.gmk
    2323VBOXSF_DIR = $(VBOX_MODULE_SRC_DIR)
     24
     25# Allow building directly from the subdirectory without assuming the toplevel
     26# makefile has done the copying. Not the default use case, but can be handy.
     27ifndef KBUILD_EXTRA_SYMBOLS
     28KBUILD_EXTRA_SYMBOLS=$(abspath $(VBOXSF_DIR)/../vboxguest/Module.symvers)
     29endif
    2430
    2531VBOXMOD_NAME = vboxsf
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r85523 r85939  
    2525#
    2626
    27 # Find the directory of this makefile.
    28 VBOXDRV_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
    29 
    3027# Linux kbuild sets this to our source directory if we are called from there
    3128obj ?= $(CURDIR)
    3229include $(obj)/Makefile-header.gmk
     30VBOXDRV_DIR := $(VBOX_MODULE_SRC_DIR)
    3331
    3432VBOXMOD_NAME = vboxdrv
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile

    r84947 r85939  
    2525#
    2626
    27 # Find the directory of this makefile.
    28 VBOXNETADPT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
    29 
    3027# Linux kbuild sets this to our source directory if we are called from there
    3128obj ?= $(CURDIR)
    3229include $(obj)/Makefile-header.gmk
     30VBOXNETADP_DIR := $(VBOX_MODULE_SRC_DIR)
     31
     32# Allow building directly from the subdirectory without assuming the toplevel
     33# makefile has done the copying. Not the default use case, but can be handy.
     34ifndef KBUILD_EXTRA_SYMBOLS
     35KBUILD_EXTRA_SYMBOLS=$(abspath $(VBOXNETADP_DIR)/../vboxdrv/Module.symvers)
     36endif
    3337
    3438VBOXMOD_NAME = vboxnetadp
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile

    r84947 r85939  
    2525#
    2626
    27 # Find the directory of this makefile.
    28 VBOXNETFLT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
    29 
    3027# Linux kbuild sets this to our source directory if we are called from there
    3128obj ?= $(CURDIR)
    3229include $(obj)/Makefile-header.gmk
     30VBOXNETFLT_DIR := $(VBOX_MODULE_SRC_DIR)
     31
     32# Allow building directly from the subdirectory without assuming the toplevel
     33# makefile has done the copying. Not the default use case, but can be handy.
     34ifndef KBUILD_EXTRA_SYMBOLS
     35KBUILD_EXTRA_SYMBOLS=$(abspath $(VBOXNETFLT_DIR)/../vboxdrv/Module.symvers)
     36endif
    3337
    3438VBOXMOD_NAME = vboxnetflt
  • trunk/src/VBox/HostDrivers/VBoxPci/linux/Makefile

    r84947 r85939  
    2525#
    2626
    27 # Find the directory of this makefile.
    28 VBOXPCI_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
    2927
    3028# Linux kbuild sets this to our source directory if we are called from there
    3129obj ?= $(CURDIR)
    3230include $(obj)/Makefile-header.gmk
     31VBOXPCI_DIR := $(VBOX_MODULE_SRC_DIR)
     32
     33# Allow building directly from the subdirectory without assuming the toplevel
     34# makefile has done the copying. Not the default use case, but can be handy.
     35ifndef KBUILD_EXTRA_SYMBOLS
     36KBUILD_EXTRA_SYMBOLS=$(abspath $(VBOXPCI_DIR)/../vboxdrv/Module.symvers)
     37endif
    3338
    3439# override is required by the Debian guys
  • trunk/src/VBox/HostDrivers/linux/Makefile

    r85404 r85939  
    4646KBUILD_VERBOSE ?=
    4747KERN_VER ?= $(shell uname -r)
    48 .PHONY: all install clean check unload load vboxdrv vboxnetflt vboxnetadp \
    49     vboxpci
     48.PHONY: all install clean check unload load \
     49    vboxdrv vboxnetflt vboxnetadp vboxpci \
     50    install_vboxdrv install_vboxnetflt install_vboxnetadp install_vboxpci \
     51    clean_vboxdrv clean_vboxnetflt clean_vboxnetadp clean_vboxpci
    5052
    5153all: vboxdrv vboxnetflt vboxnetadp vboxpci
     
    9395        fi
    9496
    95 install:
     97install_vboxdrv:
    9698        +@$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxdrv install
     99
     100install_vboxnetflt:
    97101        +@if [ -d vboxnetflt ]; then \
    98102            $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetflt install; \
    99103        fi
     104
     105install_vboxnetadp:
    100106        +@if [ -d vboxnetadp ]; then \
    101107            $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxnetadp install; \
    102108        fi
     109
     110install_vboxpci:
    103111        +@if [ -d vboxpci ]; then \
    104112            $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxpci install; \
    105113        fi
     114
     115install: install_vboxdrv install_vboxnetflt install_vboxnetadp install_vboxpci
    106116
    107117else
     
    115125endif
    116126
    117 clean:
     127clean_vboxdrv:
    118128        +@$(MAKE) -C vboxdrv clean
     129        rm -rf vboxdrv.ko
     130
     131clean_vboxnetflt:
    119132        +@if [ -d vboxnetflt ]; then \
    120133            $(MAKE) -C vboxnetflt clean; \
    121134        fi
     135        rm -rf vboxnetflt.ko
     136
     137clean_vboxnetadp:
    122138        +@if [ -d vboxnetadp ]; then \
    123139            $(MAKE) -C vboxnetadp clean; \
    124140        fi
     141        rm -rf vboxnetadp.ko
     142
     143clean_vboxpci:
    125144        +@if [ -d vboxpci ]; then \
    126145            $(MAKE) -C vboxpci clean; \
    127146        fi
    128         rm -f vboxdrv.ko vboxnetflt.ko vboxnetadp.ko vboxpci.ko
     147        rm -f vboxpci.ko
     148
     149clean: clean_vboxdrv clean_vboxnetflt clean_vboxnetadp clean_vboxpci
    129150
    130151check:
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