View Issue Details

IDProjectCategoryView StatusLast Update
0001626Issue 8 draftsShell and Utilitiespublic2024-06-11 09:12
Reporterilliliti Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
Product VersionDraft 2.1 
NameMark Lundblad
Organization
User Reference
Sectionmake
Page Number2945
Line Number98797
Final Accepted Text0001626:0006130
Summary0001626: Reconsider CURDIR macro
Description0000338 rejected CURDIR macro due to lack of consensus. However, since current standard has no simple and reliable way to replicate it, I propose to reconsider this decision.

I've checked some implementations and found no serious incompatibilities that would prevent CURDIR from standardizing. The GNU make and smake(from schilytools) provide this macro as extension and both compatible with each other, whereas *BSD make requires leading dot(.CURDIR) and has special handling for PWD environment variable, but despite that it is semantically compatible with GNU make and smake because its CURDIR will always point to the current working directory and that's all we need. So BSD make can simply alias CURDIR to .CURDIR and be compatible with the rest implementations.

As of related -C option, I decided to omit it in this proposal because it requires more work regarding how -f option should work with it, how MAKE macro should be affected, etc... It is simply more than one addition and thus I believe it should be discussed in a separate proposal.
Desired ActionOn page 2945 line 98797, add a new paragraph:


The CURDIR macro shall be treated specially. It shall be provided by make and set
to the pathname of the directory where make was executed. The CURDIR environment variable shall not affect the value of the CURDIR macro. If CURDIR is defined in the makefile or is specified on the command line, it shall replace the original value of the CURDIR macro, but shall not cause make to change its current working directory.
Tagsissue8

Activities

geoffclare

2023-01-23 17:22

manager   bugnote:0006130

On page 2944 line 98775 section make, change:
Other implementation-defined options and macros may also be added to the MAKEFLAGS macro.
to:
Other implementation-defined options and macros, with the exception of the CURDIR macro, may also be added to the MAKEFLAGS macro.

After page 2945 line 98797 section make, add a new paragraph:
The CURDIR macro shall be treated specially. It shall be provided by make and set to an absolute pathname of the current working directory when make is executed. The value shall be the same as the pathname that would be output by the pwd utility with either the -L or -P option; if they differ, it is unspecified which value is used. The CURDIR environment variable shall not affect the value of the CURDIR macro unless the -e option is specified. If the -e option is not specified, there is a CURDIR environment variable set, and its value is different from the CURDIR macro value, the environment variable value shall be set to the macro value. If CURDIR is defined in the makefile, present in the MAKEFLAGS environment variable, or specified on the command line, it shall replace the original value of the CURDIR macro in accordance with the logical order described above, but shall not cause make to change its current working directory.

Issue History

Date Modified Username Field Change
2023-01-04 22:25 illiliti New Issue
2023-01-04 22:25 illiliti Name => Mark Lundblad
2023-01-04 22:25 illiliti Section => make
2023-01-04 22:25 illiliti Page Number => 2945
2023-01-04 22:25 illiliti Line Number => 98797
2023-01-23 17:22 geoffclare Note Added: 0006130
2023-01-23 17:23 geoffclare Final Accepted Text => 0001626:0006130
2023-01-23 17:23 geoffclare Status New => Resolved
2023-01-23 17:23 geoffclare Resolution Open => Accepted As Marked
2023-01-23 17:24 geoffclare Tag Attached: issue8
2023-03-10 10:51 geoffclare Status Resolved => Applied
2024-06-11 09:12 agadmin Status Applied => Closed