1 export KMODDIR?= updates/
2 KMODDIR_ARG:= "INSTALL_MOD_DIR=$(KMODDIR)"
3 ifneq ($(origin $(KLIB)), undefined)
4 KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
6 export KLIB:= /lib/modules/$(shell uname -r)
8 export KLIB_BUILD ?= $(KLIB)/build
10 ifeq ($(KERNELRELEASE),)
11 export PWD := $(shell pwd)
12 export COMPAT_BASE_TREE := "linux-next.git"
13 # For this specific tree this is only relevant in
14 # terms of the last time we synched code up with upstream
15 # for internal stuff. For other compatability projects this
16 # would be the git describe of the base tree you are
18 export COMPAT_BASE_TREE_VERSION := "next-20100517"
19 export COMPAT_VERSION := $(shell git describe)
21 # to check config and compat autoconf
22 export COMPAT_CONFIG=$(PWD)/.config
23 export COMPAT_AUTOCONF=$(PWD)/include/linux/compat_autoconf.h
27 # By stuffing this hear we avoid using
28 # this hackery on modpost, the 2nd section of module building.
30 # This hack lets us put our include path first than the kernel's
31 # when building our compat modules. Your own makefile would look
33 NOSTDINC_FLAGS := -I$(M)/include/ \
34 -include $(M)/include/linux/compat-2.6.h \
36 -DCOMPAT_BASE_TREE="\"$(COMPAT_BASE_TREE)\"" \
37 -DCOMPAT_BASE_TREE_VERSION="\"$(COMPAT_BASE_TREE_VERSION)\"" \
38 -DCOMPAT_PROJECT="\"Generic kernel\"" \
39 -DCOMPAT_VERSION="\"$(COMPAT_VERSION)\""
41 # Technicallay we can require the inclusion of COMPAT_CONFIG for
42 # all targets except clean, so avoid the warnings at clean time.
43 -include $(COMPAT_CONFIG)
50 modules: $(COMPAT_CONFIG) $(COMPAT_AUTOCONF)
51 $(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
55 $(MAKE) -C $(KLIB_BUILD) M=$(PWD) $(KMODDIR_ARG) $(KMODPATH_ARG) \
59 $(COMPAT_AUTOCONF): $(COMPAT_CONFIG)
60 +@$(PWD)/scripts/gen-compat-autoconf.sh $(COMPAT_CONFIG) > $(COMPAT_AUTOCONF)
63 +@$(PWD)/scripts/gen-compat-config.sh > $(COMPAT_CONFIG)
68 $(MAKE) -C $(KLIB_BUILD) M=$(PWD) clean
70 clean-files := Module.symvers modules.order Module.markers compat/modules.order
71 clean-files += modules $(COMPAT_CONFIG) $(COMPAT_AUTOCONF)
73 .PHONY: all install clean modules Makefile