Closed adrieng closed 11 years ago
Definitely. In fact, I am surprised that it does not work. I guess that Remake is being confused by the presence of both variable assignments. Indeed, if you remove the global one, you get the expected behavior. I will have to take a closer look.
Sorry, forget what I just said, I misunderstood your example.
The current behavior is expected. It is due to the principle that Remake should not allow non-deterministic builds. With Make, the content of file.txt is different depending on the order of your targets on the command line:
make file.txt file_tmp.txt >>> Built with make
make file_tmp.txt file.txt >>> Built with remake
I want to avoid this kind of behavior in Remake. That is why propagation of environment variables along dependencies is not performed.
That said, I have already been submitted patches to that effect, so I may add it, protect it by a preprocessor definition, and disable it by default.
Thanks for your answer.
Since commit fd63920, one can add the following line to Remakefile to achieve this behavior
.OPTIONS = variable-propagation
It seems that in Remake, rule-specific variable assignments do not affect dependencies. For example, the following (Re)Makefile builds a different file.txt when executed with GNU Make:
Make's behavior is useful since it enables things like easy per-executable compiler flags:
Would it be possible for Remake to adopt this part of GNU Make's semantics?