=sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget*/translations/zh_CN/kbuild/bash-completionmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/zh_TW/kbuild/bash-completionmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/it_IT/kbuild/bash-completionmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ja_JP/kbuild/bash-completionmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ko_KR/kbuild/bash-completionmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/sp_SP/kbuild/bash-completionmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h%SPDX-License-Identifier: GPL-2.0-onlyh]h%SPDX-License-Identifier: GPL-2.0-only}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhD/var/lib/git/docbuild/linux/Documentation/kbuild/bash-completion.rsthKubhsection)}(hhh](htitle)}(hBash completion for Kbuildh]hBash completion for Kbuild}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThe kernel build system is written using Makefiles, and Bash completion for the `make` command is available through the `bash-completion`_ project.h](hPThe kernel build system is written using Makefiles, and Bash completion for the }(hhhhhNhNubhtitle_reference)}(h`make`h]hmake}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh" command is available through the }(hhhhhNhNubh reference)}(h`bash-completion`_h]hbash-completion}(hhhhhNhNubah}(h]h ]h"]h$]h&]namebash-completionrefuri(https://github.com/scop/bash-completion/uh1hhhˌresolvedKubh project.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hHowever, the Makefiles for the kernel build are complex. The generic completion rules for the `make` command do not provide meaningful suggestions for the kernel build system, except for the options of the `make` command itself.h](h^However, the Makefiles for the kernel build are complex. The generic completion rules for the }(hjhhhNhNubh)}(h`make`h]hmake}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhj command do not provide meaningful suggestions for the kernel build system, except for the options of the }(hjhhhNhNubh)}(h`make`h]hmake}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh command itself.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hTo enhance completion for various variables and targets, the kernel source includes its own completion script at `scripts/bash-completion/make`.h](hqTo enhance completion for various variables and targets, the kernel source includes its own completion script at }(hj8hhhNhNubh)}(h`scripts/bash-completion/make`h]hscripts/bash-completion/make}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8ubh.}(hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThis script provides additional completions when working within the kernel tree. Outside the kernel tree, it defaults to the generic completion rules for the `make` command.h](hThis script provides additional completions when working within the kernel tree. Outside the kernel tree, it defaults to the generic completion rules for the }(hjXhhhNhNubh)}(h`make`h]hmake}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXubh command.}(hjXhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h Prerequisitesh]h Prerequisites}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxhhhhhKubh)}(hThe script relies on helper functions provided by `bash-completion`_ project. Please ensure it is installed on your system. On most distributions, you can install the `bash-completion` package through the standard package manager.h](h2The script relies on helper functions provided by }(hjhhhNhNubh)}(h`bash-completion`_h]hbash-completion}(hjhhhNhNubah}(h]h ]h"]h$]h&]namebash-completionhhuh1hhjhKubhc project. Please ensure it is installed on your system. On most distributions, you can install the }(hjhhhNhNubh)}(h`bash-completion`h]hbash-completion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. package through the standard package manager.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjxhhubeh}(h] prerequisitesah ]h"] prerequisitesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h How to useh]h How to use}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h$You can source the script directly::h]h#You can source the script directly:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh literal_block)}(h%$ source scripts/bash-completion/makeh]h%$ source scripts/bash-completion/make}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhK!hjhhubh)}(hSOr, you can copy it into the search path for Bash completion scripts. For example::h]hROr, you can copy it into the search path for Bash completion scripts. For example:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjhhubj)}(h$ mkdir -p ~/.local/share/bash-completion/completions $ cp scripts/bash-completion/make ~/.local/share/bash-completion/completions/h]h$ mkdir -p ~/.local/share/bash-completion/completions $ cp scripts/bash-completion/make ~/.local/share/bash-completion/completions/}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhK&hjhhubeh}(h] how-to-useah ]h"] how to useah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hDetailsh]hDetails}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK*ubh)}(hGThe additional completion for Kbuild is enabled in the following cases:h]hGThe additional completion for Kbuild is enabled in the following cases:}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjhhubh block_quote)}(hXR- You are in the root directory of the kernel source. - You are in the top-level build directory created by the O= option (checked via the `source` symlink pointing to the kernel source). - The -C make option specifies the kernel source or build directory. - The -f make option specifies a file in the kernel source or build directory. h]h bullet_list)}(hhh](h list_item)}(h3You are in the root directory of the kernel source.h]h)}(hjFh]h3You are in the root directory of the kernel source.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjDubah}(h]h ]h"]h$]h&]uh1jBhj?ubjC)}(hYou are in the top-level build directory created by the O= option (checked via the `source` symlink pointing to the kernel source).h]h)}(hYou are in the top-level build directory created by the O= option (checked via the `source` symlink pointing to the kernel source).h](hSYou are in the top-level build directory created by the O= option (checked via the }(hj_hhhNhNubh)}(h`source`h]hsource}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_ubh( symlink pointing to the kernel source).}(hj_hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK/hj[ubah}(h]h ]h"]h$]h&]uh1jBhj?ubjC)}(hBThe -C make option specifies the kernel source or build directory.h]h)}(hjh]hBThe -C make option specifies the kernel source or build directory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubah}(h]h ]h"]h$]h&]uh1jBhj?ubjC)}(hMThe -f make option specifies a file in the kernel source or build directory. h]h)}(hLThe -f make option specifies a file in the kernel source or build directory.h]hLThe -f make option specifies a file in the kernel source or build directory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjubah}(h]h ]h"]h$]h&]uh1jBhj?ubeh}(h]h ]h"]h$]h&]bullet-uh1j=hhhK.hj9ubah}(h]h ]h"]h$]h&]uh1j7hhhK.hjhhubh)}(hLIf none of the above are met, it falls back to the generic completion rules.h]hLIf none of the above are met, it falls back to the generic completion rules.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjhhubh)}(hThe completion supports:h]hThe completion supports:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjhhubj8)}(h- Commonly used targets, such as `all`, `menuconfig`, `dtbs`, etc. - Make (or environment) variables, such as `ARCH`, `LLVM`, etc. - Single-target builds (`foo/bar/baz.o`) - Configuration files (`*_defconfig` and `*.config`) h]j>)}(hhh](jC)}(h@Commonly used targets, such as `all`, `menuconfig`, `dtbs`, etc.h]h)}(hjh](hCommonly used targets, such as }(hjhhhNhNubh)}(h`all`h]hall}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }(hjhhhNhNubh)}(h `menuconfig`h]h menuconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h`dtbs`h]hdtbs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, etc.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1jBhjubjC)}(h=Make (or environment) variables, such as `ARCH`, `LLVM`, etc.h]h)}(hj4h](h)Make (or environment) variables, such as }(hj6hhhNhNubh)}(h`ARCH`h]hARCH}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6ubh, }(hj6hhhNhNubh)}(h`LLVM`h]hLLVM}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6ubh, etc.}(hj6hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hj2ubah}(h]h ]h"]h$]h&]uh1jBhjubjC)}(h&Single-target builds (`foo/bar/baz.o`)h]h)}(hjoh](hSingle-target builds (}(hjqhhhNhNubh)}(h`foo/bar/baz.o`h]h foo/bar/baz.o}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjqubh)}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK:hjmubah}(h]h ]h"]h$]h&]uh1jBhjubjC)}(h3Configuration files (`*_defconfig` and `*.config`) h]h)}(h2Configuration files (`*_defconfig` and `*.config`)h](hConfiguration files (}(hjhhhNhNubh)}(h `*_defconfig`h]h *_defconfig}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h `*.config`h]h*.config}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK;hjubah}(h]h ]h"]h$]h&]uh1jBhjubeh}(h]h ]h"]h$]h&]jjuh1j=hhhK8hjubah}(h]h ]h"]h$]h&]uh1j7hhhK8hjhhubh)}(hSome variables offer intelligent behavior. For instance, `CROSS_COMPILE=` followed by a TAB displays installed toolchains. The list of defconfig files shown depends on the value of the `ARCH=` variable.h](h9Some variables offer intelligent behavior. For instance, }(hjhhhNhNubh)}(h`CROSS_COMPILE=`h]hCROSS_COMPILE=}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhp followed by a TAB displays installed toolchains. The list of defconfig files shown depends on the value of the }(hjhhhNhNubh)}(h`ARCH=`h]hARCH=}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh variable.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK=hjhhubhtarget)}(h=.. _bash-completion: https://github.com/scop/bash-completion/h]h}(h]bash-completionah ]h"]bash-completionah$]h&]hhuh1jhKAhjhhhh referencedKubeh}(h]detailsah ]h"]detailsah$]h&]uh1hhhhhhhhK*ubeh}(h]bash-completion-for-kbuildah ]h"]bash completion for kbuildah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjRerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}bash-completion](hjesrefids}nameids}(j,j)jjjjj$j!jju nametypes}(j,jjj$juh}(j)hjjxjjj!jjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.