VirtualBox

Ignore:
Timestamp:
Sep 5, 2017 9:48:21 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117857
Message:

Linux driver make files: clean up.
bugref:4567: Linux kernel driver maintenance

Simplify the Makefile.include.header and .footer templates and remove some
content which was either no longer relevant or perhaps never really needed.
Also make a small fix to build_in_tmp which sometimes caused it to fail on
Linux 2.4-based systems (that is, CentOS 3). Second attempt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/Makefile.include.footer

    r68610 r68627  
    1818override MODULE = $(MOD_NAME)
    1919OBJS   = $(MOD_OBJS)
    20 
    21 ifneq ($(MAKECMDGOALS),clean)
    2220
    2321KBUILD_VERBOSE ?= 1
     
    4442#
    4543
     44# Note: while 2.4 kernels could also do "proper" builds from kbuild, the make
     45# script needed to support it was somewhat different from 2.6.  Since this
     46# script works and 2.4 is not a moving target we will not try do do things the
     47# "proper" way.
     48
    4649ifeq ($(BUILD_TARGET_ARCH),amd64)
    4750 KFLAGS  += -mcmodel=kernel
     
    5962$(MODULE): $(MODULE).o
    6063
    61 else
     64install: $(MODULE)
     65        @mkdir -p $(MODULE_DIR); \
     66        install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) \
     67        $(INSTALL_MOD_PATH)/$(KERN_DIR)/$(INSTALL_MOD_DIR); \
     68        PATH="$(PATH):/bin:/sbin" depmod -a;
     69
     70clean:
     71        for f in $(sort $(dir $(OBJS))); do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
     72        rm -rf .$(MOD_NAME)* .tmp_ver* $(MOD_NAME).* Modules.symvers modules.order
     73
     74else  # ! $(KERN_VERSION), 24
    6275#
    6376# 2.6 and later
     
    8598        $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -j$(JOBS) modules
    8699
    87 modules_install:
    88         $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) modules_install
     100install: $(MODULE)
     101        $(MAKE) KBUILD_VERBOSE=$(KBUILD_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
    89102
    90 endif
    91 
    92 install: $(MODULE)
    93         @mkdir -p $(MODULE_DIR); \
    94         install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
    95         PATH="$(PATH):/bin:/sbin" depmod -a;
    96 
    97 endif # eq($(MAKECMDGOALS),clean)
     103modules_install: install
    98104
    99105clean:
    100         for f in $(MOD_CLEAN); do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
    101         rm -rf .$(MOD_NAME)* .tmp_ver* $(MOD_NAME).* Modules.symvers modules.order
     106        $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) clean
     107
     108.PHONY: $(MODULE) install modules_install clean
     109endif
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