Use a complete makefile.
[cascardo/kernel/samples/03.proc/.git] / Makefile
index 8569a8c..e8b015c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1 +1,11 @@
-obj-m := hello_procfs.o
+ifneq ($(KERNELRELEASE),)
+       obj-m := hello_procfs.o
+else
+       KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+       PWD := $(shell pwd)
+default:
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+
+clean:
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
+endif