X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Documentation%2Fkbuild%2Fmakefiles.txt;h=1075e4de239ea089a7bbcfbd966e30d40309be77;hb=9e1bf581d67d87a1d7fc0ea500729e3a03643a26;hp=2616a58a5a4b829a3fb951e305cf6af37aee4cfa;hpb=8d40237c730b8be87c1b80a5d96b9c603fefa829;p=linux-2.6.git diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 2616a58a5..1075e4de2 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -6,7 +6,7 @@ This document describes the Linux kernel Makefiles. === 1 Overview === 2 Who does what - === 3 The kbuild files + === 3 The kbuild Makefiles --- 3.1 Goal definitions --- 3.2 Built-in object goals - obj-y --- 3.3 Loadable module goals - obj-m @@ -101,14 +101,11 @@ These people need to know about all aspects of the kernel Makefiles. This document is aimed towards normal developers and arch developers. -=== 3 The kbuild files +=== 3 The kbuild Makefiles Most Makefiles within the kernel are kbuild Makefiles that use the kbuild infrastructure. This chapter introduce the syntax used in the kbuild makefiles. -The preferred name for the kbuild files is 'Kbuild' but 'Makefile' will -continue to be supported. All new developmen is expected to use the -Kbuild filename. Section 3.1 "Goal definitions" is a quick intro, further chapters provide more details, with real examples. @@ -710,17 +707,15 @@ When kbuild executes the following steps are followed (roughly): probe supported options: #arch/i386/Makefile + check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc \ + /dev/null\ > /dev/null 2>&1; then echo "$(1)"; \ + else echo "$(2)"; fi) + cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,\ + -march=c3,-march=i486) - ... - cflags-$(CONFIG_MPENTIUMII) += $(call cc-option,\ - -march=pentium2,-march=i686) - ... - # Disable unit-at-a-time mode ... - CFLAGS += $(call cc-option,-fno-unit-at-a-time) - ... - + CFLAGS += $(cflags-y) - The first examples utilises the trick that a config option expands + The above examples both utilise the trick that a config option expands to 'y' when selected. CFLAGS_KERNEL $(CC) options specific for built-in @@ -1002,21 +997,6 @@ When kbuild executes the following steps are followed (roughly): option. When $(biarch) equals to y the expanded variables $(aflags-y) and $(cflags-y) will be assigned the values -a32 and -m32. - cc-option-align - gcc version >= 3.0 shifted type of options used to speify - alignment of functions, loops etc. $(cc-option-align) whrn used - as prefix to the align options will select the right prefix: - gcc < 3.00 - cc-option-align = -malign - gcc >= 3.00 - cc-option-align = -falign - - Example: - CFLAGS += $(cc-option-align)-functions=4 - - In the above example the option -falign-functions=4 is used for - gcc >= 3.00. For gcc < 3.00 -malign-functions=4 is used. - cc-version cc-version return a numerical version of the $(CC) compiler version. The format is where both are two digits. So for example