tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: (b)make: Outputting a huge variable value



17.05.2024 15:50:06 Edgar Fuß <ef%math.uni-bonn.de@localhost>:
>> main: .PHONY
>>     make -V X | wc -c
> Wow, I didn't know that worked.
> 
> How on earth /does/ it work? If a command happens to be "make", make just
> forks without the child process exec()ing anything, so all the make variables
> etc. are inherited?

No, that would be too much magic. While there is some magic that is activated whenever the command contains the string "make" or "${MAKE}", it doesn't go this far.

What happens here is that the child "make -V" reads the complete Makefile again, and after that, it prints the variable value. So no magic, just a bit of duplicate effort.


Home | Main Index | Thread Index | Old Index