Project

General

Profile

Actions

Feature #14661

open

make: consider binding $< always

Added by Rich Lowe 2 months ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
tools - gate/build tools
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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

Related to illumos gate - Bug #14589: make(1) should document $^In ProgressAndy Fiddaman

Actions
Actions #1

Updated by Rich Lowe 2 months ago

  • Related to Bug #14589: make(1) should document $^ added
Actions #2

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!

Actions #3

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.

Actions

Also available in: Atom PDF