From 74647ea3f4d461e062177f46ad85f71d0c4af811 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 20 Sep 2017 15:46:28 -0700 Subject: [PATCH] Try to add support for automatically detected build directories Signed-off-by: Guenter Roeck --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 33f43df..8481a0a 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,18 @@ TARGET := $(shell uname -r) # Or specific version #TARGET := 2.6.33.5 KERNEL_MODULES := /lib/modules/$(TARGET) -# KERNEL_BUILD := $(KERNEL_MODULES)/build + +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 SYSTEM_MAP := /boot/System.map-$(TARGET) -- 2.39.5