MNAME = hello BDIR = /lib/modules/`uname -r`/build ifeq ($(KERNELRELEASE),) # called from shell .PHONY: default clean default: make -C $(BDIR) M=$(shell pwd) modules clean: rm -rf $(MNAME).mod.* $(MNAME).*o .$(MNAME)* .tmp* Module.symvers modules.order else # called from kernel Makefile obj-m := $(MNAME).o endif