2016-12-07 10:05:14 +00:00
|
|
|
function __fish_print_make_targets --argument directory
|
|
|
|
# Since we filter based on localized text, we need to ensure the
|
|
|
|
# text will be using the correct locale.
|
|
|
|
set -lx LC_ALL C
|
|
|
|
|
|
|
|
if test -z "$directory"
|
|
|
|
set directory '.'
|
|
|
|
end
|
|
|
|
|
|
|
|
set -l bsd_make
|
|
|
|
if make -C $directory -pn >/dev/null ^/dev/null
|
|
|
|
set bsd_make 0
|
|
|
|
else
|
|
|
|
set bsd_make 1
|
|
|
|
end
|
|
|
|
|
|
|
|
for file in $directory/{GNUmakefile,Makefile,makefile}
|
2016-11-28 05:27:22 +00:00
|
|
|
if test -f $file
|
2016-12-07 10:05:14 +00:00
|
|
|
if test "$bsd_make" = 0
|
|
|
|
make -C $directory -prRn | awk -v RS= -F: '/^# Files/,/^# Finished Make data base/ {if ($1 !~ "^[#.]") {print $1}}' ^/dev/null
|
|
|
|
else
|
|
|
|
make -C $directory -d g1 -rn >/dev/null ^| awk -F, '/^#\*\*\* Input graph:/,/^$/ {if ($1 !~ "^#... ") {gsub(/# /,"",$1); print $1}}' ^/dev/null
|
|
|
|
end
|
2016-11-28 05:27:22 +00:00
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
2007-09-21 21:04:01 +00:00
|
|
|
end
|
2014-01-29 23:42:52 +00:00
|
|
|
|