ifneq ($(KERNELRELEASE),) # kbuild part of makefile obj-m := motorek.o else # Normal Makefile KERNELDIR := /lib/modules/`uname -r`/build all %: $(MAKE) -C $(KERNELDIR) M=`pwd` $@ endif