[klibc] [PATCH 01/16] Allow kernel sources to be specified on the command line

Mike Waychison mikew at google.com
Mon Mar 1 23:45:33 PST 2010


Builds that need to keep the source tree pristine need to be able to specify
the location of the kernel sources on the make command line.  We do this by
letting KLIBCKERNELSRC to be overriden with a default of 'linux'.

Signed-off-by: Mike Waychison <mikew at google.com>
---
 Makefile |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 136d4e8..4380727 100644
--- a/Makefile
+++ b/Makefile
@@ -84,13 +84,15 @@ klibc := -f $(srctree)/scripts/Kbuild.klibc obj
 .PHONY: all klcc klibc
 all: klcc klibc
 
-.config: defconfig linux
+.config: defconfig $(KLIBCKERNELSRC)
 	@echo "defconfig has changed, please remove or edit .config"
 	@false
 
-linux:
-	@echo "The 'linux' symlink is missing; it should point to a kernel tree "
-	@echo "configured for the $(KLIBCARCH) architecture."
+$(KLIBCKERNELSRC):
+	@echo "Cannot find kernel sources."
+	@echo "Either make a 'linux' symlink point to a kernel tree "
+	@echo "configured for the $(KLIBCARCH) architecture or specify "
+	@echo "KLIBCKERNELSRC=<path> to the build."
 	@false
 
 rpmbuild = $(shell which rpmbuild 2>/dev/null || which rpm)



More information about the klibc mailing list