On 07/08/20 12:29, Alex Bennée wrote:
> It's probing for top-level targets. So if there is a way to query ninja
> for that it's easy enough to write a probe to collect them. The make
> -nqp stuff is a little janky but basically greps for .PHONY patterns and
> assumes a .PHONY target is a top level target. The help parsing is pure
> regexery:
> 
>   (defvar counsel-compile-phony-pattern "^\\.PHONY:[\t ]+\\(.+\\)$"
>     "Regexp for extracting phony targets from Makefiles.")
> 
>   (defvar counsel-compile-help-pattern
>     "\\(?:^\\(\\*\\)?[[:space:]]+\\([^[:space:]]+\\)[[:space:]]+-\\)"
>     "Regexp for extracting help targets from a make help call.")
> 
> I guess I'll have to see what:
> 
>   ninja -t targets all

It would have to grep for "^(.+): phony$".

Paolo


Reply via email to