obj-m += myfs.o myfs-objs := inode.o super.o EXTRA_CFLAGS += -DSOMETHING ifeq ($(KERNELRELEASE),) # Called as "make" part of makefile. This executes kbuild all: build-myfs clean: clean-myfs install: install-myfs ifneq ($(KERNEL_26),) # This is a 2.6 kenrel, forward to kbuild build-myfs: $(MAKE) -C $(KERNELDIR) M=`pwd` modules clean-myfs: $(MAKE) -C $(KERNELDIR) M=`pwd` clean install-myfs: $(MAKE) -C $(KERNELDIR) M=`pwd` modules_install else # This is a 2.4 kernel, use our own include Kbuild-24.make endif else # Called from 2.6 kbuild STAMP_DIR = `pwd` endif