diff options
Diffstat (limited to 'Documentation/kbuild/makefiles.txt')
-rw-r--r-- | Documentation/kbuild/makefiles.txt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 54bbfd37f157..1ca535bcc8c7 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -294,7 +294,7 @@ more details, with real examples. | |||
294 | 294 | ||
295 | 295 | ||
296 | This variable is necessary because the top Makefile owns the | 296 | This variable is necessary because the top Makefile owns the |
297 | variable $(CFLAGS) and uses it for compilation flags for the | 297 | variable $(KBUILD_CFLAGS) and uses it for compilation flags for the |
298 | entire tree. | 298 | entire tree. |
299 | 299 | ||
300 | $(EXTRA_AFLAGS) is a similar string for per-directory options | 300 | $(EXTRA_AFLAGS) is a similar string for per-directory options |
@@ -437,6 +437,7 @@ more details, with real examples. | |||
437 | -march=pentium-mmx if supported by $(CC), otherwise -march=i586. | 437 | -march=pentium-mmx if supported by $(CC), otherwise -march=i586. |
438 | The second argument to cc-option is optional, and if omitted, | 438 | The second argument to cc-option is optional, and if omitted, |
439 | cflags-y will be assigned no value if first option is not supported. | 439 | cflags-y will be assigned no value if first option is not supported. |
440 | Note: cc-option uses KBUILD_CFLAGS for $(CC) options | ||
440 | 441 | ||
441 | cc-option-yn | 442 | cc-option-yn |
442 | cc-option-yn is used to check if gcc supports a given option | 443 | cc-option-yn is used to check if gcc supports a given option |
@@ -452,6 +453,7 @@ more details, with real examples. | |||
452 | option. When $(biarch) equals 'y', the expanded variables $(aflags-y) | 453 | option. When $(biarch) equals 'y', the expanded variables $(aflags-y) |
453 | and $(cflags-y) will be assigned the values -a32 and -m32, | 454 | and $(cflags-y) will be assigned the values -a32 and -m32, |
454 | respectively. | 455 | respectively. |
456 | Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options | ||
455 | 457 | ||
456 | cc-option-align | 458 | cc-option-align |
457 | gcc versions >= 3.0 changed the type of options used to specify | 459 | gcc versions >= 3.0 changed the type of options used to specify |
@@ -463,10 +465,11 @@ more details, with real examples. | |||
463 | cc-option-align = -falign | 465 | cc-option-align = -falign |
464 | 466 | ||
465 | Example: | 467 | Example: |
466 | CFLAGS += $(cc-option-align)-functions=4 | 468 | KBUILD_CFLAGS += $(cc-option-align)-functions=4 |
467 | 469 | ||
468 | In the above example, the option -falign-functions=4 is used for | 470 | In the above example, the option -falign-functions=4 is used for |
469 | gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used. | 471 | gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used. |
472 | Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options | ||
470 | 473 | ||
471 | cc-version | 474 | cc-version |
472 | cc-version returns a numerical version of the $(CC) compiler version. | 475 | cc-version returns a numerical version of the $(CC) compiler version. |
@@ -825,17 +828,17 @@ When kbuild executes, the following steps are followed (roughly): | |||
825 | #arch/sparc64/Makefile | 828 | #arch/sparc64/Makefile |
826 | AFLAGS += -m64 -mcpu=ultrasparc | 829 | AFLAGS += -m64 -mcpu=ultrasparc |
827 | 830 | ||
828 | CFLAGS $(CC) compiler flags | 831 | KBUILD_CFLAGS $(CC) compiler flags |
829 | 832 | ||
830 | Default value - see top level Makefile | 833 | Default value - see top level Makefile |
831 | Append or modify as required per architecture. | 834 | Append or modify as required per architecture. |
832 | 835 | ||
833 | Often, the CFLAGS variable depends on the configuration. | 836 | Often, the KBUILD_CFLAGS variable depends on the configuration. |
834 | 837 | ||
835 | Example: | 838 | Example: |
836 | #arch/i386/Makefile | 839 | #arch/i386/Makefile |
837 | cflags-$(CONFIG_M386) += -march=i386 | 840 | cflags-$(CONFIG_M386) += -march=i386 |
838 | CFLAGS += $(cflags-y) | 841 | KBUILD_CFLAGS += $(cflags-y) |
839 | 842 | ||
840 | Many arch Makefiles dynamically run the target C compiler to | 843 | Many arch Makefiles dynamically run the target C compiler to |
841 | probe supported options: | 844 | probe supported options: |
@@ -847,7 +850,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
847 | -march=pentium2,-march=i686) | 850 | -march=pentium2,-march=i686) |
848 | ... | 851 | ... |
849 | # Disable unit-at-a-time mode ... | 852 | # Disable unit-at-a-time mode ... |
850 | CFLAGS += $(call cc-option,-fno-unit-at-a-time) | 853 | KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time) |
851 | ... | 854 | ... |
852 | 855 | ||
853 | 856 | ||