aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Čerman2018-11-17 11:56:33 +0100
committerOndrej Čerman2018-11-17 11:56:33 +0100
commit59de360f63dfb7712f7869892ce2b9564ce7c1cd (patch)
treebf1ee5519272238e649e6ae30c15a3d894516114
parent8d9899e77e37d1f68d4291103cb42146fe5da8ca (diff)
Added kernel paths for other distros
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e78339a..da1d1b2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,18 @@
TARGET := $(shell uname -r)
-KERNEL_BUILD := /usr/src/linux-headers-$(TARGET)
DKMS_ROOT_PATH := /usr/src/zenpower-0.1.0
+ifneq ("","$(wildcard /usr/src/linux-headers-$(TARGET)/*)")
+# Ubuntu
+KERNEL_BUILD := /usr/src/linux-headers-$(TARGET)
+else
+ifneq ("","$(wildcard /usr/src/kernels/$(TARGET)/*)")
+# Fedora
+KERNEL_BUILD := /usr/src/kernels/$(TARGET)
+else
+KERNEL_BUILD := $(KERNEL_MODULES)/build
+endif
+endif
+
obj-m := $(patsubst %,%.o,zenpower)
obj-ko := $(patsubst %,%.ko,zenpower)