allow O= usage for Linux 2.6 kernel building in another directory
authorDave Airlie <airlied@linux.ie>
Wed, 14 Jul 2004 12:14:37 +0000 (12:14 +0000)
committerDave Airlie <airlied@linux.ie>
Wed, 14 Jul 2004 12:14:37 +0000 (12:14 +0000)
linux-core/Makefile
linux/Makefile

index 3d56c96..066766a 100644 (file)
@@ -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
 
index 3d56c96..066766a 100644 (file)
@@ -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