summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-15 10:20:58 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-15 10:20:58 +0000
commit4edbe2caa64d65e61b7d48ec780a8eec190efecc (patch)
tree0415eab46ebdfc229a432b577d962a528d3c5ddf
parentf876efd349e92a7e8a62797e8d18921419c07434 (diff)
downloadbuildroot-novena-4edbe2caa64d65e61b7d48ec780a8eec190efecc.tar.gz
buildroot-novena-4edbe2caa64d65e61b7d48ec780a8eec190efecc.zip
Support using an existing kernel
-rw-r--r--Makefile4
-rw-r--r--make/system-linux.mk49
2 files changed, 52 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a89c65f15..1738266ce 100644
--- a/Makefile
+++ b/Makefile
@@ -64,9 +64,11 @@ TARGETS+=uclibc_toolchain
endif
# Do you want user mode Linux (x86 only), or are you building a
-# real kernel that will run on its own?
+# real kernel # that will run on its own? Perhaps you have a
+# kernel you have already configured and you want to use that?
#TARGETS+=linux
TARGETS+=user-mode-linux
+#TARGETS+=system-linux
# The default minimal set
TARGETS+=busybox tinylogin
diff --git a/make/system-linux.mk b/make/system-linux.mk
new file mode 100644
index 000000000..9b92f083f
--- /dev/null
+++ b/make/system-linux.mk
@@ -0,0 +1,49 @@
+#############################################################
+#
+# System Linux kernel target
+#
+# This uses an existing linux kernel source tree on
+# your build system, and makes no effort at compiling
+# anything....
+#
+# You will probably want to change LINUX_SOURCE to
+# point to wherever you installed you kernel.
+#
+# -Erik
+#
+#############################################################
+ifneq ($(filter $(TARGETS),system-linux),)
+
+LINUX_SOURCE=/usr/src/linux
+LINUX_DIR=$(BUILD_DIR)/linux
+LINUX_KERNEL=$(BUILD_DIR)/buildroot-kernel
+
+$(LINUX_DIR)/.configured:
+ mkdir -p $(LINUX_DIR)
+ (cd $(LINUX_DIR); ln -s $(LINUX_SOURCE)/include)
+ touch $(LINUX_DIR)/.configured
+
+$(LINUX_KERNEL): $(LINUX_DIR)/.configured
+
+$(STAGING_DIR)/include/linux/version.h: $(LINUX_DIR)/.configured
+ mkdir -p $(STAGING_DIR)/include
+ rm -rf $(STAGING_DIR)/include/linux
+ cp -dpa $(LINUX_SOURCE)/include/linux $(STAGING_DIR)/include/
+ rm -rf $(STAGING_DIR)/include/asm
+ mkdir -p $(STAGING_DIR)/include/asm
+ cp -dpa $(LINUX_SOURCE)/include/asm/* $(STAGING_DIR)/include/asm/
+ rm -rf $(STAGING_DIR)/include/scsi
+ mkdir -p $(STAGING_DIR)/include/scsi
+ cp -dpa $(LINUX_SOURCE)/include/scsi/* $(STAGING_DIR)/include/scsi
+ touch -c $(STAGING_DIR)/include/linux/version.h
+
+system-linux: $(STAGING_DIR)/include/linux/version.h
+
+system-linux-clean: clean
+ rm -f $(LINUX_KERNEL)
+ rm -rf $(LINUX_DIR)
+
+system-linux-dirclean:
+ rm -rf $(LINUX_DIR)
+
+endif