Skip to content

Commit d87e47e

Browse files
Cao jinmasahir0y
authored andcommitted
kbuild doc: a bundle of fixes on makefiles.txt
It does several fixes: 1. move the displaced ld example to its reasonable place. 2. add new example for command gzip. 3. fix 2 number errors. 4. fix format of chapter 7.x, make it looks the same as other chapters. Signed-off-by: Cao jin <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent bbfe63b commit d87e47e

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

Documentation/kbuild/makefiles.txt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,14 +1108,6 @@ When kbuild executes, the following steps are followed (roughly):
11081108
ld
11091109
Link target. Often, LDFLAGS_$@ is used to set specific options to ld.
11101110

1111-
objcopy
1112-
Copy binary. Uses OBJCOPYFLAGS usually specified in
1113-
arch/$(ARCH)/Makefile.
1114-
OBJCOPYFLAGS_$@ may be used to set additional options.
1115-
1116-
gzip
1117-
Compress target. Use maximum compression to compress target.
1118-
11191111
Example:
11201112
#arch/x86/boot/Makefile
11211113
LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
@@ -1139,6 +1131,19 @@ When kbuild executes, the following steps are followed (roughly):
11391131
resulting in the target file being recompiled for no
11401132
obvious reason.
11411133

1134+
objcopy
1135+
Copy binary. Uses OBJCOPYFLAGS usually specified in
1136+
arch/$(ARCH)/Makefile.
1137+
OBJCOPYFLAGS_$@ may be used to set additional options.
1138+
1139+
gzip
1140+
Compress target. Use maximum compression to compress target.
1141+
1142+
Example:
1143+
#arch/x86/boot/compressed/Makefile
1144+
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
1145+
$(call if_changed,gzip)
1146+
11421147
dtc
11431148
Create flattened device tree blob object suitable for linking
11441149
into vmlinux. Device tree blobs linked into vmlinux are placed
@@ -1219,7 +1224,7 @@ When kbuild executes, the following steps are followed (roughly):
12191224
that may be shared between individual architectures.
12201225
The recommended approach how to use a generic header file is
12211226
to list the file in the Kbuild file.
1222-
See "7.3 generic-y" for further info on syntax etc.
1227+
See "7.2 generic-y" for further info on syntax etc.
12231228

12241229
--- 6.11 Post-link pass
12251230

@@ -1254,13 +1259,13 @@ A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
12541259
arch/<arch>/include/asm/ to list asm files coming from asm-generic.
12551260
See subsequent chapter for the syntax of the Kbuild file.
12561261

1257-
--- 7.1 no-export-headers
1262+
--- 7.1 no-export-headers
12581263

12591264
no-export-headers is essentially used by include/uapi/linux/Kbuild to
12601265
avoid exporting specific headers (e.g. kvm.h) on architectures that do
12611266
not support it. It should be avoided as much as possible.
12621267

1263-
--- 7.2 generic-y
1268+
--- 7.2 generic-y
12641269

12651270
If an architecture uses a verbatim copy of a header from
12661271
include/asm-generic then this is listed in the file
@@ -1287,7 +1292,7 @@ See subsequent chapter for the syntax of the Kbuild file.
12871292
Example: termios.h
12881293
#include <asm-generic/termios.h>
12891294

1290-
--- 7.3 generated-y
1295+
--- 7.3 generated-y
12911296

12921297
If an architecture generates other header files alongside generic-y
12931298
wrappers, generated-y specifies them.
@@ -1299,7 +1304,7 @@ See subsequent chapter for the syntax of the Kbuild file.
12991304
#arch/x86/include/asm/Kbuild
13001305
generated-y += syscalls_32.h
13011306

1302-
--- 7.5 mandatory-y
1307+
--- 7.4 mandatory-y
13031308

13041309
mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
13051310
to define the minimum set of headers that must be exported in

0 commit comments

Comments
 (0)