diff options
Diffstat (limited to 'Documentation/kbuild/makefiles.txt')
-rw-r--r-- | Documentation/kbuild/makefiles.txt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 40e082bb8c5..835b64acf0b 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 |
@@ -1214,6 +1216,14 @@ When kbuild executes, the following steps are followed (roughly): | |||
1214 | The kbuild infrastructure for *lds file are used in several | 1216 | The kbuild infrastructure for *lds file are used in several |
1215 | architecture-specific files. | 1217 | architecture-specific files. |
1216 | 1218 | ||
1219 | --- 6.9 Generic header files | ||
1220 | |||
1221 | The directory include/asm-generic contains the header files | ||
1222 | that may be shared between individual architectures. | ||
1223 | The recommended approach how to use a generic header file is | ||
1224 | to list the file in the Kbuild file. | ||
1225 | See "7.4 generic-y" for further info on syntax etc. | ||
1226 | |||
1217 | === 7 Kbuild syntax for exported headers | 1227 | === 7 Kbuild syntax for exported headers |
1218 | 1228 | ||
1219 | The kernel include a set of headers that is exported to userspace. | 1229 | The kernel include a set of headers that is exported to userspace. |
@@ -1270,6 +1280,32 @@ See subsequent chapter for the syntax of the Kbuild file. | |||
1270 | In the example above all exported headers in the Kbuild file | 1280 | In the example above all exported headers in the Kbuild file |
1271 | will be located in the directory "include/linux" when exported. | 1281 | will be located in the directory "include/linux" when exported. |
1272 | 1282 | ||
1283 | --- 7.4 generic-y | ||
1284 | |||
1285 | If an architecture uses a verbatim copy of a header from | ||
1286 | include/asm-generic then this is listed in the file | ||
1287 | arch/$(ARCH)/include/asm/Kbuild like this: | ||
1288 | |||
1289 | Example: | ||
1290 | #arch/x86/include/asm/Kbuild | ||
1291 | generic-y += termios.h | ||
1292 | generic-y += rtc.h | ||
1293 | |||
1294 | During the prepare phase of the build a wrapper include | ||
1295 | file is generated in the directory: | ||
1296 | |||
1297 | arch/$(ARCH)/include/generated/asm | ||
1298 | |||
1299 | When a header is exported where the architecture uses | ||
1300 | the generic header a similar wrapper is generated as part | ||
1301 | of the set of exported headers in the directory: | ||
1302 | |||
1303 | usr/include/asm | ||
1304 | |||
1305 | The generated wrapper will in both cases look like the following: | ||
1306 | |||
1307 | Example: termios.h | ||
1308 | #include <asm-generic/termios.h> | ||
1273 | 1309 | ||
1274 | === 8 Kbuild Variables | 1310 | === 8 Kbuild Variables |
1275 | 1311 | ||