summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/linux/Makefile b/linux/Makefile
index 3d56c96c..066766a7 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -41,6 +41,10 @@ RUNNING_REL := $(shell uname -r)
LINUXDIR := /lib/modules/$(RUNNING_REL)/build
endif
+ifndef O
+O := $(LINUXDIR)
+endif
+
MACHINE := $(shell uname -m)
# Modules for all architectures
@@ -154,6 +158,13 @@ endif
endif
ifneq ($(HAVECONFIG),y)
+ifneq ($(0),$(LINUXDIR))
+GETCONFIG += O=$(O)
+endif
+HAVECONFIG := $(shell if [ -e $(O)/.config ]; then echo y; fi)
+endif
+
+ifneq ($(HAVECONFIG),y)
$(error Cannot find a kernel config file)
endif