On Tue, 2009-09-08 at 13:02 -0700, Warren Dodge wrote:
> I have attached a small tree of files which will show what we are trying
> to do. It has the "runit" script which will process through the
> combinations and save the results in log files.

I have looked at your examples.  I'm not sure why the obvious, and
recommended by the manual, change was not used; it worked fine for me.
This is a completely trivial transposition of EXACTLY the same code that
used to be present in the recipe.  You can keep or throw away TAB
characters; TABs that appear within a logical line (a backslash on the
previous physical line includes the next physical line as a logical
line) are not significant to make:

The original was:

$(MACROS): %.v: $(SYNDIR)/%.v %.pwrports
        @echo '--------------------' ; echo "Making $@"
        ${PERL} -pe '\
            beg...@pwr = split /\n/, `cat $(word 2,$^)`;} \
            { if (/^\s*\);/){\
                foreach $$i (@pwr){ print "  , $$i\n"; }\
              }\
              if (/^\s*endmodule\b/){\
                foreach $$i (@pwr){ print "  input $$i;\n"; }\
              }\
            }' $(word 1,$^) > $@
        mv $@ $...@.last
        -diff $...@.last $...@.master

and I changed this to:

PERL_SCRIPT = \
            beg...@pwr = split /\n/, `cat $(word 2,$^)`;} \
            { if (/^\s*\);/){\
                foreach $$i (@pwr){ print "  , $$i\n"; }\
              }\
              if (/^\s*endmodule\b/){\
                foreach $$i (@pwr){ print "  input $$i;\n"; }\
              }\
            }
$(MACROS): %.v: $(SYNDIR)/%.v %.pwrports
        @echo '--------------------' ; echo "Making $@"
        ${PERL} -pe '$(PERL_SCRIPT)' $(word 1,$^) > $@
        mv $@ $...@.last
        -diff $...@.last $...@.master

(note you can include the single quotes in the PERL_SCRIPT variable
instead if you want; it works the same either way--quotes are not
significant to make).

This works fine with ANY version of GNU make (or, as far as I'm aware,
any other implementation of make).


For the problems you found let me just say firstly, and I hope folks
don't take this the wrong way, that any failure in 3.80 to behave
properly is not that interesting to me except as a curiosity.  Certainly
we aren't going to go back and release "3.80.1" that fixes these
problems.

The issue you ran into with a target-specific variable in 3.81 (T2 in
your example) is interesting.  In this case we're parsing a variable,
BUT it's being interpreted as a recipe (in that backslash newlines
aren't being condensed).  I can kind of see how that might happen.  I
do, I guess, think this is a bug.  A variable assignment should be
parsed as a variable assignment, even if it's target-specific.  I'll
have to try to reproduce this with the current development code.



_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to