VirtualBox

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


Ignore:
Timestamp:
Aug 28, 2020 6:36:30 PM (4 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/Additions/linux
Files:
3 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
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