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
0000693 [1003.1(2013)/Issue7+TC1] Shell and Utilities Editorial Clarification Requested 2013-05-07 21:06 2019-06-10 08:55
Reporter steffen View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Steffen Nurpmeso
Organization
User Reference
Section XCU, chapter 4, make(1)
Page Number 2941
Line Number 97291-97309
Interp Status Approved
Final Accepted Text Note: 0001631
Summary 0000693: Clarification on export status of make variables
Description Whereas the standard defines exactly the significance of the sources of macros / variables (command line, MAKEFLAGS environment variable, environment content, in the Makefile), it does not talk about the resulting export status of the macro / variable that will be passed down the call chain.
This shell snippet can be used for a quick test:

    #!/bin/sh -
    [ -z "${MAKE}" ] && MAKE=make
    SHELLVAR=shell
    export SHELLVAR MAKE
    cat > t1.make << \!
    SHELLVAR = t1
    all:
        @$(MAKE) -f t2.make all
    !
    cat > t2.make << \!
    all:
        @echo "Should echo t1, but echoes $(SHELLVAR)"
    !
    ${MAKE} -f t1.make all
    rm -f t1.make t2.make

GNU make (3.82, Slackware 14; 3.81, Mac OS X) echoes "t1", FreeBSD 10.0 make(1), NetBSD 6.99.19 make(1), OpenBSD 5.3 make(1) as well as smake(1) 1.2 echo "shell".
Desired Action On page 2941, append to the paragraph on the lines 97306-97309

Macros defined in the makefile(s) shall override macro definitions that occur before them in the makefile(s) and macro definitions from source 4. If the −e option is not specified, macros defined in the makefile(s) shall override macro definitions from source 3. Macros defined in the makefile(s) shall not override macro definitions from source 1 or source 2.

the sentence

The finally chosen macro definition shall be exported into the environment[, and passed down the call chain].
Tags tc2-2008
Attached Files

- Relationships

-  Notes
(0001630)
eblake (manager)
2013-05-30 16:15
edited on: 2013-05-30 16:16

Line 97787 reminds: "Macros are not exported to the environment of commands to be run. This was never the case in any historical make and would have serious consequences. The environment is the same as the environment to make except that MAKEFLAGS and macros defined on the make command line are added." Since the standard does not document 'export' in a makefile, we'd need a lot more wording to add that as a new requirement.

(0001631)
geoffclare (manager)
2013-05-30 16:32
edited on: 2013-06-06 15:26

Interpretation response
------------------------

The standard does not speak to this issue, and as such no conformance
distinction can be made between alternative implementations based on
this. This is being referred to the sponsor.

Rationale:
-------------
None.

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

At page 2942 line 97319 after:

    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. Other
    implementation-defined variables may also be added to the
    environment of make.

append:

    Macros defined by the MAKEFLAGS environment variable and macros
    defined in the makefile(s) shall not be added to the environment
    of make if they are not already in its environment. With the
    exception of SHELL (see below), it is unspecified whether macros
    defined in these ways update the value of an environment variable
    that already exists in the environment of make.

At page 2953 line 97788 change:

    The environment is the same as the environment to make except that
    MAKEFLAGS and macros defined on the make command line are added.

to:

    The environment is the same as the environment to make except that
    MAKEFLAGS and macros defined on the make command line are added,
    and except that macros defined by the MAKEFLAGS environment
    variable and macros defined in the makefile(s) may update the
    value of an existing environment variable (other than SHELL).
    
At page 2954 line 97849 change FUTURE DIRECTIONS from:

    None.

to:

    Some implementations of make include an "export" directive to
    add specified make variables to the environment. This may be
    considered for standardization in a future revision.

(0001810)
ajosey (manager)
2013-09-06 04:55

Interpretation Proposed 6 Sep 2013
(0001891)
ajosey (manager)
2013-10-14 13:06

Interpretation approved 14 October 2013

- Issue History
Date Modified Username Field Change
2013-05-07 21:06 steffen New Issue
2013-05-07 21:06 steffen Name => Steffen Nurpmeso
2013-05-07 21:06 steffen Section => XCU, chapter 4, make(1)
2013-05-07 21:06 steffen Page Number => 2941
2013-05-07 21:06 steffen Line Number => 97291-97309
2013-05-30 16:15 eblake Note Added: 0001630
2013-05-30 16:16 eblake Note Edited: 0001630
2013-05-30 16:32 geoffclare Note Added: 0001631
2013-06-06 15:24 geoffclare Note Edited: 0001631
2013-06-06 15:26 geoffclare Note Edited: 0001631
2013-06-06 15:27 geoffclare Interp Status => Pending
2013-06-06 15:27 geoffclare Final Accepted Text => Note: 0001631
2013-06-06 15:27 geoffclare Status New => Interpretation Required
2013-06-06 15:27 geoffclare Resolution Open => Accepted As Marked
2013-06-06 15:28 geoffclare Tag Attached: tc2-2008
2013-09-06 04:55 ajosey Interp Status Pending => Proposed
2013-09-06 04:55 ajosey Note Added: 0001810
2013-10-14 13:06 ajosey Interp Status Proposed => Approved
2013-10-14 13:06 ajosey Note Added: 0001891
2019-06-10 08:55 agadmin Status Interpretation Required => Closed


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