List goals/targets in GNU make that contain variables in their definition

make -qp | awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ {split($1,A,/ /);for(i in A)print A[i]}'     

Taken from the make arg completion, which works like a charm.


Can you parse the output from make -pn (i.e. make --print-data-base --dry-run)? It prints out all the variables, rules, implicit rules and which commands will be run in laborious detail.