[PATCH] Kernel output path support

Pavel Roskin proski
Fri May 21 14:49:26 PDT 2004


Hello!

Linux 2.6 can be compiled to a separate directory.  If the O variable is 
set on the make command line, the source tree is considered read-only. 
All new files are created in the output directory, including .config, 
include/linux/version.h, object files and the compiled kernel.

This feature allows compiling different configurations from the same 
source (possibly even for different architectures), as well as compiling 
from read-only filesystems (e.g. CD-ROM, read-only NFS).

Support for the separate output directory is almost trivial to add.  The 
kernel build system takes care of everything.  But the top-level Makefile 
should include .config from the output directory.

Note that the hostap build system still creates all files in the source 
tree.  I don't think it's worth the trouble to implement the output 
directory for hostap itself.

-- 
Regards,
Pavel Roskin
-------------- next part --------------
--- Makefile
+++ Makefile
@@ -11,13 +11,17 @@
 # Leave this blank for kernel-tree PCMCIA compilations (CONFIG_PCMCIA):
 PCMCIA_PATH=
 
+# Output directory that you used when building Linux kernel, if any.
+# Note: this driver will be compiled to the current directory regardless.
+O = $(KERNEL_PATH)
+
 # This path will be prepended to every installed file
 DESTDIR=
 
 CC=gcc
 CFLAGS=-O2 -D__KERNEL__ -DMODULE -Wall -g -c $(EXTRA_CFLAGS)
 
-include $(KERNEL_PATH)/.config
+include $(O)/.config
 
 INCLUDES=-I$(KERNEL_PATH)/include
 ifdef PCMCIA_PATH



More information about the Hostap mailing list