Feature #14661
openmake: consider binding $< always
0%
Description
At preset make(1S) only binds $< when:
The name of a dependency file, derived as if selected for use with an implicit rule.
This means a number of people have used $^ which is always bound (but also is the full dependency list) purely because they can't use $<.
It appears that at least GNU make binds $< for every rule, regardless of whether dependencies are explicit. We should consider doing the same.
Compatibility seems to not be a problem, because in any case where $< is now bound, it would previously be the empty string and -- presumably -- would not have worked.
Related issues
Updated by Rich Lowe 2 months ago
- Related to Bug #14589: make(1) should document $^ added
Updated by Joshua M. Clulow 2 months ago
Compatibility seems to not be a problem, because in any case where $< is now bound, it would previously be the empty string and -- presumably -- would not have worked.
Unless the rule used to work in error, of course, due to the empty expansion!
Updated by Rich Lowe 2 months ago
This was also reported as: https://illumos.org/opensolaris/bugdb/bug.html#!6474905
with similar reasoning to my own. It's been mentioned that perhaps this was hidden behind an environment variable because of the reasoning jclulow points out in comment 2, but I'm not (presently) inclined to think this is a real problem.
If we break a buggy makefile because the makefile was buggy, that's a bug in the makefile.