Commit faa7bdd7 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: fix the document to use extra-y for vmlinux.lds

The difference between "always" and "extra-y" is that the targets
listed in $(always) are always built, whereas the ones in $(extra-y)
are built only when KBUILD_BUILTIN is set.

So, "make modules" does not build the targets in $(extra-y).

vmlinux.lds is only needed for linking vmlinux. So, adding it to extra-y
is more correct. In fact, arch/x86/kernel/Makefile does this.

Fix the example code.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent c8fb7d7e
...@@ -1269,12 +1269,12 @@ When kbuild executes, the following steps are followed (roughly): ...@@ -1269,12 +1269,12 @@ When kbuild executes, the following steps are followed (roughly):
Example:: Example::
#arch/x86/kernel/Makefile #arch/x86/kernel/Makefile
always := vmlinux.lds extra-y := vmlinux.lds
#Makefile #Makefile
export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
The assignment to $(always) is used to tell kbuild to build the The assignment to extra-y is used to tell kbuild to build the
target vmlinux.lds. target vmlinux.lds.
The assignment to $(CPPFLAGS_vmlinux.lds) tells kbuild to use the The assignment to $(CPPFLAGS_vmlinux.lds) tells kbuild to use the
specified options when building the target vmlinux.lds. specified options when building the target vmlinux.lds.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment