@@ -11,7 +11,7 @@ This document describes the Linux kernel Makefiles.
11
11
--- 3.2 Built-in object goals - obj-y
12
12
--- 3.3 Loadable module goals - obj-m
13
13
--- 3.4 Objects which export symbols
14
- --- 3.5 Library file goals - L_TARGET
14
+ --- 3.5 Library file goals - lib-y
15
15
--- 3.6 Descending down in directories
16
16
--- 3.7 Compilation flags
17
17
--- 3.8 Command line dependency
@@ -214,20 +214,33 @@ more details, with real examples.
214
214
modules exporting symbols.
215
215
See also Documentation/modules.txt.
216
216
217
- --- 3.5 Library file goals - L_TARGET
217
+ --- 3.5 Library file goals - lib-y
218
218
219
- Instead of building a built-in.o file, you may also
220
- build an archive which again contains objects listed in $(obj-y).
221
- This is normally not necessary and only used in lib/ and
222
- arch/$(ARCH)/lib directories.
223
- Only the name lib.a is allowed.
219
+ Objects listed with obj-* is used for modules or
220
+ are combined in a built-in.o for that specific directory.
221
+ There is also the possibility to list objects that will
222
+ be included in a library, lib.a.
223
+ All objects listed with lib-y are combined in a single
224
+ library for that directory.
225
+ Objects that are listed in obj-y and additional listed in
226
+ lib-y will not be included in the library, since they will anyway
227
+ be accessible.
228
+ For consistency objects listed in lib-m will be included in lib.a.
229
+
230
+ Note that the same kbuild makefile may list files to be built-in
231
+ and to be part of a library. Therefore the same directory
232
+ may contain both a built-in.o and a lib.a file.
224
233
225
234
Example:
226
235
#arch/i386/lib/Makefile
227
- L_TARGET := lib.a
228
- obj-y := checksum.o delay.o
236
+ lib-y := checksum.o delay.o
229
237
230
238
This will create a library lib.a based on checksum.o and delay.o.
239
+ For kbuild to actually recognize that there is a lib.a being build
240
+ the directory shall be listed in libs-y.
241
+ See also "6.3 List directories to visit when descending".
242
+
243
+ Usage of lib-y is normally restricted to lib/ and arch/*/lib.
231
244
232
245
--- 3.6 Descending down in directories
233
246
@@ -727,7 +740,7 @@ When kbuild executes the following steps are followed (roughly):
727
740
head-y, init-y, core-y, libs-y, drivers-y, net-y
728
741
729
742
$(head-y) list objects to be linked first in vmlinux.
730
- $(libs-y) list directories where a libs .a archive can be located.
743
+ $(libs-y) list directories where a lib .a archive can be located.
731
744
The rest list directories where a built-in.o object file can be located.
732
745
733
746
$(init-y) objects will be located after $(head-y).
0 commit comments