aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/kbuild
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-24 16:31:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-24 16:31:37 -0400
commit2bb732cdb48d271ff7a910260ffb851fb4bc8a28 (patch)
tree580bf68eb1e52b4e6915588d61423347ae09c318 /Documentation/kbuild
parentf50d1d9e8d964fdd3b4cedfbca8843d1bc5916c1 (diff)
parentc4d5ee13984f57b2f881635c49045151679f5e8a (diff)
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o scripts/kallsyms.c: fix potential segfault scripts/gen_initramfs_list.sh: Convert to a /bin/sh script kbuild: Fix GNU make v3.80 compatibility kbuild: Fix passing -Wno-* options to gcc 4.4+ kbuild: move scripts/basic/docproc.c to scripts/docproc.c kbuild: Fix Makefile.asm-generic for um kbuild: Allow to combine multiple W= levels kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0 Fix handling of backlash character in LINUX_COMPILE_BY name kbuild: asm-generic support kbuild: implement several W= levels kbuild: Fix build with binutils <= 2.19 initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros kbuild: Use the deterministic mode of ar kbuild: Call gzip with -n kbuild: move KALLSYMS_EXTRA_PASS from Kconfig to Makefile Kconfig: improve KALLSYMS_ALL documentation Fix up trivial conflict in Makefile
Diffstat (limited to 'Documentation/kbuild')
-rw-r--r--Documentation/kbuild/kbuild.txt13
-rw-r--r--Documentation/kbuild/makefiles.txt53
2 files changed, 66 insertions, 0 deletions
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 7c2a89ba674c..68e32bb6bd80 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -201,3 +201,16 @@ KBUILD_ENABLE_EXTRA_GCC_CHECKS
201-------------------------------------------------- 201--------------------------------------------------
202If enabled over the make command line with "W=1", it turns on additional 202If enabled over the make command line with "W=1", it turns on additional
203gcc -W... options for more extensive build-time checking. 203gcc -W... options for more extensive build-time checking.
204
205KBUILD_BUILD_TIMESTAMP
206--------------------------------------------------
207Setting this to a date string overrides the timestamp used in the
208UTS_VERSION definition (uname -v in the running kernel). The value has to
209be a string that can be passed to date -d. The default value
210is the output of the date command at one point during build.
211
212KBUILD_BUILD_USER, KBUILD_BUILD_HOST
213--------------------------------------------------
214These two variables allow to override the user@host string displayed during
215boot and in /proc/version. The default value is the output of the commands
216whoami and host, respectively.
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 5d145bb443c0..47435e56c5da 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -40,11 +40,13 @@ This document describes the Linux kernel Makefiles.
40 --- 6.6 Commands useful for building a boot image 40 --- 6.6 Commands useful for building a boot image
41 --- 6.7 Custom kbuild commands 41 --- 6.7 Custom kbuild commands
42 --- 6.8 Preprocessing linker scripts 42 --- 6.8 Preprocessing linker scripts
43 --- 6.9 Generic header files
43 44
44 === 7 Kbuild syntax for exported headers 45 === 7 Kbuild syntax for exported headers
45 --- 7.1 header-y 46 --- 7.1 header-y
46 --- 7.2 objhdr-y 47 --- 7.2 objhdr-y
47 --- 7.3 destination-y 48 --- 7.3 destination-y
49 --- 7.4 generic-y
48 50
49 === 8 Kbuild Variables 51 === 8 Kbuild Variables
50 === 9 Makefile language 52 === 9 Makefile language
@@ -499,6 +501,18 @@ more details, with real examples.
499 gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used. 501 gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used.
500 Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options 502 Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options
501 503
504 cc-disable-warning
505 cc-disable-warning checks if gcc supports a given warning and returns
506 the commandline switch to disable it. This special function is needed,
507 because gcc 4.4 and later accept any unknown -Wno-* option and only
508 warn about it if there is another warning in the source file.
509
510 Example:
511 KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
512
513 In the above example, -Wno-unused-but-set-variable will be added to
514 KBUILD_CFLAGS only if gcc really accepts it.
515
502 cc-version 516 cc-version
503 cc-version returns a numerical version of the $(CC) compiler version. 517 cc-version returns a numerical version of the $(CC) compiler version.
504 The format is <major><minor> where both are two digits. So for example 518 The format is <major><minor> where both are two digits. So for example
@@ -955,6 +969,11 @@ When kbuild executes, the following steps are followed (roughly):
955 used when linking modules. This is often a linker script. 969 used when linking modules. This is often a linker script.
956 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). 970 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
957 971
972 KBUILD_ARFLAGS Options for $(AR) when creating archives
973
974 $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
975 mode) if this option is supported by $(AR).
976
958--- 6.2 Add prerequisites to archprepare: 977--- 6.2 Add prerequisites to archprepare:
959 978
960 The archprepare: rule is used to list prerequisites that need to be 979 The archprepare: rule is used to list prerequisites that need to be
@@ -1209,6 +1228,14 @@ When kbuild executes, the following steps are followed (roughly):
1209 The kbuild infrastructure for *lds file are used in several 1228 The kbuild infrastructure for *lds file are used in several
1210 architecture-specific files. 1229 architecture-specific files.
1211 1230
1231--- 6.9 Generic header files
1232
1233 The directory include/asm-generic contains the header files
1234 that may be shared between individual architectures.
1235 The recommended approach how to use a generic header file is
1236 to list the file in the Kbuild file.
1237 See "7.4 generic-y" for further info on syntax etc.
1238
1212=== 7 Kbuild syntax for exported headers 1239=== 7 Kbuild syntax for exported headers
1213 1240
1214The kernel include a set of headers that is exported to userspace. 1241The kernel include a set of headers that is exported to userspace.
@@ -1265,6 +1292,32 @@ See subsequent chapter for the syntax of the Kbuild file.
1265 In the example above all exported headers in the Kbuild file 1292 In the example above all exported headers in the Kbuild file
1266 will be located in the directory "include/linux" when exported. 1293 will be located in the directory "include/linux" when exported.
1267 1294
1295 --- 7.4 generic-y
1296
1297 If an architecture uses a verbatim copy of a header from
1298 include/asm-generic then this is listed in the file
1299 arch/$(ARCH)/include/asm/Kbuild like this:
1300
1301 Example:
1302 #arch/x86/include/asm/Kbuild
1303 generic-y += termios.h
1304 generic-y += rtc.h
1305
1306 During the prepare phase of the build a wrapper include
1307 file is generated in the directory:
1308
1309 arch/$(ARCH)/include/generated/asm
1310
1311 When a header is exported where the architecture uses
1312 the generic header a similar wrapper is generated as part
1313 of the set of exported headers in the directory:
1314
1315 usr/include/asm
1316
1317 The generated wrapper will in both cases look like the following:
1318
1319 Example: termios.h
1320 #include <asm-generic/termios.h>
1268 1321
1269=== 8 Kbuild Variables 1322=== 8 Kbuild Variables
1270 1323