Lines Matching +refs:is +refs:pre +refs:merge

21 The top Makefile is responsible for building two major products: vmlinux
62 This document is aimed towards normal developers and arch developers.
76 Section `Goal definitions`_ is a quick intro; further chapters provide
92 This tells kbuild that there is one object in that directory, named
95 If foo.o shall be built as a module, the variable obj-m is used.
96 Therefore the following pattern is often used:
103 If CONFIG_FOO is neither y nor m, then the file will not be compiled
114 ``$(AR) rcSTP`` to merge these files into one built-in.a file.
115 This is a thin archive without a symbol table. It will be later
118 The order of files in $(obj-y) is significant. Duplicates in
122 Link order is significant, because certain functions
153 If a kernel module is built from several source files, you specify
196 There is also the possibility to list objects that will
215 actually recognize that there is a lib.a being built, the directory
220 Use of lib-y is normally restricted to ``lib/`` and ``arch/*/lib``.
225 A Makefile is only responsible for building objects in its own
240 If CONFIG_EXT2_FS is set to either "y" (built-in) or "m" (modular)
255 It is very likely a bug of the Makefile or of dependencies in Kconfig.
258 descending into subdirectories. It is a good fit when you know they
259 do not contain kernel-space objects at all. A typical usage is to let
270 syntax is always used for directories.
272 It is good practice to use a ``CONFIG_`` variable when assigning directory
274 corresponding ``CONFIG_`` option is neither "y" nor "m".
286 The linker script for vmlinux is located at
296 Kbuild skips extra-y when vmlinux is apparently not a final goal.
300 in the next section) is the correct syntax to use.
323 They are still supported but their usage is deprecated.
333 This variable is necessary because the top Makefile owns the
353 The difference is that the subdir- variants have effect for the kbuild
375 part has a literal value which specifies the file that it is for.
387 $(AFLAGS_$@) is a similar feature for source files in assembly
416 not provide the required support. A typical example is
422 Kbuild is not executing in the directory where the Makefile is
429 $(src) is a relative path which points to the directory
430 where the Makefile is located. Always use $(src) when
434 $(obj) is a relative path which points to the directory
435 where the target is saved. Always use $(obj) when
444 This is a custom rule, following the normal syntax
453 echoing information to user in a rule is often a good practice
457 text following $(kecho) to stdout except if ``make -s`` is used.
464 @$(kecho) ' Kernel: $(boot)/$@ is ready'
466 When kbuild is executing with KBUILD_VERBOSE unset, then only a shorthand
467 of a command is normally displayed.
492 When the rule is evaluated, timestamps are compared between the target
494 prerequisites is newer than that.
497 since the last invocation. This is not supported by Make itself, so
500 if_changed is the macro used for this purpose, in the following form::
512 If the target is already listed in the recognized syntax such as
520 Note: It is a typical mistake to forget the FORCE prerequisite.
521 Another common pitfall is that whitespace is sometimes significant; for
532 unwanted results when the target is up to date and only the
541 $(CC) is usually the gcc compiler, but other alternatives are
545 as-option is used to check if $(CC) -- when used to compile
547 second option may be specified if the first option is not supported.
555 -Wa$(comma)-isa=$(isa-y) if it is supported by $(CC).
556 The second argument is optional, and if supplied will be used
557 if first argument is not supported.
566 cc-option is used to check if $(CC) supports a given option, and if
576 The second argument to cc-option is optional, and if omitted,
577 cflags-y will be assigned no value if first option is not supported.
581 cc-option-yn is used to check if gcc supports a given option
591 In the above example, $(biarch) is set to y if $(CC) supports the -m32
600 the commandline switch to disable it. This special function is needed, function
602 warn about it if there is another warning in the source file.
612 gcc-min-version tests if the value of $(CONFIG_GCC_VERSION) is greater than
619 In this example, cflags-y will be assigned the value -foo if $(CC) is gcc and
620 $(CONFIG_GCC_VERSION) is >= 7.1.
623 clang-min-version tests if the value of $(CONFIG_CLANG_VERSION) is greater
630 In this example, cflags-y will be assigned the value -foo if $(CC) is clang
631 and $(CONFIG_CLANG_VERSION) is >= 11.0.0.
634 cc-cross-prefix is used to check if there exists a $(CC) in path with
636 prefix$(CC) in the PATH is returned - and if no prefix$(CC) is found
637 then nothing is returned.
642 This functionality is useful for architecture Makefiles that try
646 It is recommended only to try to set CROSS_COMPILE if it is a cross
647 build (host arch is different from target arch). And if CROSS_COMPILE
648 is already set then leave it with the old value.
663 ld-option is used to check if $(LD) supports the supplied option.
666 The second argument is an optional option that can be used if the
667 first option is not supported by $(LD).
681 as invoking ./scripts/checkpatch.pl, it is recommended to set execute
702 The first step is to tell kbuild that a host program exists. This is
705 The second step is to add an explicit dependency to the executable.
713 In some cases there is a need to compile and run a program on the
714 computer where the build is running.
723 Kbuild assumes in the above example that bin2hex is made from a single
731 The syntax used to define composite objects for host programs is
743 files. In the above example, checklist.c is compiled to checklist.o
744 and lxdialog.c is compiled to lxdialog.o.
747 Note: The syntax <executable>-y is not permitted for host-programs.
753 introduced solely to support kconfig, and is not recommended
762 In the example above the executable is composed of the C++ file
765 If qconf is composed of a mixture of .c and .cc files, then an
779 since a Rust toolchain is not mandatory for kernel compilation,
780 it may only be used in scenarios where Rust is required to be
781 available (e.g. when ``CONFIG_RUST`` is enabled).
795 When compiling host programs, it is possible to set specific flags.
808 is used:
815 It is also possible to specify additional options to the linker.
831 This is possible in two ways:
843 $(obj)/gen-devlist is updated. Note that references to
848 When there is no suitable custom rule, and the host program
849 shall be built when a makefile is entered, the always-y
872 The syntax is quite similar. The difference is to use ``userprogs`` instead of
885 Kbuild assumes in the above example that bpf-direct is made from a
893 The syntax used to define composite objects for userspace programs is
905 files. In the above example, bpf-fancy.c is compiled to bpf-fancy.o
906 and bpf-helper.c is compiled to bpf-helper.o.
909 Note: The syntax <executable>-y is not permitted for userspace programs.
914 When compiling userspace programs, it is possible to set specific flags.
927 is used:
933 It is also possible to specify additional options to the linker.
962 $(obj)/bpfilter_umh is built before $(obj)/bpfilter_umh_blob.o
982 is compiled. This includes generated files such as host programs.
987 source tree when ``make clean`` is executed.
1006 is not sufficient this sometimes needs to be explicit.
1014 directory compressed/ when ``make clean`` is executed.
1016 Note 1: arch/$(SRCARCH)/Makefile cannot use ``subdir-``, because that file is
1030 arch/$(SRCARCH)/Makefile contains what is required to set up kbuild
1051 5) All object files are then linked and the resulting file vmlinux is
1068 Often specifying the emulation is sufficient.
1081 LDFLAGS_vmlinux is used to specify additional flags to pass to
1094 When $(call if_changed,objcopy) is used to translate a .o file,
1097 $(call if_changed,objcopy) is often used to generate raw binaries on
1109 In this example, the binary $(obj)/image is a binary version of
1167 is handled in ``scripts/generate_rust_target.rs``.
1178 $(KBUILD_AFLAGS_MODULE) is used to add arch-specific options that
1192 $(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that
1206 $(KBUILD_RUSTFLAGS_MODULE) is used to add arch-specific options that
1214 $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
1215 used when linking modules. This is often a linker script.
1237 The archheaders: rule is used to generate header files that
1240 It is run before ``make archprepare`` when run on the
1246 The archprepare: rule is used to list prerequisites that need to be
1249 This is usually used for header files containing assembler constants.
1266 which specify how to build the vmlinux file. Note that there is no
1268 machinery is all architecture-independent.
1302 It is common to locate any additional processing in a boot/
1309 The recommended approach is to include shortcuts in
1320 ``$(Q)$(MAKE) $(build)=<dir>`` is the recommended way to invoke
1334 When make is executed without arguments, the first goal encountered
1336 is all:.
1339 In ``make help``, the default goal is highlighted with a ``*``.
1349 When ``make`` is executed without arguments, bzImage will be built.
1358 Link target. Often, LDFLAGS_$@ is used to set specific options to ld.
1380 The ``: %: %.o`` part of the prerequisite is a shorthand that
1384 It is a common mistake to forget the ``targets :=`` assignment,
1423 When the vmlinux image is built, the linker script
1424 arch/$(SRCARCH)/kernel/vmlinux.lds is used.
1426 The script is a preprocessed variant of the file vmlinux.lds.S
1436 The assignment to extra-y is used to tell kbuild to build the
1447 Note that the full filename is used in this
1450 The kbuild infrastructure for ``*lds`` files is used in several
1459 The recommended approach how to use a generic header file is
1483 The kernel includes a set of headers that is exported to userspace.
1484 Many headers can be exported as-is but other headers require a
1485 minimal pre-processing before they are ready for user-space.
1487 The pre-processing does:
1505 no-export-headers is essentially used by include/uapi/linux/Kbuild to
1513 include/asm-generic then this is listed in the file
1523 file is generated in the directory::
1527 When a header is exported where the architecture uses
1528 the generic header a similar wrapper is generated as part
1556 mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild
1559 This works like optional generic-y. If a mandatory header is missing
1577 $(EXTRAVERSION) defines an even tinier sublevel for pre-patches
1578 or additional patches. It is usually some non-numeric string
1579 such as "-pre4", and is often blank.
1582 $(KERNELRELEASE) is a single string such as "2.4.0-pre4", suitable
1601 directories are biarch, that is, a single ``arch/*/`` directory supports
1615 installation. This variable is not defined in the Makefile but
1624 If this variable is specified, it will cause modules to be stripped
1625 after they are installed. If INSTALL_MOD_STRIP is "1", then the
1650 into the left-hand side. ``=`` is like a formula definition; it stores the
1652 time the left-hand side is used.
1654 There are some cases where ``=`` is appropriate. Usually, though, ``:=``
1655 is the right choice.