Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: A bug in GNU make ?

by swl (Parson)
on Aug 27, 2023 at 09:42 UTC ( #11154074=note: print w/replies, xml ) Need Help??

in reply to A bug in GNU make ?

The inclusion of the space is working as documented.


This takes the value of the variable objects, and adds the text ‘another.o’ to it (preceded by a single space, if it has a value already).

Perhaps a better solution is for the GOI Makefile.PL to use a different approach when appending ;build?

Maybe something like (untested): PATH = $(PATH);build

This would in fact be consistent with how the Makefile.PL appends :build to LD_LIBRARY_PATH on unices a few lines later:

Replies are listed 'Best First'.
Re^2: A bug in GNU make ?
by syphilis (Archbishop) on Aug 27, 2023 at 12:54 UTC
    Maybe something like (untested): PATH = $(PATH);build

    I had already tried that, and found it to not work:
    Makefile:1160: *** Recursive variable 'PATH' references itself (eventu +ally). Stop.
    However, encouraged by your suggestion, I went back to it and found that either of the following 2 options do the job as intended:
    PATH := $(PATH);build PATH := ${PATH};build
    Does it seem right that both of those bracket types are acceptable ?

    I've gone with altering the appropriate line in the Makefile.PL to:
    $inherited =~ s/($target)/.IMPORT: PATH\nPATH := \$(PATH);build\n.EXPO +RT: PATH\n$1/;
    I think I'll file a Glib::Object::Introspection bug report, suggesting that this change to the Makefile.PL be made.
    Still interested in hearing opinions regarding the correctness of the way gmake interprets the current form.. (Already answered in the affirmative ... pay attention, Rob ;-)

    Thanks again, swl.


      Does it seem right that both of those bracket types are acceptable ?

      The manual states both bracket types are acceptable. I haven't looked into any history behind it, though.

      And for those wondering about the different assignments operators in GNU make, the := is equivalent to assignment operators in most languages in that variables are evaluated at the time of assignment. Make's = operator defers evaluation until use, which is why Rob's case hit the recursion error. More details are in the linked manual chapter (which I only just read so this is all new to me).

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11154074]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2023-12-11 12:37 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.