aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 12 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 37df362..0c25810 100644
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,17 @@
-EXTRA_CFLAGS := -I$(src)/include
+ifneq ($(KERNELRELEASE),)
+include Kbuild
+else
+KDIR ?= /lib/modules/`uname -r`/build
-obj-m := cyber.o
+modules:
+ @$(MAKE) -C $(KDIR) M=$$PWD modules
-cyber-objs := src/cyber_device.o \
- src/cyber_device_character_device.o \
- src/cyber_device_device_class.o \
- src/cyber_device_kernel_device.o \
- src/cyber_file.o \
- src/cyber_lifecycle.o \
- src/cyber.o
-
-ifeq ($(KERNEL_VERSION),)
-KERNEL_VERSION=$(shell uname -r)
-endif
-
-all:
- make -C /lib/modules/$(KERNEL_VERSION)/build/ M=$(PWD) modules
+clean:
+ @$(MAKE) -C $(KDIR) M=$$PWD clean
install:
- make -C /lib/modules/$(KERNEL_VERSION)/build/ M=$(PWD) modules_install
- depmod -a
+ @$(MAKE) -C $(KDIR) M=$$PWD modules_install
+ @depmod -a
+
+endif
-clean:
- make -C /lib/modules/$(KERNEL_VERSION)/build/ M=$(PWD) clean