I know that the variable
MAKECMDGOALS In GNU Make will contain the names of final goals for the run, i.e. the targets included on the command line.
However I'd like to check if a target will be made, whether as a goal or as an intermediate step. Is this possible without recursive make runs or some other complicated mechanism? I'd prefer a portable solution (at least to Darwin) but GNU-specific answers are fine too.