aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 14:23:06 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 14:23:06 -0400
commit821f3eff7cdb9d6c7076effabd46c96c322daed1 (patch)
tree60f13155196fd6c84424c8aebc133ca4a5f56749 /Documentation
parentebc283118ee448dcb6e6cae74a8a43f17a1ccc3f (diff)
parentf77bf01425b11947eeb3b5b54685212c302741b8 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (40 commits) kbuild: introduce ccflags-y, asflags-y and ldflags-y kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP kbuild: enable use of AFLAGS and CFLAGS on commandline kbuild: enable 'make AFLAGS=...' to add additional options to AS kbuild: fix AFLAGS use in h8300 and m68knommu kbuild: check for wrong use of CFLAGS kbuild: enable 'make CFLAGS=...' to add additional options to CC kbuild: fix up CFLAGS usage kbuild: make modpost detect unterminated device id lists kbuild: call export_report from the Makefile kbuild: move Kai Germaschewski to CREDITS kconfig/menuconfig: distinguish between selected-by-another options and comments kconfig: tristate choices with mixed tristate and boolean values include/linux/Kbuild: remove duplicate entries kbuild: kill backward compatibility checks kbuild: kill EXTRA_ARFLAGS kbuild: fix documentation in makefiles.txt kbuild: call make once for all targets when O=.. is used kbuild: pass -g to assembler under CONFIG_DEBUG_INFO kbuild: update _shipped files for kconfig syntax cleanup ... Fix up conflicts in arch/um/sys-{x86_64,i386}/Makefile manually.
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/kbuild/makefiles.txt62
1 files changed, 32 insertions, 30 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index e08ef8759a07..f099b814d383 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -276,41 +276,39 @@ more details, with real examples.
276 276
277--- 3.7 Compilation flags 277--- 3.7 Compilation flags
278 278
279 EXTRA_CFLAGS, EXTRA_AFLAGS, EXTRA_LDFLAGS, EXTRA_ARFLAGS 279 ccflags-y, asflags-y and ldflags-y
280 The three flags listed above applies only to the kbuild makefile
281 where they are assigned. They are used for all the normal
282 cc, as and ld invocation happenign during a recursive build.
283 Note: Flags with the same behaviour were previously named:
284 EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS.
285 They are yet supported but their use are deprecated.
280 286
281 All the EXTRA_ variables apply only to the kbuild makefile 287 ccflags-y specifies options for compiling C files with $(CC).
282 where they are assigned. The EXTRA_ variables apply to all
283 commands executed in the kbuild makefile.
284
285 $(EXTRA_CFLAGS) specifies options for compiling C files with
286 $(CC).
287 288
288 Example: 289 Example:
289 # drivers/sound/emu10k1/Makefile 290 # drivers/sound/emu10k1/Makefile
290 EXTRA_CFLAGS += -I$(obj) 291 ccflags-y += -I$(obj)
291 ifdef DEBUG 292 ccflags-$(DEBUG) += -DEMU10K1_DEBUG
292 EXTRA_CFLAGS += -DEMU10K1_DEBUG
293 endif
294 293
295 294
296 This variable is necessary because the top Makefile owns the 295 This variable is necessary because the top Makefile owns the
297 variable $(CFLAGS) and uses it for compilation flags for the 296 variable $(KBUILD_CFLAGS) and uses it for compilation flags for the
298 entire tree. 297 entire tree.
299 298
300 $(EXTRA_AFLAGS) is a similar string for per-directory options 299 asflags-y is a similar string for per-directory options
301 when compiling assembly language source. 300 when compiling assembly language source.
302 301
303 Example: 302 Example:
304 #arch/x86_64/kernel/Makefile 303 #arch/x86_64/kernel/Makefile
305 EXTRA_AFLAGS := -traditional 304 asflags-y := -traditional
306 305
307 306
308 $(EXTRA_LDFLAGS) and $(EXTRA_ARFLAGS) are similar strings for 307 ldflags-y is a string for per-directory options to $(LD).
309 per-directory options to $(LD) and $(AR).
310 308
311 Example: 309 Example:
312 #arch/m68k/fpsp040/Makefile 310 #arch/m68k/fpsp040/Makefile
313 EXTRA_LDFLAGS := -x 311 ldflags-y := -x
314 312
315 CFLAGS_$@, AFLAGS_$@ 313 CFLAGS_$@, AFLAGS_$@
316 314
@@ -425,6 +423,7 @@ more details, with real examples.
425 as-instr checks if the assembler reports a specific instruction 423 as-instr checks if the assembler reports a specific instruction
426 and then outputs either option1 or option2 424 and then outputs either option1 or option2
427 C escapes are supported in the test instruction 425 C escapes are supported in the test instruction
426 Note: as-instr-option uses KBUILD_AFLAGS for $(AS) options
428 427
429 cc-option 428 cc-option
430 cc-option is used to check if $(CC) supports a given option, and not 429 cc-option is used to check if $(CC) supports a given option, and not
@@ -438,6 +437,7 @@ more details, with real examples.
438 -march=pentium-mmx if supported by $(CC), otherwise -march=i586. 437 -march=pentium-mmx if supported by $(CC), otherwise -march=i586.
439 The second argument to cc-option is optional, and if omitted, 438 The second argument to cc-option is optional, and if omitted,
440 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
441 441
442 cc-option-yn 442 cc-option-yn
443 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
@@ -453,6 +453,7 @@ more details, with real examples.
453 option. When $(biarch) equals 'y', the expanded variables $(aflags-y) 453 option. When $(biarch) equals 'y', the expanded variables $(aflags-y)
454 and $(cflags-y) will be assigned the values -a32 and -m32, 454 and $(cflags-y) will be assigned the values -a32 and -m32,
455 respectively. 455 respectively.
456 Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options
456 457
457 cc-option-align 458 cc-option-align
458 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
@@ -464,10 +465,11 @@ more details, with real examples.
464 cc-option-align = -falign 465 cc-option-align = -falign
465 466
466 Example: 467 Example:
467 CFLAGS += $(cc-option-align)-functions=4 468 KBUILD_CFLAGS += $(cc-option-align)-functions=4
468 469
469 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
470 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
471 473
472 cc-version 474 cc-version
473 cc-version returns a numerical version of the $(CC) compiler version. 475 cc-version returns a numerical version of the $(CC) compiler version.
@@ -492,9 +494,9 @@ more details, with real examples.
492 494
493 Example: 495 Example:
494 #fs/reiserfs/Makefile 496 #fs/reiserfs/Makefile
495 EXTRA_CFLAGS := $(call cc-ifversion, -lt, 0402, -O1) 497 ccflags-y := $(call cc-ifversion, -lt, 0402, -O1)
496 498
497 In this example, EXTRA_CFLAGS will be assigned the value -O1 if the 499 In this example, ccflags-y will be assigned the value -O1 if the
498 $(CC) version is less than 4.2. 500 $(CC) version is less than 4.2.
499 cc-ifversion takes all the shell operators: 501 cc-ifversion takes all the shell operators:
500 -eq, -ne, -lt, -le, -gt, and -ge 502 -eq, -ne, -lt, -le, -gt, and -ge
@@ -780,8 +782,8 @@ When kbuild executes, the following steps are followed (roughly):
780 Example: 782 Example:
781 #arch/s390/Makefile 783 #arch/s390/Makefile
782 LDFLAGS := -m elf_s390 784 LDFLAGS := -m elf_s390
783 Note: EXTRA_LDFLAGS and LDFLAGS_$@ can be used to further customise 785 Note: ldflags-y can be used to further customise
784 the flags used. See chapter 7. 786 the flags used. See chapter 3.7.
785 787
786 LDFLAGS_MODULE Options for $(LD) when linking modules 788 LDFLAGS_MODULE Options for $(LD) when linking modules
787 789
@@ -817,26 +819,26 @@ When kbuild executes, the following steps are followed (roughly):
817 In this example, the binary $(obj)/image is a binary version of 819 In this example, the binary $(obj)/image is a binary version of
818 vmlinux. The usage of $(call if_changed,xxx) will be described later. 820 vmlinux. The usage of $(call if_changed,xxx) will be described later.
819 821
820 AFLAGS $(AS) assembler flags 822 KBUILD_AFLAGS $(AS) assembler flags
821 823
822 Default value - see top level Makefile 824 Default value - see top level Makefile
823 Append or modify as required per architecture. 825 Append or modify as required per architecture.
824 826
825 Example: 827 Example:
826 #arch/sparc64/Makefile 828 #arch/sparc64/Makefile
827 AFLAGS += -m64 -mcpu=ultrasparc 829 KBUILD_AFLAGS += -m64 -mcpu=ultrasparc
828 830
829 CFLAGS $(CC) compiler flags 831 KBUILD_CFLAGS $(CC) compiler flags
830 832
831 Default value - see top level Makefile 833 Default value - see top level Makefile
832 Append or modify as required per architecture. 834 Append or modify as required per architecture.
833 835
834 Often, the CFLAGS variable depends on the configuration. 836 Often, the KBUILD_CFLAGS variable depends on the configuration.
835 837
836 Example: 838 Example:
837 #arch/i386/Makefile 839 #arch/i386/Makefile
838 cflags-$(CONFIG_M386) += -march=i386 840 cflags-$(CONFIG_M386) += -march=i386
839 CFLAGS += $(cflags-y) 841 KBUILD_CFLAGS += $(cflags-y)
840 842
841 Many arch Makefiles dynamically run the target C compiler to 843 Many arch Makefiles dynamically run the target C compiler to
842 probe supported options: 844 probe supported options:
@@ -848,7 +850,7 @@ When kbuild executes, the following steps are followed (roughly):
848 -march=pentium2,-march=i686) 850 -march=pentium2,-march=i686)
849 ... 851 ...
850 # Disable unit-at-a-time mode ... 852 # Disable unit-at-a-time mode ...
851 CFLAGS += $(call cc-option,-fno-unit-at-a-time) 853 KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time)
852 ... 854 ...
853 855
854 856
@@ -1096,8 +1098,8 @@ When kbuild executes, the following steps are followed (roughly):
1096 specified options when building the target vmlinux.lds. 1098 specified options when building the target vmlinux.lds.
1097 1099
1098 When building the *.lds target, kbuild uses the variables: 1100 When building the *.lds target, kbuild uses the variables:
1099 CPPFLAGS : Set in top-level Makefile 1101 KBUILD_CPPFLAGS : Set in top-level Makefile
1100 EXTRA_CPPFLAGS : May be set in the kbuild makefile 1102 cppflags-y : May be set in the kbuild makefile
1101 CPPFLAGS_$(@F) : Target specific flags. 1103 CPPFLAGS_$(@F) : Target specific flags.
1102 Note that the full filename is used in this 1104 Note that the full filename is used in this
1103 assignment. 1105 assignment.