VirtualBox

Changeset 77400 in vbox


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

More linux kernel module Makefile cleanups: Seems MODULE is not a special variable to anyone but ourselves, so make it clear that it is ours and that it is only defined after the footer is included.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

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

    r77399 r77400  
    172172include $(obj)/Makefile-footer.gmk
    173173
    174 check: $(MODULE)
     174check: $(VBOXMOD_0_TARGET)
    175175        @if ! readelf -p __ksymtab_strings vboxdrv.ko | grep -E "\[.*\]  *(RT|g_..*RT.*)"; then \
    176176            echo "All exported IPRT symbols are properly renamed!"; \
  • trunk/src/VBox/Installer/linux/Makefile-footer.gmk

    r77399 r77400  
    1818#
    1919
    20 # override is required by the Debian guys
    21 override MODULE = $(VBOXMOD_NAME)
    22 OBJS = $(VBOXMOD_OBJS)
     20VBOXMOD_0_TARGET = $(VBOXMOD_NAME)
    2321
    2422KBUILD_VERBOSE ?= 1
     
    5048# 2.4
    5149#
    52 
    5350# Note: while 2.4 kernels could also do "proper" builds from kbuild, the make
    5451# script needed to support it was somewhat different from 2.6.  Since this
    5552# script works and 2.4 is not a moving target we will not try do do things the
    5653# "proper" way.
     54#
     55VBOXMOD_EXT := o
    5756
    5857ifeq ($(BUILD_TARGET_ARCH),amd64)
     
    6160
    6261CFLAGS := -O2 -DVBOX_LINUX_2_4 $(VBOXMOD_CFLAGS) $(VBOX_INCL) $(KFLAGS) $(KDEBUG)
    63 MODULE_EXT := o
    6462
    6563# 2.4 Module linking
    66 $(MODULE).$(MODULE_EXT): $(OBJS)
    67         $(LD) -o $@ -r $(OBJS)
     64$(VBOXMOD_0_TARGET).$(VBOXMOD_EXT): $(VBOXMOD_OBJS)
     65        $(LD) -o $@ -r $(VBOXMOD_OBJS)
    6866
    69 .PHONY: $(MODULE)
    70 all: $(MODULE)
    71 $(MODULE): $(MODULE).$(MODULE_EXT)
     67.PHONY: $(VBOXMOD_0_TARGET)
     68all: $(VBOXMOD_0_TARGET)
     69$(VBOXMOD_0_TARGET): $(VBOXMOD_0_TARGET).$(VBOXMOD_EXT)
    7270
    73 install: $(MODULE)
     71install: $(VBOXMOD_0_TARGET)
    7472        @mkdir -p $(MODULE_DIR); \
    75         install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
     73        install -m 0644 -o root -g root $(VBOXMOD_0_TARGET).$(VBOXMOD_EXT) $(MODULE_DIR); \
    7674        PATH="$(PATH):/bin:/sbin" depmod -a; sync
    7775
    7876clean:
    79         for f in $(sort $(dir $(OBJS))); do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
     77        for f in $(sort $(dir $(VBOXMOD_OBJS))); do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
    8078        rm -rf .$(VBOXMOD_NAME)* .tmp_ver* $(VBOXMOD_NAME).* Modules.symvers modules.order
    8179
     
    8381#
    8482# 2.6 and later
     83#
    8584## @todo XXX does not work for 2.6.5 and earlier (see KBUILD_EXTMOD in header).
    8685#
    87 
    88 MODULE_EXT := ko
    89 
    90 $(MODULE)-y  := $(OBJS)
     86VBOXMOD_EXT := ko
    9187
    9288# build defs
    9389EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(VBOX_INCL) $(KFLAGS) $(KDEBUG)
     90$(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS)
     91obj-m += $(VBOXMOD_0_TARGET).o
    9492
    95 .PHONY: $(MODULE)
    96 all: $(MODULE)
    97 
    98 obj-m += $(MODULE).o
    99 
     93# Trigger parallel make job.
    10094JOBS := $(shell (getconf _NPROCESSORS_ONLN || grep -Ec '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
    10195ifeq ($(JOBS),0)
    102   override JOBS := 1
     96 override JOBS := 1
    10397endif
    10498
     99# rules:
     100.PHONY: $(VBOXMOD_0_TARGET)
     101all: $(VBOXMOD_0_TARGET)
     102
    105103# OL/UEK: disable module signing for external modules -- we don't have any private key
    106 $(MODULE):
     104$(VBOXMOD_0_TARGET):
    107105        $(MAKE) V=$(LINUX_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) $(if $(JOBS),-j$(JOBS),) modules
    108106
    109 install: $(MODULE)
     107install: $(VBOXMOD_0_TARGET)
    110108        $(MAKE) V=$(LINUX_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install
    111109
     
    115113        $(MAKE) V=$(LINUX_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) clean
    116114
    117 .PHONY: $(MODULE) install modules_install clean
     115.PHONY: all $(VBOXMOD_0_TARGET) install modules_install clean
    118116endif
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