Documentation: update kbuild make typos/grammar/text flow
Update section 3.7 examples to reflect the current state of the Makefiles used. Fix spelling and grammar errors along with flow of text. Signed-off-by: matt mooney <mfm@muteddisk.com> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2f5a2f8184
commit
eb07e1b4ac
@ -285,45 +285,42 @@ more details, with real examples.
|
|||||||
--- 3.7 Compilation flags
|
--- 3.7 Compilation flags
|
||||||
|
|
||||||
ccflags-y, asflags-y and ldflags-y
|
ccflags-y, asflags-y and ldflags-y
|
||||||
The three flags listed above applies only to the kbuild makefile
|
The three flags listed above apply only to the kbuild makefile where
|
||||||
where they are assigned. They are used for all the normal
|
they are assigned (i.e., per-directory). They are used for all the
|
||||||
cc, as and ld invocation happenign during a recursive build.
|
normal cc, as and ld invocation happening during a recursive build.
|
||||||
Note: Flags with the same behaviour were previously named:
|
Note: Flags with the same behaviour were previously named:
|
||||||
EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS.
|
EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. They are still
|
||||||
They are yet supported but their use are deprecated.
|
supported but their use is deprecated.
|
||||||
|
|
||||||
ccflags-y specifies options for compiling C files with $(CC).
|
ccflags-y specifies options for compiling with $(CC).
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
# drivers/sound/emu10k1/Makefile
|
# drivers/acpi/Makefile
|
||||||
ccflags-y += -I$(obj)
|
ccflags-y := -Os
|
||||||
ccflags-$(DEBUG) += -DEMU10K1_DEBUG
|
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
This variable is necessary because the top Makefile owns the
|
This variable is necessary because the top Makefile owns the
|
||||||
variable $(KBUILD_CFLAGS) and uses it for compilation flags for the
|
variable $(KBUILD_CFLAGS) and uses it for compilation flags for the
|
||||||
entire tree.
|
entire tree.
|
||||||
|
|
||||||
asflags-y is a similar string for per-directory options
|
asflags-y specifies options for assembling with $(AS).
|
||||||
when compiling assembly language source.
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
#arch/x86_64/kernel/Makefile
|
#arch/sparc/kernel/Makefile
|
||||||
asflags-y := -traditional
|
asflags-y := -ansi
|
||||||
|
|
||||||
|
ldflags-y specifies options for linking with $(LD).
|
||||||
ldflags-y is a string for per-directory options to $(LD).
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
#arch/m68k/fpsp040/Makefile
|
#arch/cris/boot/compressed/Makefile
|
||||||
ldflags-y := -x
|
ldflags-y += -T $(srctree)/$(src)/decompress_$(arch-y).lds
|
||||||
|
|
||||||
subdir-ccflags-y, subdir-asflags-y
|
subdir-ccflags-y, subdir-asflags-y
|
||||||
The two flags listed above are similar to ccflags-y and as-falgs-y.
|
The two flags listed above are similar to ccflags-y and asflags-y.
|
||||||
The difference is that the subdir- variants has effect for the kbuild
|
The difference is that the subdir- variants affect the kbuild
|
||||||
file where tey are present and all subdirectories.
|
file where they are present and all subdirectories. Options specified
|
||||||
Options specified using subdir-* are added to the commandline before
|
using subdir-* are added to the commandline before the options
|
||||||
the options specified using the non-subdir variants.
|
specified using the non-subdir variants.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
subdir-ccflags-y := -Werror
|
subdir-ccflags-y := -Werror
|
||||||
@ -341,18 +338,18 @@ more details, with real examples.
|
|||||||
CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF
|
CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF
|
||||||
CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ \
|
CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ \
|
||||||
-DGDTH_STATISTICS
|
-DGDTH_STATISTICS
|
||||||
CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM
|
|
||||||
|
|
||||||
These three lines specify compilation flags for aha152x.o,
|
These two lines specify compilation flags for aha152x.o and gdth.o.
|
||||||
gdth.o, and seagate.o
|
|
||||||
|
|
||||||
$(AFLAGS_$@) is a similar feature for source files in assembly
|
$(AFLAGS_$@) is a similar feature for source files in assembly
|
||||||
languages.
|
languages.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
# arch/arm/kernel/Makefile
|
# arch/arm/kernel/Makefile
|
||||||
AFLAGS_head-armv.o := -DTEXTADDR=$(TEXTADDR) -traditional
|
AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
|
||||||
AFLAGS_head-armo.o := -DTEXTADDR=$(TEXTADDR) -traditional
|
AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
|
||||||
|
AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
|
||||||
|
|
||||||
|
|
||||||
--- 3.9 Dependency tracking
|
--- 3.9 Dependency tracking
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user