diff options
52 files changed, 1500 insertions, 1259 deletions
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 2975291e296a..7d87dd73cbe4 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
| @@ -28,7 +28,7 @@ PS_METHOD = $(prefer-db2x) | |||
| 28 | 28 | ||
| 29 | ### | 29 | ### |
| 30 | # The targets that may be used. | 30 | # The targets that may be used. |
| 31 | .PHONY: xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs | 31 | PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs |
| 32 | 32 | ||
| 33 | BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) | 33 | BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) |
| 34 | xmldocs: $(BOOKS) | 34 | xmldocs: $(BOOKS) |
| @@ -211,3 +211,9 @@ clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) | |||
| 211 | 211 | ||
| 212 | #man put files in man subdir - traverse down | 212 | #man put files in man subdir - traverse down |
| 213 | subdir- := man/ | 213 | subdir- := man/ |
| 214 | |||
| 215 | |||
| 216 | # Declare the contents of the .PHONY variable as phony. We keep that | ||
| 217 | # information in a variable se we can use it in if_changed and friends. | ||
| 218 | |||
| 219 | .PHONY: $(PHONY) | ||
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 443230b43e09..a9c00facdf40 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
| @@ -17,6 +17,7 @@ This document describes the Linux kernel Makefiles. | |||
| 17 | --- 3.8 Command line dependency | 17 | --- 3.8 Command line dependency |
| 18 | --- 3.9 Dependency tracking | 18 | --- 3.9 Dependency tracking |
| 19 | --- 3.10 Special Rules | 19 | --- 3.10 Special Rules |
| 20 | --- 3.11 $(CC) support functions | ||
| 20 | 21 | ||
| 21 | === 4 Host Program support | 22 | === 4 Host Program support |
| 22 | --- 4.1 Simple Host Program | 23 | --- 4.1 Simple Host Program |
| @@ -38,7 +39,6 @@ This document describes the Linux kernel Makefiles. | |||
| 38 | --- 6.6 Commands useful for building a boot image | 39 | --- 6.6 Commands useful for building a boot image |
| 39 | --- 6.7 Custom kbuild commands | 40 | --- 6.7 Custom kbuild commands |
| 40 | --- 6.8 Preprocessing linker scripts | 41 | --- 6.8 Preprocessing linker scripts |
| 41 | --- 6.9 $(CC) support functions | ||
| 42 | 42 | ||
| 43 | === 7 Kbuild Variables | 43 | === 7 Kbuild Variables |
| 44 | === 8 Makefile language | 44 | === 8 Makefile language |
| @@ -106,9 +106,9 @@ This document is aimed towards normal developers and arch developers. | |||
| 106 | Most Makefiles within the kernel are kbuild Makefiles that use the | 106 | Most Makefiles within the kernel are kbuild Makefiles that use the |
| 107 | kbuild infrastructure. This chapter introduce the syntax used in the | 107 | kbuild infrastructure. This chapter introduce the syntax used in the |
| 108 | kbuild makefiles. | 108 | kbuild makefiles. |
| 109 | The preferred name for the kbuild files is 'Kbuild' but 'Makefile' will | 109 | The preferred name for the kbuild files are 'Makefile' but 'Kbuild' can |
| 110 | continue to be supported. All new developmen is expected to use the | 110 | be used and if both a 'Makefile' and a 'Kbuild' file exists then the 'Kbuild' |
| 111 | Kbuild filename. | 111 | file will be used. |
| 112 | 112 | ||
| 113 | Section 3.1 "Goal definitions" is a quick intro, further chapters provide | 113 | Section 3.1 "Goal definitions" is a quick intro, further chapters provide |
| 114 | more details, with real examples. | 114 | more details, with real examples. |
| @@ -385,6 +385,102 @@ more details, with real examples. | |||
| 385 | to prerequisites are referenced with $(src) (because they are not | 385 | to prerequisites are referenced with $(src) (because they are not |
| 386 | generated files). | 386 | generated files). |
| 387 | 387 | ||
| 388 | --- 3.11 $(CC) support functions | ||
| 389 | |||
| 390 | The kernel may be build with several different versions of | ||
| 391 | $(CC), each supporting a unique set of features and options. | ||
| 392 | kbuild provide basic support to check for valid options for $(CC). | ||
| 393 | $(CC) is useally the gcc compiler, but other alternatives are | ||
| 394 | available. | ||
| 395 | |||
| 396 | as-option | ||
| 397 | as-option is used to check if $(CC) when used to compile | ||
| 398 | assembler (*.S) files supports the given option. An optional | ||
| 399 | second option may be specified if first option are not supported. | ||
| 400 | |||
| 401 | Example: | ||
| 402 | #arch/sh/Makefile | ||
| 403 | cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) | ||
| 404 | |||
| 405 | In the above example cflags-y will be assinged the the option | ||
| 406 | -Wa$(comma)-isa=$(isa-y) if it is supported by $(CC). | ||
| 407 | The second argument is optional, and if supplied will be used | ||
| 408 | if first argument is not supported. | ||
| 409 | |||
| 410 | cc-option | ||
| 411 | cc-option is used to check if $(CC) support a given option, and not | ||
| 412 | supported to use an optional second option. | ||
| 413 | |||
| 414 | Example: | ||
| 415 | #arch/i386/Makefile | ||
| 416 | cflags-y += $(call cc-option,-march=pentium-mmx,-march=i586) | ||
| 417 | |||
| 418 | In the above example cflags-y will be assigned the option | ||
| 419 | -march=pentium-mmx if supported by $(CC), otherwise -march-i586. | ||
| 420 | The second argument to cc-option is optional, and if omitted | ||
| 421 | cflags-y will be assigned no value if first option is not supported. | ||
| 422 | |||
| 423 | cc-option-yn | ||
| 424 | cc-option-yn is used to check if gcc supports a given option | ||
| 425 | and return 'y' if supported, otherwise 'n'. | ||
| 426 | |||
| 427 | Example: | ||
| 428 | #arch/ppc/Makefile | ||
| 429 | biarch := $(call cc-option-yn, -m32) | ||
| 430 | aflags-$(biarch) += -a32 | ||
| 431 | cflags-$(biarch) += -m32 | ||
| 432 | |||
