Changeset 68610 in vbox for trunk/src/VBox/Installer/linux/Makefile.include.header
- Timestamp:
- Sep 1, 2017 4:46:58 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.