Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 249271 | Differences between
and this patch

Collapse All | Expand All

(-)bash_completion (-21 / +6 lines)
Lines 2795-2811 Link Here
2795
			fi
2795
			fi
2796
		done
2796
		done
2797
2797
2798
		# make reads `GNUmakefile', then `makefile', then `Makefile'
2799
		if [ -f ${makef_dir}/GNUmakefile ]; then
2800
			makef=${makef_dir}/GNUmakefile
2801
		elif [ -f ${makef_dir}/makefile ]; then
2802
			makef=${makef_dir}/makefile
2803
		elif [ -f ${makef_dir}/Makefile ]; then
2804
			makef=${makef_dir}/Makefile
2805
		else
2806
			makef=${makef_dir}/*.mk	       # local convention
2807
		fi
2808
2809
		# before we scan for targets, see if a Makefile name was
2798
		# before we scan for targets, see if a Makefile name was
2810
		# specified with -f
2799
		# specified with -f
2811
		for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
2800
		for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
Lines 2816-2833 Link Here
2816
			fi
2805
			fi
2817
		done
2806
		done
2818
2807
2819
		[ ! -f $makef ] && return 0
2808
		[[ -n "$makef" ]] && makef="-f ${makef}"
2809
		[[ -n "$makef_dir" ]] && makef_dir="-C ${makef_dir}"
2820
2810
2821
		# deal with included Makefiles
2811
		COMPREPLY=( $( make -qp $makef $makef_dir 2>/dev/null | \
2822
 		makef_inc=$( grep -E '^-?include' $makef | sed -e "s,^.* ,"$makef_dir"/," )
2812
			awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \
2813
			{split($1,A,/ /);for(i in A)print A[i]}' | \
2814
			command grep "^$cur" ))
2823
2815
2824
 		for file in $makef_inc; do
2825
 			[ -f $file ] && makef="$makef $file"
2826
 		done
2827
2828
		COMPREPLY=( $( awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \
2829
				{split($1,A,/ /);for(i in A)print A[i]}' \
2830
				$makef 2>/dev/null | command grep "^$cur" ))
2831
	fi
2816
	fi
2832
} &&
2817
} &&
2833
complete -f -F _make $filenames make gmake gnumake pmake
2818
complete -f -F _make $filenames make gmake gnumake pmake

Return to bug 249271