Changeset 971 in vbox for trunk/src/VBox/Additions/linux/module
- Timestamp:
- Feb 19, 2007 10:22:54 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/Makefile.module
r719 r971 36 36 r0drv/linux/semaphore-r0drv-linux.o 37 37 38 # 39 # Where is everything? 40 # 41 ifeq ($(KERN_DIR),) 42 KERN_DIR_CUR := /lib/modules/$(shell uname -r)/build 43 ifeq ($(shell if test -d $(KERN_DIR_CUR); then echo yes; fi),yes) 44 KERN_DIR := $(KERN_DIR_CUR) 38 ifneq ($(MAKECMDGOALS),clean) 39 40 # kernel base directory 41 ifndef $(KERN_DIR) 42 KERN_DIR := /lib/modules/$(shell uname -r)/build 43 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 44 KERN_DIR := /usr/src/linux 45 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 46 $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.) 47 endif 48 $(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.) 49 endif 45 50 else 46 KERN_DIR = /usr/src/linux 47 $(warning Warning: defaulting kernel sources to $(KERN_DIR). Specify KERN_DIR=<right-place> if this is not right.)48 endif51 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 52 $(error Error: KERN_DIR does not point to a directory.) 53 endif 49 54 endif 50 55 51 56 # includes 52 ifeq ($(KERN_INCL),) 53 ifeq ($(shell if test -d $(KERN_DIR)/include; then echo yes; fi),yes) 57 ifndef $(KERN_INCL) 54 58 KERN_INCL = $(KERN_DIR)/include 55 # Instead of sticking to the standards, OpenSUSE 10.2 only puts a few include 56 # files in /lib/modules/$(uname -r)/build/include, and puts the rest in 57 # /lib/modules/$(uname -r)/source/include, which points into the kernel sources 58 EXTRA_INCL = /lib/modules/$(shell uname -r)/source/include 59 else 60 KERN_INCL = /usr/src/linux/include 61 $(warning Warning: defaulting to the includes in $(KERN_INCL). Specify KERN_INCL=<right-place> if this is not right.) 62 endif 59 endif 60 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 61 $(error Error: unable to find the include directory for your current Linux kernel. Specify $KERN_INCL=<directory> and run Make again.) 63 62 endif 64 63 65 # Module install dir.64 # module install dir. 66 65 ifndef MODULE_DIR 67 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 68 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 69 MODULE_DIR := $(MODULE_DIR_TST)/misc 70 else 71 # MODULE_DIR := . 72 $(error Unable to find the folder to install the additions driver to) 73 endif 66 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 67 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 68 MODULE_DIR := $(MODULE_DIR_TST)/misc 69 else 70 $(error Unable to find the folder to install the additions driver to) 71 endif 74 72 endif # MODULE_DIR unspecified 75 73 … … 99 97 KBUILD_EXTMOD := $(shell pwd) 100 98 endif 101 INCL += $(addprefix -I$(KBUILD_EXTMOD),/ 99 INCL += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux) 102 100 export INCL 103 101 endif 104 KFLAGS := -D__KERNEL__ -DMODULE -D__LINUX__ -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 -DVBGL_VBOXGUEST -DVBGL_HGCM -DVBOX_HGCM -DLOG_TO_BACKDOOR 102 KFLAGS := -D__KERNEL__ -DMODULE -D__LINUX__ -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 \ 103 -DVBGL_VBOXGUEST -DVBOX_HGCM -DLOG_TO_BACKDOOR 105 104 #ifeq ($(BUILD_TYPE),debug) - you'll have to enable this manually to get debug stuff. 106 105 #KFLAGS += -DDEBUG … … 147 146 @mkdir -p $(MODULE_DIR); \ 148 147 install -m 0664 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \ 149 PATH="$(PATH):/bin:/sbin" depmod -ae; 148 PATH="$(PATH):/bin:/sbin" depmod -ae; 149 150 endif # eq($(MAKECMDGOALS),clean) 150 151 151 152 clean: 152 rm -rf *.o .*.cmd .*.flags 153 for f in . linux r0drv r0drv/linux; do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done 154 rm -rf .vboxdrv* .tmp_ver* vboxdrv.* Module.symvers Modules.symvers
Note:
See TracChangeset
for help on using the changeset viewer.