in reply to using regular expression to extract subset from a line

What exactly do you know about the part you want to extract? Here's a way that's similar to yours
/.*\s(\.\.\\.*\/makefile)/i;
which will put the matched text in $1. But personally, I'd probably use something like
/-f\s*(\S+)/;
to find whatever text is following the -f switch.