2007-09-22 05:04:01 +08:00
|
|
|
function __fish_print_make_targets
|
2012-06-17 19:17:05 +08:00
|
|
|
# Some seds (e.g. on Mac OS X), don't support \n in the RHS
|
|
|
|
# Use a literal newline instead
|
|
|
|
# http://sed.sourceforge.net/sedfaq4.html#s4.1
|
2014-01-30 07:42:52 +08:00
|
|
|
# The 'rev | cut | rev' trick removes everything after the last colon
|
|
|
|
for file in GNUmakefile Makefile makefile
|
|
|
|
if test -f $file
|
2015-09-10 02:55:04 +08:00
|
|
|
__fish_sgrep -h -o -E '^[^#%=$[:space:]][^#%=$]*:([^=]|$)' $file ^/dev/null | rev | cut -d ":" -f 2- | rev | sed -e 's/^ *//;s/ *$//;s/ */\\
|
2012-06-17 19:17:05 +08:00
|
|
|
/g' ^/dev/null
|
2014-01-30 07:42:52 +08:00
|
|
|
# On case insensitive filesystems, Makefile and makefile are the same; stop now so we don't double-print
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
2007-09-22 05:04:01 +08:00
|
|
|
end
|
2014-01-30 07:42:52 +08:00
|
|
|
|