Austin Group Bug Tracker
2013-10-10 02:18:06 UTC
The following issue has been SUBMITTED.
======================================================================
http://austingroupbugs.net/view.php?id=763
======================================================================
Reported By: dwheeler
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 763
Category: Shell and Utilities
Type: Clarification Requested
Severity: Editorial
Priority: normal
Status: Under Review
Name: David A. Wheeler
Organization:
User Reference:
Section: make
Page Number: 2911
Line Number: 95628-95636
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2013-10-10 02:18 UTC
Last Modified: 2013-10-10 02:18 UTC
======================================================================
Summary: If rule has no prerequisites or commands, and target
is non-existent, imagine it's been updated
Description:
Many people want to have "make" dependencies automatically generated.
However, many tools and approaches (such as automake) that do this depend
on a poorly-documented interpretation of make's specification. I'd like to
see this interpretation clarified and clearly stated.
As explained in "Advanced Auto-Dependency Generation"
(http://mad-scientist.net/make/autodep.html), it's common to create a
"dependency" file for each source file that contains the dependency
statement for the target. This normally works, but it creates a serious
problem when done the obvious way: "if you remove or rename a prerequisite
file (say a C .h file), make will stop with a fatal error, complaining that
the target doesn't exist".
Tom Tromey found a solution, which appears to be the approach used by
automake. IF you mention the file as a target in the makefile with no
commands and no prerequisites, then if the file doesn't exist, make is
supposed to silently pretend it was recreated. The same approach is
recommended here: http://scottmcpeak.com/autodepend/autodepend.html (and
probably many other places).
This solution works in GNU make, and I suspect it works in many makes.
However, this solution assumes a particular interpretation of the rules in
make's "EXTENDED DESCRIPTION" that is not immediately obvious from the
POSIX text (at best).
I'd like to see this stated clearly, so that it can be relied on by systems
that automatically generate dependencies.
Desired Action:
After "If there are no commands listed for the target, the target shall be
treated as up-to-date." append the following:
"If a target has no prerequisites or commands, and the target of the rule
is a nonexistent file, then `make' imagines this target to have been
updated whenever its rule is run. This implies that all targets depending
on this one will always have their commands run."
(Note that this text is similar to the GNU make section 4.7 text:
http://www.gnu.org/software/make/manual/html_node/Force-Targets.html).
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-10-10 02:18 dwheeler New Issue
2013-10-10 02:18 dwheeler Status New => Under Review
2013-10-10 02:18 dwheeler Assigned To => ajosey
2013-10-10 02:18 dwheeler Name => David A. Wheeler
2013-10-10 02:18 dwheeler Section => make
2013-10-10 02:18 dwheeler Page Number => 2911
2013-10-10 02:18 dwheeler Line Number => 95628-95636
======================================================================
======================================================================
http://austingroupbugs.net/view.php?id=763
======================================================================
Reported By: dwheeler
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 763
Category: Shell and Utilities
Type: Clarification Requested
Severity: Editorial
Priority: normal
Status: Under Review
Name: David A. Wheeler
Organization:
User Reference:
Section: make
Page Number: 2911
Line Number: 95628-95636
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2013-10-10 02:18 UTC
Last Modified: 2013-10-10 02:18 UTC
======================================================================
Summary: If rule has no prerequisites or commands, and target
is non-existent, imagine it's been updated
Description:
Many people want to have "make" dependencies automatically generated.
However, many tools and approaches (such as automake) that do this depend
on a poorly-documented interpretation of make's specification. I'd like to
see this interpretation clarified and clearly stated.
As explained in "Advanced Auto-Dependency Generation"
(http://mad-scientist.net/make/autodep.html), it's common to create a
"dependency" file for each source file that contains the dependency
statement for the target. This normally works, but it creates a serious
problem when done the obvious way: "if you remove or rename a prerequisite
file (say a C .h file), make will stop with a fatal error, complaining that
the target doesn't exist".
Tom Tromey found a solution, which appears to be the approach used by
automake. IF you mention the file as a target in the makefile with no
commands and no prerequisites, then if the file doesn't exist, make is
supposed to silently pretend it was recreated. The same approach is
recommended here: http://scottmcpeak.com/autodepend/autodepend.html (and
probably many other places).
This solution works in GNU make, and I suspect it works in many makes.
However, this solution assumes a particular interpretation of the rules in
make's "EXTENDED DESCRIPTION" that is not immediately obvious from the
POSIX text (at best).
I'd like to see this stated clearly, so that it can be relied on by systems
that automatically generate dependencies.
Desired Action:
After "If there are no commands listed for the target, the target shall be
treated as up-to-date." append the following:
"If a target has no prerequisites or commands, and the target of the rule
is a nonexistent file, then `make' imagines this target to have been
updated whenever its rule is run. This implies that all targets depending
on this one will always have their commands run."
(Note that this text is similar to the GNU make section 4.7 text:
http://www.gnu.org/software/make/manual/html_node/Force-Targets.html).
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-10-10 02:18 dwheeler New Issue
2013-10-10 02:18 dwheeler Status New => Under Review
2013-10-10 02:18 dwheeler Assigned To => ajosey
2013-10-10 02:18 dwheeler Name => David A. Wheeler
2013-10-10 02:18 dwheeler Section => make
2013-10-10 02:18 dwheeler Page Number => 2911
2013-10-10 02:18 dwheeler Line Number => 95628-95636
======================================================================