Follow-up Comment #6, bug #58556 (project make): I agree this is not right. Here is what happens:
First, the command line is parsed which creates a goal target named ".o". Second, because "-r" was not given, the default rules are created. One of the default rules is the suffix rule for ".o", which sees the already-existing ".o" goal target and applies the recipe to it. Then finally we try to build. Since the ".o" is an actual target now, the code that handles -r as part of MAKEFLAGS has no effect on it. This is clearly not right. It's a little tricky though because GNU make keeps all the different types of targets in the same big bucket of targets indexed by name. So, it's not really possible to have both a target ".o" which is a goal target and a target ".o" which is a suffix rule target, but have them be two different things. I suspect the only way to make it work as the user expects, is to delay the conversion of the command line goals into internal targets until after all makefiles are read in and parsed. POSIX's requirements here are a little tricky. If you have a rule with the target ".o" and the ".o" appears as a member of .SUFFIXES, then that rule is an inference rule not a target rule. If .SUFFIXES does not contain ".o", then the rule is an inference rule not a target rule. So, you don't really know until the entire makefile has been parsed and you know the final value of .SUFFIXES, which it is. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?58556> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/