PWD := $(shell pwd) MOD_DIR ?= /lib/modules/`uname -r`/build obj-m += hello.o modules: make -C $(MOD_DIR) M=$(PWD) modules modules_install: make -C $(MOD_DIR) M=$(PWD) modules_install clean: rm -rf *.o *.ko *.cmd *.mod.* Module.symvers modules.order .PHONY: modules modules_install clean