aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/kbuild
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-14 13:14:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-14 13:14:29 -0400
commit899552d6e84babd24611fd36ac7051068cb1eb2d (patch)
tree9a02d66b74a0a9267bbf6637765517f5e8558497 /Documentation/kbuild
parent3b7b3e6ec5f56118046594d3c62469e7d1d0aadd (diff)
parent5a5da78b3a48120d942c8a18ecc645f6acdf7da6 (diff)
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull misc kbuild updates from Michal Marek: "This is the non-critical part of kbuild for 3.17-rc1: - make help hint to use make -s with make kernelrelease et al. - moved a kbuild document to Documentation/kbuild where it belongs - four new Coccinelle scripts, one dropped and one fixed - new make kselftest target to run various tests on the kernel" * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kbuild: kselftest - new make target to build and run kernel selftests Coccinelle: Script to replace if and BUG with BUG_ON Coccinelle: Script to detect incorrect argument to sizeof Coccinelle: Script to use ARRAY_SIZE instead of division of two sizeofs Coccinelle: Script to detect cast after memory allocation coccinelle/null: solve parse error Documentation: headers_install.txt is part of kbuild kbuild: make -s should be used with kernelrelease/kernelversion/image_name
Diffstat (limited to 'Documentation/kbuild')
-rw-r--r--Documentation/kbuild/00-INDEX2
-rw-r--r--Documentation/kbuild/headers_install.txt47
2 files changed, 49 insertions, 0 deletions
diff --git a/Documentation/kbuild/00-INDEX b/Documentation/kbuild/00-INDEX
index e8d2b6d83a3d..8c5e6aa78004 100644
--- a/Documentation/kbuild/00-INDEX
+++ b/Documentation/kbuild/00-INDEX
@@ -1,5 +1,7 @@
100-INDEX 100-INDEX
2 - this file: info on the kernel build process 2 - this file: info on the kernel build process
3headers_install.txt
4 - how to export Linux headers for use by userspace
3kbuild.txt 5kbuild.txt
4 - developer information on kbuild 6 - developer information on kbuild
5kconfig.txt 7kconfig.txt
diff --git a/Documentation/kbuild/headers_install.txt b/Documentation/kbuild/headers_install.txt
new file mode 100644
index 000000000000..951eb9f1e040
--- /dev/null
+++ b/Documentation/kbuild/headers_install.txt
@@ -0,0 +1,47 @@
1Exporting kernel headers for use by userspace
2=============================================
3
4The "make headers_install" command exports the kernel's header files in a
5form suitable for use by userspace programs.
6
7The linux kernel's exported header files describe the API for user space
8programs attempting to use kernel services. These kernel header files are
9used by the system's C library (such as glibc or uClibc) to define available
10system calls, as well as constants and structures to be used with these
11system calls. The C library's header files include the kernel header files
12from the "linux" subdirectory. The system's libc headers are usually
13installed at the default location /usr/include and the kernel headers in
14subdirectories under that (most notably /usr/include/linux and
15/usr/include/asm).
16
17Kernel headers are backwards compatible, but not forwards compatible. This
18means that a program built against a C library using older kernel headers
19should run on a newer kernel (although it may not have access to new
20features), but a program built against newer kernel headers may not work on an
21older kernel.
22
23The "make headers_install" command can be run in the top level directory of the
24kernel source code (or using a standard out-of-tree build). It takes two
25optional arguments:
26
27 make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr/include
28
29ARCH indicates which architecture to produce headers for, and defaults to the
30current architecture. The linux/asm directory of the exported kernel headers
31is platform-specific, to see a complete list of supported architectures use
32the command:
33
34 ls -d include/asm-* | sed 's/.*-//'
35
36INSTALL_HDR_PATH indicates where to install the headers. It defaults to
37"./usr/include".
38
39The command "make headers_install_all" exports headers for all architectures
40simultaneously. (This is mostly of interest to distribution maintainers,
41who create an architecture-independent tarball from the resulting include
42directory.) You also can use HDR_ARCH_LIST to specify list of architectures.
43Remember to provide the appropriate linux/asm directory via "mv" or "ln -s"
44before building a C library with headers exported this way.
45
46The kernel header export infrastructure is maintained by David Woodhouse
47<dwmw2@infradead.org>.