Lines Matching +full:riscv +full:- +full:j +full:- +full:extension
1 # SPDX-License-Identifier: GPL-2.0-only
2 # bash completion for GNU make with kbuild extension -*- shell-script -*-
5 # /usr/share/bash-completion/completions/make, but we do not rely on it.
8 …local -a dirs=("${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/…
11 for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
12 dirs+=("$dir"/bash-completion/completions)
19 if [[ ! -d ${dir} || ${dir} = "${this_dir}" ]]; then
26 if [[ -f ${compfile} ]] && . "${compfile}" &>/dev/null; then
30 set -- $(complete -p make)
32 while [[ $# -gt 1 && "$1" != -F ]]; do
36 if [[ "$1" = -F ]]; then
58 # sub-directories under arch/
59 keywords+=($(find "${srctree}/arch" -mindepth 1 -maxdepth 1 -type d -printf '%P\n'))
60 # architectures hard-coded in the top Makefile
73 if [[ ${c} == *-elfedit && ! -d ${c2} && -x ${c2} ]]; then
79 while read -r c; do
80 if [[ ${c} == *-elfedit ]]; then
83 done < <(compgen -c)
86 _filedir -d
91 # CROSS_COMPILE=~/0day/gcc-14.2.0-nolibc/aarch64-linux/bin/aarch64-linux-
98 # suffix for a particular version. LLVM=-18 uses 'clang-18' etc.
99 while read -r c; do
100 if [[ ${c} == clang-[0-9]* ]]; then
103 done < <(compgen -c)
106 _filedir -d
130 keywords+=(1 --strip-debug --strip-unneeded)
134 _filedir -d
143 COMPREPLY+=($(compgen -W "${keywords[*]}" -- "${cur}"))
146 # Check the -C, -f options and 'source' symlink. Return the source tree we are
153 # see if a path was specified with -C/--directory
155 if [[ ${words[i]} == -@(C|-directory) ]]; then
163 if [[ -z ${cwd} ]]; then
167 # see if a Makefile was specified with -f/--file/--makefile
169 if [[ ${words[i]} == -@(f|-?(make)file) ]]; then
177 if [ -z "${makef_dir}" ]; then
185 if [[ -L ${makef_dir}/source ]]; then
207 if [[ -z ${arch} ]]; then
208 uname_m=$(uname -m)
218 riscv*) arch=riscv ;;
236 # small Makefile to parse obj-* syntax
242 $(foreach m,$(obj-y) $(obj-m) $(obj-),$(foreach s, -objs -y -m -,$($(m:%.o=%$s))) $(m))
251 _init_completion -s || return
258 # by the bash-completion project.
259 if [[ ! -d ${srctree}/kernel || ! -d ${srctree}/Documentation ]]; then
260 if [ -n "${__kbuild_default_make_completion}" ]; then
266 # make options with a parameter (copied from the bash-completion project)
268 --file | --makefile | --old-file | --assume-old | --what-if | --new-file | \
269 --assume-new | -!(-*)[foW])
273 --include-dir | --directory | -!(-*)[ICm])
274 _filedir -d
277 -!(-*)E)
278 COMPREPLY=($(compgen -v -- "$cur"))
281 --eval | -!(-*)[DVx])
284 --jobs | -!(-*)j)
285 COMPREPLY=($(compgen -W "{1..$(($(_ncpus) * 2))}" -- "$cur"))
293 -*)
294 # make options (copied from the bash-completion project)
297 COMPREPLY=($(compgen -W "${opts:-$(_parse_usage "$1")}" -- "$cur"))
298 if [[ ${COMPREPLY-} == *= ]]; then
299 compopt -o nospace
351 if [[ -f ${srctree}/${dir}/Kbuild ]]; then
355 if [[ -f ${srctree}/${dir}/Makefile ]]; then
365 if [[ -n ${kbuild_file} ]]; then
368 "${1}" -n -f - 2>/dev/null))
388 -mindepth 1 -maxdepth 1 -type d -printf '%P/\n' \
389 -o -printf '%P\n' 2>/dev/null))
415 clang-{tidy,analyzer} compile_commands.json
425 kselftest{,-all,-install,-clean,-merge}
438 {,bin,src}{rpm,deb}-pkg
439 {pacman,dir,tar}-pkg
440 tar{,gz,bz2,xz,zst}-pkg
441 perf-tar{,gz,bz2,xz,zst}-src-pkg
444 COMPREPLY=($(compgen -W "${keywords[*]}" -- "${cur}"))
447 if [[ ${COMPREPLY-} == *[=/] || ${COMPREPLY-} =~ ^(KBUILD|KCONFIG)_$ ]]; then
448 compopt -o nospace
451 } && complete -F _make_for_kbuild make