Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001155 [1003.1(2016/18)/Issue7+TC2] Shell and Utilities Editorial Enhancement Request 2017-07-12 10:36 2019-11-07 09:25
Reporter joerg View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Jörg Schilling
Organization
User Reference
Section make
Page Number 2977
Line Number 98816
Interp Status Approved
Final Accepted Text Note: 0004208
Summary 0001155: Make should mention the special treatment of $(MAKE)
Description While observing a related bug in SunPro Make with the "-r" option, it appears that the POSIX standard does not mention an important feature of the MAKE macro.

The MAKE macro should be (unless overwritten by the user) always automatically set up to a value that allows to call the same make binary again via $(MAKE) ...

If "make" is called as "make", MAKE should contain make.

If "make" is called as "/usr/bin/make", MAKE should containd /usr/bin/make.

If "make" is called as "./make", MAKE should contain "$PWD/make".
Desired Action After line 98815 add a new paragraph with the following text:

The MAKE macro shall be treated specially. It shall be provided by make and set to the pathname or name of the make binary that is running. If MAKE is defined in the makefile or is specified on the command line, it shall replace the original value of the MAKE macro, but shall not affect the MAKE environment variable.
Tags tc3-2008
Attached Files

- Relationships

-  Notes
(0004195)
geoffclare (manager)
2019-01-03 17:25
edited on: 2019-01-14 16:47

OLD Interpretation response (superseded by Note: 0004208)
------------------------
The standard states that the MAKE macro is set to the string make by default, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------
The standard does not match existing practice, which is to set MAKE from argv[0] (and convert to an absolute pathname if necessary).

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
On page 2977 line 98809 section make, change:
Before the makefile(s) are read, all of the make utility command line macro definitions (except the MAKEFLAGS macro or the SHELL macro) shall be added to the environment of make.
to:
Before the makefile(s) are read, all of the make utility command line macro definitions, except for MAKE, MAKEFLAGS and SHELL, shall be added to the environment of make.

On page 2977 after line 98815 add a new paragraph with the following text:
The MAKE macro shall be treated specially. If MAKE is not defined in the environment, it shall be provided by make and set to the value of argv[0] passed to main() (or equivalent, if make is not a C program). If this value contains at least one <slash> and is a relative pathname, make shall convert it to an absolute pathname. If MAKE is defined in the makefile or is specified on the command line, it shall replace the original value of the MAKE macro, but shall not affect the MAKE environment variable.

On page 2977 line 98816-98820 section make, change all occurrences of:
SHELL
to:
SHELL


On page 2980 line 98955 section make Default Rules, delete:
    MAKE=make


(0004198)
agadmin (administrator)
2019-01-08 14:38

Interpretation proposed: 8 Jan 2019
(0004200)
psmith (developer)
2019-01-08 15:32

Can you elaborate on the final part of the replacement text: "but shall not affect the MAKE environment variable"? Where did this come from?

This is not the behavior of, at least, GNU make. The only make variable afforded such treatment in GNU make is SHELL.

If the shell variable MAKE is set before GNU make is invoked, and is also set specifically in the makefile or on the command line, then the MAKE environment variable is changed as well:

    MAKE = foo
    all: ; @echo "make=$(MAKE) env=$$MAKE"

Run normally:

    make
    make=foo env=

Run with MAKE in the environment:

    MAKE=bar make
    make=foo env=foo

In other words, the presence of the environment variable ensures that MAKE is exported to sub-shells BUT it is still overridden like any other variable (except SHELL).
(0004208)
geoffclare (manager)
2019-01-14 16:45

Interpretation response
------------------------
The standard states that the MAKE macro is set to the string make by default, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------
The standard does not match existing practice, which is to set MAKE from argv[0] (and convert to an absolute pathname if necessary).

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

On page 2977 after line 98815 add a new paragraph with the following text:
The MAKE macro shall be treated specially. If MAKE is not defined in the environment, the MAKE macro shall be provided by make and set to the value of argv[0] passed to main() (or equivalent, if make is not a C program). If this value contains at least one <slash> and is a relative pathname, make shall convert it to an absolute pathname. If MAKE is defined in the makefile or is specified on the command line, it shall replace the original value of the MAKE macro.

On page 2977 line 98816-98820 section make, change all occurrences of:
SHELL
to:
SHELL


On page 2980 line 98955 section make Default Rules, delete:
    MAKE=make
(0004210)
agadmin (administrator)
2019-01-16 13:30

(Restarting the interpretation clock)

Interpretation proposed: 16 Jan 2019
(0004259)
agadmin (administrator)
2019-02-19 17:47

Interpretation Approved: 19 Feb 2019

- Issue History
Date Modified Username Field Change
2017-07-12 10:36 joerg New Issue
2017-07-12 10:36 joerg Status New => Under Review
2017-07-12 10:36 joerg Assigned To => ajosey
2017-07-12 10:36 joerg Name => Jörg Schilling
2017-07-12 10:36 joerg Section => make
2017-07-12 10:36 joerg Page Number => 2977
2017-07-12 10:36 joerg Line Number => 98816
2019-01-03 16:14 geoffclare Project 1003.1(2008)/Issue 7 => 1003.1(2016/18)/Issue7+TC2
2019-01-03 17:25 geoffclare Note Added: 0004195
2019-01-03 17:26 geoffclare Interp Status => Pending
2019-01-03 17:26 geoffclare Final Accepted Text => Note: 0004195
2019-01-03 17:26 geoffclare Status Under Review => Interpretation Required
2019-01-03 17:26 geoffclare Resolution Open => Accepted As Marked
2019-01-03 17:26 geoffclare Tag Attached: tc3-2008
2019-01-08 14:38 agadmin Interp Status Pending => Proposed
2019-01-08 14:38 agadmin Note Added: 0004198
2019-01-08 15:32 psmith Note Added: 0004200
2019-01-14 16:11 nick Resolution Accepted As Marked => Reopened
2019-01-14 16:45 geoffclare Note Added: 0004208
2019-01-14 16:47 geoffclare Final Accepted Text Note: 0004195 => Note: 0004208
2019-01-14 16:47 geoffclare Resolution Reopened => Accepted As Marked
2019-01-14 16:47 geoffclare Note Edited: 0004195
2019-01-16 13:30 agadmin Note Added: 0004210
2019-02-19 17:47 agadmin Interp Status Proposed => Approved
2019-02-19 17:47 agadmin Note Added: 0004259
2019-11-07 09:25 geoffclare Status Interpretation Required => Applied


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker