Changeset 87728 in vbox for trunk/src/VBox/HostDrivers/linux
- Timestamp:
- Feb 12, 2021 2:24:07 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/linux/Makefile
r85943 r87728 30 30 31 31 obj-m = vboxdrv/ 32 ifneq ($(wildcard $(CURDIR)/vboxnetflt/Makefile),)33 34 endif35 ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),)36 37 endif38 ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),)39 40 endif32 ifneq ($(wildcard $(CURDIR)/vboxnetflt/Makefile),) 33 obj-m += vboxnetflt/ 34 endif 35 ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),) 36 obj-m += vboxnetadp/ 37 endif 38 ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),) 39 obj-m += vboxpci/ 40 endif 41 41 42 42 else # ! KERNELRELEASE … … 45 45 46 46 KBUILD_VERBOSE ?= 47 KERN_VER ?= $(shell uname -r)48 47 .PHONY: all install clean check unload load \ 49 48 vboxdrv vboxnetflt vboxnetadp vboxpci \ … … 54 53 55 54 # We want to build on Linux 2.6.18 and later kernels. 56 ifneq ($(filter-out 1.% 2.0.% 2.1.% 2.2.% 2.3.% 2.4.% 2.5.%,$(KERN_VER)),) 55 KERN_VER ?= $(shell uname -r) 56 ifneq ($(filter-out 1.% 2.0.% 2.1.% 2.2.% 2.3.% 2.4.% 2.5.%,$(KERN_VER)),) 57 57 58 58 vboxdrv: … … 115 115 install: install-vboxdrv install-vboxnetflt install-vboxnetadp install-vboxpci 116 116 117 else 117 # Look for wrapper modules, sorting them so vmmr0 is first. 118 VBOX_WRAPPER_DIRS := $(notdir $(wildcard $(CURDIR)/vbox_*)) 119 ifneq ($(VBOX_WRAPPER_DIRS),) 120 VBOX_WRAPPER_DIRS := $(filter vbox_vmmr0,$(VBOX_WRAPPER_DIRS)) $(sort $(filter-out vbox_vmmr0,$(VBOX_WRAPPER_DIRS))) 121 endif 122 define wrapper_template 123 $(wrapper): $(subst $(wrapper),,vbox_vmmr0) 124 $$(MAKE) KBUILD_VERBOSE=$$(KBUILD_VERBOSE) -C $(wrapper)/ 125 126 load-$(wrapper): $(if $(eq $(wrapper),vbox_vmmr0),,load-vbox_vmmr0) 127 @if ! grep -q "^$(wrapper) " /proc/modules; then \ 128 echo "Loading $(wrapper)..."; \ 129 /sbin/insmod $(wrapper)/$(wrapper).ko; \ 130 else \ 131 echo "Skipping loading $(wrapper) module (already loaded)."; \ 132 fi 133 134 unload-$(wrapper): 135 @if grep -q "^$(wrapper) " /proc/modules; then \ 136 echo "Unloading $(wrapper)..."; \ 137 /sbin/rmmod $(wrapper)/$(wrapper).ko; \ 138 fi 139 endef 140 $(foreach wrapper,$(VBOX_WRAPPER_DIRS), $(eval $(wrapper_template))) 141 142 wrappers: $(VBOX_WRAPPER_DIRS) 143 load-wrappers: $(addprefix load-,$(VBOX_WRAPPER_DIRS)) 144 unload-wrappers: 145 @for module in $(filter-out vbox_vmmr0,$(VBOX_WRAPPER_DIRS)) $(filter vbox_vmmr0,$(VBOX_WRAPPER_DIRS)); \ 146 do \ 147 if grep -q "^$${module} " /proc/modules; then \ 148 echo "Unloading $${module}..."; \ 149 if \ 150 done 151 152 buildid: 153 @for module in $(foreach module,vboxdrv vboxnetflt vboxnetadp $(VBOX_WRAPPER_DIRS),$(module)/$(module).ko); \ 154 do \ 155 buildid=`readelf -n $${module} | sed -ne 's/^.*Build ID: *\([[:xdigit:]][[:xdigit:]]\)\(.*\)$$/\1\/\2/p' `; \ 156 if [ -n "$${buildid}" ]; then \ 157 mkdir -p ~/.debug/.build-id/`dirname $${buildid}`; \ 158 ln -sfn -- "$(CURDIR)/$${module}" ~/.debug/.build-id/$${buildid}; \ 159 else \ 160 echo "warning: No build ID for $${module}}"; \ 161 fi \ 162 done 163 164 .PHONY: wrappers load-wrappers unload-wrappers buildid $(VBOX_WRAPPER_DIRS) \ 165 $(addprefix load-,$(VBOX_WRAPPER_DIRS)) $(addprefix unload-,$(VBOX_WRAPPER_DIRS)) 166 167 else # Too old: 168 169 VBOX_WRAPPER_DIRS := 118 170 119 171 vboxdrv: … … 122 174 vboxpci: 123 175 install: 124 125 endif 176 wrappers: 177 load-wrappers: 178 unload-wrappers: 179 buildid-wrappers: 180 181 endif 126 182 127 183 clean-vboxdrv: … … 169 225 170 226 endif # ! KERNELRELEASE 227
Note:
See TracChangeset
for help on using the changeset viewer.