Changeset 84 in vbox
- Timestamp:
- Jan 17, 2007 10:27:28 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 17528
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/linux/Makefile
r81 r84 31 31 r0drv/linux/thread-r0drv-linux.o \ 32 32 33 # 34 # Where is everything? 35 # 36 KERN_DIR_CUR := /lib/modules/$(shell uname -r)/build 33 ifneq ($(MAKECMDGOALS),clean) 34 35 # kernel base directory 37 36 ifndef $(KERN_DIR) 38 KERN_DIR := $(KERN_DIR_CUR) 39 endif 40 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 41 ifneq ($(shell if test -d /usr/src/linux; then echo yes; fi),yes) 42 $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.) 43 endif 44 KERN_DIR := /usr/src/linux 45 $(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.) 37 KERN_DIR := /lib/modules/$(shell uname -r)/build 38 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 39 KERN_DIR := /usr/src/linux 40 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 41 $(error Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.) 42 endif 43 $(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.) 44 endif 45 else 46 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 47 $(error Error: KERN_DIR does not point to a directory.) 48 endif 46 49 endif 47 50 48 51 # includes 49 52 ifndef $(KERN_INCL) 50 KERN_INCL = $(KERN_DIR)/include51 $(info Info: using $(KERN_INCL) as the include directory of your Linux kernel. If this is not correct, specify KERN_INFO=<directory> and run Make again.)53 KERN_INCL = $(KERN_DIR)/include 54 $(info Info: using $(KERN_INCL) as the include directory of your Linux kernel. If this is not correct, specify KERN_INCL=<directory> and run Make again.) 52 55 endif 53 ifneq ($(shell if test -d $(KERN_IN FO); then echo yes; fi),yes)54 $(error Error: unable to find the include directory for your current Linux kernel. Specify $KERN_INCL=<directory> and run Make again.)56 ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes) 57 $(error Error: unable to find the include directory for your current Linux kernel. Specify $KERN_INCL=<directory> and run Make again.) 55 58 endif 56 59 57 # Module install dir.60 # module install dir. 58 61 ifndef MODULE_DIR 59 MODULE_DIR_TST := /lib/modules/$(shell uname -r)60 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)61 MODULE_DIR := $(MODULE_DIR_TST)/misc62 else63 $(error Error: could not find the module directory for your current Linux kernel)64 endif62 MODULE_DIR_TST := /lib/modules/$(shell uname -r) 63 ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes) 64 MODULE_DIR := $(MODULE_DIR_TST)/misc 65 else 66 $(error Error: could not find the module directory for your current Linux kernel) 67 endif 65 68 endif # MODULE_DIR unspecified 66 69 … … 80 83 # 81 84 ifndef INCL 82 INCL:= -I$(KERN_INCL) -I$(shell pwd) -I$(shell pwd)/include -I$(shell pwd)/r0drv/linux83 export INCL85 INCL := -I$(KERN_INCL) -I$(shell pwd) -I$(shell pwd)/include -I$(shell pwd)/r0drv/linux 86 export INCL 84 87 endif 85 88 KFLAGS := -D__KERNEL__ -DMODULE -D__LINUX__ -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 86 89 ifndef CONFIG_VBOXDRV_FIXEDMAJOR 87 KFLAGS+= -DCONFIG_VBOXDRV_AS_MISC90 KFLAGS += -DCONFIG_VBOXDRV_AS_MISC 88 91 endif 89 92 ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),) 90 KFLAGS+= -D__AMD64__93 KFLAGS += -D__AMD64__ 91 94 else 92 KFLAGS+= -D__X86__95 KFLAGS += -D__X86__ 93 96 endif 94 97 #ifeq ($(BUILD_TYPE),debug) - you'll have to enable this manually to get debug stuff. … … 97 100 98 101 ifeq ($(KERN_VERSION), 24) 99 #100 102 # 2.4 101 # 102 103 TOPDIR = $(KERN_DIR) 104 105 MODULE_EXT := o 106 107 EXTRA_CFLAGS := -DVBOX_LINUX_2_4 108 103 TOPDIR = $(KERN_DIR) 104 MODULE_EXT := o 105 EXTRA_CFLAGS := -DVBOX_LINUX_2_4 109 106 $(MODULE)-objs = $(OBJS) 110 111 107 else 112 #113 108 # 2.6 and later 114 # 115 116 MODULE_EXT := ko 117 118 $(MODULE)-y := $(OBJS) 109 MODULE_EXT := ko 110 $(MODULE)-y := $(OBJS) 119 111 120 112 endif … … 147 139 rm -f /etc/vbox/module_not_compiled 148 140 141 endif # eq($(MAKECMDGOALS),clean) 142 149 143 clean: 150 144 for f in . linux r0drv r0drv/linux; do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
Note:
See TracChangeset
for help on using the changeset viewer.