Building modules Use a makefile like: ifneq ($(KERNEL_RELEASE),) obj-m := module.o else KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules This may change before 2.6