VirtualBox

Ignore:
Timestamp:
Aug 28, 2020 6:36:30 PM (4 years ago)
Author:
vboxsync
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.

File:
1 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
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