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