On Sat, Dec 18, 2004 at 08:17:26AM -0500, Randy W. Sims wrote:
dmake test TEST_VERBOSE=1 dmake.exe: makefile: line 807: Warning -- Macro `TEST_VERBOSE' cannot be redefined ...
Manually changing the generated F<Makefile> to use the C<MACRO *= LINE>
form of assignment fixes the problem. But that seems like a PITA to have to specify this alternative syntax for all possible commandline macros. How is MakeMaker different now than before?
Did a little checking. I get the same warning with MakeMaker going back to 5.47...
Thanks. I poked around in the docs and couldn't find any way to shut off the warnings without also suppressing all echoing of commands (-s, BTW).
I don't think its possible to fix this at all. If I'm reading the docs right, if I changed it to:
TEST_VERBOSE += 0
and one did "make test TEST_VERBOSE=1" you'd wind up with "10"
So I'm going to declare dmake braindead on this issue and move on.
Just for clarification, if you want to document it, the correct form would be:
TEST_VERBOSE *= 0
despite the misleading documentation. The above can be considered to assign a default value to the macro if the macros is not already defined, eg on the commandline. It's analogous to the perl idiom: C<$var ||= 'value';>
The '+=' form of assignment does not eliminate the warnings.
