Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matt Mooney and committed by
Linus Torvalds
eb07e1b4 2f5a2f81

+25 -28
+25 -28
Documentation/kbuild/makefiles.txt
··· 285 285 --- 3.7 Compilation flags 286 286 287 287 ccflags-y, asflags-y and ldflags-y 288 - The three flags listed above applies only to the kbuild makefile 289 - where they are assigned. They are used for all the normal 290 - cc, as and ld invocation happenign during a recursive build. 288 + The three flags listed above apply only to the kbuild makefile where 289 + they are assigned (i.e., per-directory). They are used for all the 290 + normal cc, as and ld invocation happening during a recursive build. 291 291 Note: Flags with the same behaviour were previously named: 292 - EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. 293 - They are yet supported but their use are deprecated. 292 + EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. They are still 293 + supported but their use is deprecated. 294 294 295 - ccflags-y specifies options for compiling C files with $(CC). 295 + ccflags-y specifies options for compiling with $(CC). 296 296 297 297 Example: 298 - # drivers/sound/emu10k1/Makefile 299 - ccflags-y += -I$(obj) 300 - ccflags-$(DEBUG) += -DEMU10K1_DEBUG 301 - 298 + # drivers/acpi/Makefile 299 + ccflags-y := -Os 300 + ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT 302 301 303 302 This variable is necessary because the top Makefile owns the 304 303 variable $(KBUILD_CFLAGS) and uses it for compilation flags for the 305 304 entire tree. 306 305 307 - asflags-y is a similar string for per-directory options 308 - when compiling assembly language source. 306 + asflags-y specifies options for assembling with $(AS). 309 307 310 308 Example: 311 - #arch/x86_64/kernel/Makefile 312 - asflags-y := -traditional 309 + #arch/sparc/kernel/Makefile 310 + asflags-y := -ansi 313 311 314 - 315 - ldflags-y is a string for per-directory options to $(LD). 312 + ldflags-y specifies options for linking with $(LD). 316 313 317 314 Example: 318 - #arch/m68k/fpsp040/Makefile 319 - ldflags-y := -x 315 + #arch/cris/boot/compressed/Makefile 316 + ldflags-y += -T $(srctree)/$(src)/decompress_$(arch-y).lds 320 317 321 318 subdir-ccflags-y, subdir-asflags-y 322 - The two flags listed above are similar to ccflags-y and as-falgs-y. 323 - The difference is that the subdir- variants has effect for the kbuild 324 - file where tey are present and all subdirectories. 325 - Options specified using subdir-* are added to the commandline before 326 - the options specified using the non-subdir variants. 319 + The two flags listed above are similar to ccflags-y and asflags-y. 320 + The difference is that the subdir- variants affect the kbuild 321 + file where they are present and all subdirectories. Options specified 322 + using subdir-* are added to the commandline before the options 323 + specified using the non-subdir variants. 327 324 328 325 Example: 329 326 subdir-ccflags-y := -Werror ··· 338 341 CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF 339 342 CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ \ 340 343 -DGDTH_STATISTICS 341 - CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM 342 344 343 - These three lines specify compilation flags for aha152x.o, 344 - gdth.o, and seagate.o 345 + These two lines specify compilation flags for aha152x.o and gdth.o. 345 346 346 347 $(AFLAGS_$@) is a similar feature for source files in assembly 347 348 languages. 348 349 349 350 Example: 350 351 # arch/arm/kernel/Makefile 351 - AFLAGS_head-armv.o := -DTEXTADDR=$(TEXTADDR) -traditional 352 - AFLAGS_head-armo.o := -DTEXTADDR=$(TEXTADDR) -traditional 352 + AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) 353 + AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 354 + AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 355 + 353 356 354 357 --- 3.9 Dependency tracking 355 358