Changeset 68610 in vbox
- Timestamp:
- Sep 1, 2017 4:46:58 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 117834
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/linux/build_in_tmp
r68609 r68610 65 65 # make, cleanup if success 66 66 cd "$tmpdir" 67 if make "-j `echo ${MAKE_JOBS}`" "$@"; then # strip leading space from "MAKE_JOBS"67 if make "-j${MAKE_JOBS}" "$@"; then 68 68 if [ -n "$SAVE_MOD_SYMVERS" ]; then 69 69 if [ -f Module.symvers ]; then -
trunk/src/VBox/Installer/linux/Makefile.include.footer
r68609 r68610 18 18 override MODULE = $(MOD_NAME) 19 19 OBJS = $(MOD_OBJS) 20 21 ifneq ($(MAKECMDGOALS),clean) 20 22 21 23 KBUILD_VERBOSE ?= 1 … … 42 44 # 43 45 44 # Note: while 2.4 kernels could also do "proper" builds from kbuild, the make45 # script needed to support it was somewhat different from 2.6. Since this46 # script works and 2.4 is not a moving target we will not try do do things the47 # "proper" way.48 49 46 ifeq ($(BUILD_TARGET_ARCH),amd64) 50 47 KFLAGS += -mcmodel=kernel … … 62 59 $(MODULE): $(MODULE).o 63 60 64 install: $(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 70 clean: 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 74 else # ! $(KERN_VERSION), 24 61 else 75 62 # 76 63 # 2.6 and later … … 98 85 $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -j$(JOBS) modules 99 86 87 modules_install: 88 $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) modules_install 89 90 endif 91 100 92 install: $(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 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; 102 96 103 modules_install: install 104 all: install 97 endif # eq($(MAKECMDGOALS),clean) 105 98 106 99 clean: 107 $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) CONFIG_MODULE_SIG= -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) clean 108 109 .PHONY: $(MODULE) install modules_install clean 110 endif 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 -
trunk/src/VBox/Installer/linux/Makefile.include.header
r68609 r68610 16 16 17 17 # Testing: 18 # * Building with KERN_DIR set uses the value specified and 18 # * Building with KERN_VER set to an installed but non-current kernel works and 19 # installs to the right location. 20 # * Building with KERN_DIR and/or MODULE_DIR set uses the value specified and 19 21 # the default value for the unspecified one if any. 20 22 … … 33 35 # MOD_INCL = <any additional include paths which this module needs> 34 36 # MOD_CFLAGS = <any additional CFLAGS which this module needs> 37 # MOD_CLEAN = <list of directories that the clean target should look at> 35 38 # include $(obj)/Makefile.include.footer 36 39 # … … 84 87 endif 85 88 89 ifneq ($(MAKECMDGOALS),clean) 90 86 91 ifeq ($(KERNELRELEASE),) 87 92 … … 90 95 # 91 96 97 # target kernel version 98 ifndef KERN_VER 99 KERN_VER := $(shell uname -r) 100 else 101 ifneq ($(shell if test -d /lib/modules/$(KERN_VER)/build; then echo yes; fi),yes) 102 KERN_VER := $(shell uname -r) 103 endif 104 endif 105 92 106 # kernel base directory 93 107 ifndef KERN_DIR 94 KERN_DIR := /lib/modules/$( shell uname -r)/build108 KERN_DIR := /lib/modules/$(KERN_VER)/build 95 109 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 96 $(error Error: unable to find the sources of your current Linux kernel. \ 110 KERN_DIR := /usr/src/linux 111 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 112 $(error Error: unable to find the sources of your current Linux kernel. \ 97 113 Specify KERN_DIR=<directory> and run Make again) 114 endif 115 $(warning Warning: using /usr/src/linux as the source directory of your \ 116 Linux kernel. If this is not correct, specify \ 117 KERN_DIR=<directory> and run Make again.) 98 118 endif 99 119 else … … 105 125 # includes 106 126 ifndef KERN_INCL 107 KERN_INCL := $(KERN_DIR)/include127 KERN_INCL = $(KERN_DIR)/include 108 128 endif 109 129 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) … … 112 132 endif 113 133 114 # module install dir 115 INSTALL_MOD_DIR ?= misc 134 # module install dir, only for current kernel 135 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),) 136 ifndef MODULE_DIR 137 MODULE_DIR_TST := /lib/modules/$(KERN_VER) 138 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 139 MODULE_DIR := $(MODULE_DIR_TST)/misc 140 else 141 $(error Unable to find the folder to install the module to) 142 endif 143 endif # MODULE_DIR unspecified 144 endif 116 145 117 # guess kernel major version (24 or later)118 ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null 2>&1; then echo yes; fi),yes)146 # guess kernel version (24 or 26) 147 ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes) 119 148 KERN_VERSION := 24 120 149 else … … 135 164 endif 136 165 137 KERN_DIR := /lib/modules/$(KERNELRELEASE)/build138 KERN_INCL := $(KERN_DIR)/include139 140 166 endif # neq($(KERNELRELEASE),) 141 167 142 168 # debug - show guesses. 143 169 ifdef DEBUG 144 $(warning dbg: KERN_DIR = $(KERN_DIR)) 145 $(warning dbg: KERN_INCL = $(KERN_INCL)) 146 $(warning dbg: INSTALL_MOD_PATH = $(INSTALL_MOD_PATH)) 147 $(warning dbg: INSTALL_MOD_DIR = $(INSTALL_MOD_DIR)) 148 $(warning dbg: KERN_VERSION = $(KERN_VERSION)) 170 $(warning dbg: KERN_DIR = $(KERN_DIR)) 171 $(warning dbg: KERN_INCL = $(KERN_INCL)) 172 $(warning dbg: MODULE_DIR = $(MODULE_DIR)) 173 $(warning dbg: KERN_VERSION = $(KERN_VERSION)) 149 174 endif 175 176 endif # eq($(MAKECMDGOALS),clean)
Note:
See TracChangeset
for help on using the changeset viewer.