# Or for a specific version
#TARGET := 2.6.33.5
KERNEL_MODULES := /lib/modules/$(TARGET)
-# KERNEL_BUILD := $(KERNEL_MODULES)/build
-KERNEL_BUILD := /usr/src/linux-headers-$(TARGET)
-#SYSTEM_MAP := $(KERNEL_BUILD)/System.map
-SYSTEM_MAP := /boot/System.map-$(TARGET)
+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
+
+#SYSTEM_MAP := $(KERNEL_BUILD)/System.map
+ifneq ("","$(wildcard /boot/System.map-$(TARGET))")
+SYSTEM_MAP := /boot/System.map-$(TARGET)
+else
+# Arch
+SYSTEM_MAP := /proc/kallsyms
+endif
DRIVER := nct6775