- Timestamp:
- Jan 29, 2008 4:03:17 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/Makefile.module
r6159 r6571 46 46 ifneq ($(MAKECMDGOALS),clean) 47 47 48 ifdef KDIR 49 # Debian kernel module build system 50 KERN_DIR := $(KDIR) 51 endif 48 ifeq ($(KERNELRELEASE),) 52 49 53 # kernel base directory 54 ifndef KERN_DIR 55 KERN_DIR := /lib/modules/$(shell uname -r)/build 56 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 57 KERN_DIR := /usr/src/linux 50 # 51 # building from this directory 52 # 53 54 # kernel base directory 55 ifndef KERN_DIR 56 KERN_DIR := /lib/modules/$(shell uname -r)/build 58 57 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 59 $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.) 58 KERN_DIR := /usr/src/linux 59 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 60 $(error Error: unable to find the sources of your current Linux kernel. \ 61 Specify KERN_DIR=<directory> and run Make again) 62 endif 63 $(warning Warning: using /usr/src/linux as the source directory of your \ 64 Linux kernel. If this is not correct, specify \ 65 KERN_DIR=<directory> and run Make again.) 60 66 endif 61 $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.) 67 else 68 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 69 $(error Error: KERN_DIR does not point to a directory) 70 endif 62 71 endif 63 else 64 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 65 $(error Error: KERN_DIR does not point to a directory.) 72 73 # includes 74 ifndef KERN_INCL 75 KERN_INCL = $(KERN_DIR)/include 66 76 endif 67 endif 77 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 78 $(error Error: unable to find the include directory for your current Linux \ 79 kernel. Specify KERN_INCL=<directory> and run Make again) 80 endif 68 81 69 # includes 70 ifndef KERN_INCL 71 KERN_INCL = $(KERN_DIR)/include 72 endif 73 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 74 $(error Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=<directory> and run Make again.) 75 endif 82 # module install dir. 83 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),) 84 ifndef MODULE_DIR 85 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 86 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 87 MODULE_DIR := $(MODULE_DIR_TST)/misc 88 else 89 $(error Unable to find the folder to install the additions driver to) 90 endif 91 endif # MODULE_DIR unspecified 92 endif 76 93 77 # module install dir. 78 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),) 79 ifndef MODULE_DIR 80 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 81 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 82 MODULE_DIR := $(MODULE_DIR_TST)/misc 83 else 84 $(error Unable to find the folder to install the additions driver to) 85 endif 86 endif # MODULE_DIR unspecified 87 endif 94 # guess kernel version (24 or 26) 95 ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes) 96 KERN_VERSION := 24 97 else 98 KERN_VERSION := 26 99 endif 100 # KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26) 101 102 else # neq($(KERNELRELEASE),) 88 103 89 # guess kernel version (24 or 26) 90 ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)91 KERN_VERSION := 24 92 else 93 KERN_VERSION := 2694 endif 95 # KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26)104 # 105 # building from Linux-2.6-kbuild (make -C <kernel_directory> M=`pwd`) 106 # 107 108 KERN_VERSION := 26 109 110 endif # neq($(KERNELRELEASE),) 96 111 97 112 # debug - show guesses. … … 108 123 # 109 124 ifndef INCL 110 INCL := -I$(KERN_INCL) $(addprefix -I,$(EXTRA_INCL))125 INCL := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL)) 111 126 ifndef KBUILD_EXTMOD 112 127 KBUILD_EXTMOD := $(shell pwd) -
trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module
r6159 r6571 44 44 ifneq ($(MAKECMDGOALS),clean) 45 45 46 ifdef KDIR 47 # Debian kernel module build system 48 KERN_DIR := $(KDIR) 49 endif 46 ifeq ($(KERNELRELEASE),) 50 47 51 # kernel base directory 52 ifndef KERN_DIR 53 KERN_DIR := /lib/modules/$(shell uname -r)/build 54 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 55 KERN_DIR := /usr/src/linux 48 # 49 # building from this directory 50 # 51 52 # kernel base directory 53 ifndef KERN_DIR 54 KERN_DIR := /lib/modules/$(shell uname -r)/build 56 55 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 57 $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.) 56 KERN_DIR := /usr/src/linux 57 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 58 $(error Error: unable to find the sources of your current Linux kernel. \ 59 Specify KERN_DIR=<directory> and run Make again) 60 endif 61 $(warning Warning: using /usr/src/linux as the source directory of your \ 62 Linux kernel. If this is not correct, specify \ 63 KERN_DIR=<directory> and run Make again.) 58 64 endif 59 $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.) 65 else 66 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 67 $(error Error: KERN_DIR does not point to a directory) 68 endif 60 69 endif 61 else 62 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 63 $(error Error: KERN_DIR does not point to a directory.) 70 71 # includes 72 ifndef KERN_INCL 73 KERN_INCL = $(KERN_DIR)/include 64 74 endif 65 endif 75 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 76 $(error Error: unable to find the include directory for your current Linux \ 77 kernel. Specify KERN_INCL=<directory> and run Make again) 78 endif 66 79 67 # includes 68 ifndef KERN_INCL 69 KERN_INCL = $(KERN_DIR)/include 70 endif 71 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 72 $(error Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=<directory> and run Make again.) 73 endif 80 # module install dir. 81 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),) 82 ifndef MODULE_DIR 83 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 84 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 85 MODULE_DIR := $(MODULE_DIR_TST)/misc 86 else 87 $(error Unable to find the folder to install the shared folders driver to) 88 endif 89 endif # MODULE_DIR unspecified 90 endif 74 91 75 # module install dir. 76 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),) 77 ifndef MODULE_DIR 78 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 79 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 80 MODULE_DIR := $(MODULE_DIR_TST)/misc 81 else 82 $(error Unable to find the folder to install the shared folders driver to) 83 endif 84 endif # MODULE_DIR unspecified 85 endif 92 # guess kernel version (24 or 26) 93 ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes) 94 KERN_VERSION := 24 95 else 96 KERN_VERSION := 26 97 endif 98 # KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26) 86 99 87 # guess kernel version (24 or 26) 88 ifeq ($(shell if grep '"2.4.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes) 89 KERN_VERSION := 24 90 else 91 KERN_VERSION := 26 92 endif 93 # KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26) 100 else # neq($(KERNELRELEASE),) 101 102 # 103 # building from Linux-2.6-kbuild (make -C <kernel_directory> M=`pwd`) 104 # 105 106 KERN_VERSION := 26 107 108 endif # neq($(KERNELRELEASE),) 94 109 95 110 # debug - show guesses. … … 106 121 # 107 122 ifndef INCL 108 INCL := -I$(KERN_INCL) $(addprefix -I,$(EXTRA_INCL))123 INCL := $(addprefix -I, $(KERN_INCL) $(EXTRA_INCL)) 109 124 ifndef KBUILD_EXTMOD 110 125 KBUILD_EXTMOD := $(shell pwd) -
trunk/src/VBox/HostDrivers/Support/linux/Makefile
r6530 r6571 105 105 ifneq ($(MAKECMDGOALS),clean) 106 106 107 ifdef KDIR 108 # Debian kernel module build system 109 KERN_DIR := $(KDIR) 110 endif 111 112 # kernel base directory 113 ifndef KERN_DIR 114 # build for the current kernel, version check 115 KERN_DIR := /lib/modules/$(shell uname -r)/build 116 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 117 KERN_DIR := /usr/src/linux 107 ifeq ($(KERNELRELEASE),) 108 109 # 110 # building from this directory 111 # 112 113 # kernel base directory 114 ifndef KERN_DIR 115 # build for the current kernel, version check 116 KERN_DIR := /lib/modules/$(shell uname -r)/build 118 117 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 119 $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.) 120 endif 121 $(warning Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again.) 122 endif 123 # check if versions match -- works only for later 2.6 kernels 124 VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) kernelrelease 2> /dev/null || true) 125 ifneq ($(VBOX_KERN_VER),) 126 ifneq ($(VBOX_KERN_VER),$(shell uname -r)) 127 $(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match the current kernel (version $(shell uname -r))) 128 endif 129 endif 130 else 131 # build for a dedicated kernel, no version check 132 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 133 $(error Error: KERN_DIR does not point to a directory.) 134 endif 135 endif 136 137 # includes 138 ifndef KERN_INCL 139 KERN_INCL = $(KERN_DIR)/include 140 endif 141 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 142 $(error Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=<directory> and run Make again.) 143 endif 144 145 # module install dir, only for current kernel 146 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),) 147 ifndef MODULE_DIR 148 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 149 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 150 MODULE_DIR := $(MODULE_DIR_TST)/misc 151 else 152 $(error Unable to find the folder to install the support driver to) 153 endif 154 endif # MODULE_DIR unspecified 155 endif 156 157 # guess kernel version (24 or 26) 158 KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26) 118 KERN_DIR := /usr/src/linux 119 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 120 $(error Error: unable to find the sources of your current Linux kernel. \ 121 Specify KERN_DIR=<directory> and run Make again) 122 endif 123 $(warning Warning: using /usr/src/linux as the source directory of your \ 124 Linux kernel. If this is not correct, specify \ 125 KERN_DIR=<directory> and run Make again.) 126 endif 127 # check if versions match -- works only for later 2.6 kernels 128 VBOX_KERN_VER := $(shell $(MAKE) -sC $(KERN_DIR) kernelrelease 2> /dev/null || true) 129 ifneq ($(VBOX_KERN_VER),) 130 ifneq ($(VBOX_KERN_VER),$(shell uname -r)) 131 $(error Error: /usr/src/linux (version $(VBOX_KERN_VER)) does not match \ 132 the current kernel (version $(shell uname -r))) 133 endif 134 endif 135 else 136 # build for a dedicated kernel, no version check 137 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 138 $(error Error: KERN_DIR does not point to a directory) 139 endif 140 endif 141 142 # includes 143 ifndef KERN_INCL 144 KERN_INCL = $(KERN_DIR)/include 145 endif 146 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 147 $(error Error: unable to find the include directory for your current Linux \ 148 kernel. Specify KERN_INCL=<directory> and run Make again) 149 endif 150 151 # module install dir, only for current kernel 152 ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),) 153 ifndef MODULE_DIR 154 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 155 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 156 MODULE_DIR := $(MODULE_DIR_TST)/misc 157 else 158 $(error Unable to find the folder to install the support driver to) 159 endif 160 endif # MODULE_DIR unspecified 161 endif 162 163 # guess kernel version (24 or 26) 164 KERN_VERSION := $(if $(wildcard $(KERN_DIR)/Rules.make),24,26) 165 166 else # neq($(KERNELRELEASE),) 167 168 # 169 # building from Linux-2.6-kbuild (make -C <kernel_directory> M=`pwd`) 170 # 171 172 KERN_VERSION := 26 173 174 endif # neq($(KERNELRELEASE),) 159 175 160 176 # debug - show guesses. … … 170 186 # 171 187 ifndef INCL 172 INCL := -I$(KERN_INCL) $(addprefix -I,$(EXTRA_INCL))188 INCL := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL)) 173 189 ifndef KBUILD_EXTMOD 174 190 KBUILD_EXTMOD := $(shell pwd)
Note:
See TracChangeset
for help on using the changeset viewer.