MESSAGE
DATE | 2021-01-25 |
FROM | Paul Eggert
|
SUBJECT | Re: [Hangout - NYLXS] Future plans for Autotools
|
On 1/25/21 2:59 PM, Gavin Smith wrote: > Does this > work or does GNU make have other ways of doing this? (It would be > better if it could be done without communicating via files.) Is there > any way to set a Makefile variable from within a rule and then depend upon > that variable being set in other rules?
GNU Make supports variables defined via ::=, and an earlier section of a GNU makefile could compute CC and assign to it that way. This would handle the simple case you gave. Unfortunately there are other cases that would require intermediate files with current GNU Make. Still, the overhead in using files would be worth it (at least for me) if we could use make -j.
The ::= feature was added to POSIX ten years ago or so, so it could even be used in Makefiles intended to be portable to other new-enough POSIX-compatible platforms. It wouldn't work on older platforms, though. _______________________________________________ Hangout mailing list Hangout-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/hangout
|
|