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
0001520 [Issue 8 drafts] Shell and Utilities Comment Enhancement Request 2021-09-07 09:44 2022-09-08 15:20
Reporter joerg View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied   Product Version Draft 2.1
Name Jörg Schilling
Organization
User Reference
Section make
Page Number 2947-2948
Line Number 98896-98920
Final Accepted Text Note: 0005556
Summary 0001520: make should support the $^ internal macro
Description The $^ internal macro is supported by major make implementations since many
years but it is not mentioned in the POSIX standard.

SunPro Make, smake and gmake support $^ with the same meaning since at
least 25 years.

BSD make supports the same meaning under a different name ($>).
BSD make therefore would just need to add an alias for an existing
feature which seems to be a minor effort.

A possible reason for the missing $^ in POSIX may be that the SunPro Make
implementation supports that internal macro since a long time but did not
document it for unknown reason, causing the impression this may be a
gmake only extension.

Desired Action On page 2947 after line 98895 add:

The $^ macro shall evaluate to the list of prerequisites for the current
target. It shall be evaluated for both target and inference rules.

If the list of prerequisites of the target contains .WAIT pseudo targets,
the .WAIT pseudo targets shall not be part of the list expanded from $^.

On page 2948 after line 98919 add:

$^ member.s2
Tags issue8
Attached Files

- Relationships
related to 0001437Applied 1003.1(2016/18)/Issue7+TC2 make: (document .NOTPARALLEL and .WAIT special targets) in RATIONALE 
related to 0000514Resolvedajosey 1003.1(2008)/Issue 7 Enhance internal macros in make 

-  Notes
(0005495)
joerg (reporter)
2021-09-07 10:39
edited on: 2021-09-07 11:36

I am sorry, I just see that I was mistaken with the occurence of the
.WAIT pseudo target in the list created by $^. It seems that I did
not remember my previous test results correctly and the SunPro Make
documentation is still incomplete even though I enhance it on a
regular base.

SunPro Make includes .WAIT in that $^ list.

BSD make replaces the first .WAIT by .WAIT_1, the second .WAIT by .WAIT_2, ...
and includes that in the $> list.

It may thus need a discussion whether we make the exclusion of .WAIT
from the $^ list optional.

For the SunPro Make case, it would be sufficient to use this:

  $(^:.WAIT=)

instead of jist $^. For this reason, it would make sense to replace:

If the list of prerequisites of the target contains .WAIT pseudo targets,
the .WAIT pseudo targets shall not be part of the list expanded from $^.

by:

If the list of prerequisites of the target contains .WAIT pseudo targets,
it is unspecified whether .WAIT pseudo targets appear in the list expanded
from $^, it is recommended to use $(^:.WAIT=).

... if BSD make would implement $^ in a way that does not modify the .WAIT
entries.

(0005556)
geoffclare (manager)
2021-12-16 17:28

On page 2946 line 98856 change:
shall maintain five internal macros
to:
shall maintain a set of internal macros

On page 2947 line 98883 change:
The five internal macros are:
to:
The internal macros are:

On page 2947 after line 98895 add:
$^
The $^ macro shall evaluate to the list of prerequisites for the current target. It shall be evaluated for both target and inference rules. If the list of prerequisites of the target contain any .WAIT special targets, the results of expanding $^ are unspecified.

For example, in a makefile target rule to build prog from file1.o, file2.o, and file3.o, and regardless of which prerequisites prog is out-of-date with respect to, $^ represents file1.o, file2.o, and file3.o.

On page 2948 after line 98919 add:
$^ member.s2
(0005557)
psmith (developer)
2021-12-16 17:35

I find it odd that we say "the results of expanding $^ are unspecified" if .WAIT appears. Why should the entire expansion be unspecified? Wouldn't it be more accurate to say something like, the appearance of the .WAIT macros in the results are unspecified?
(0005559)
geoffclare (manager)
2021-12-17 12:21

Re Note: 0005557 Joerg pointed out in Note: 0005495 that (in $>) BSD make replaces the first .WAIT by .WAIT_1, the second .WAIT by .WAIT_2, and so on. We decided to allow that behaviour so that BSD make can just make $^ an alias for $>.

- Issue History
Date Modified Username Field Change
2021-09-07 09:44 joerg New Issue
2021-09-07 09:44 joerg Name => Jörg Schilling
2021-09-07 09:44 joerg Section => make
2021-09-07 09:44 joerg Page Number => 2947-2948
2021-09-07 09:44 joerg Line Number => 98896-98920
2021-09-07 09:57 geoffclare Description Updated
2021-09-07 10:39 joerg Note Added: 0005495
2021-09-07 11:23 joerg Note Edited: 0005495
2021-09-07 11:36 joerg Note Edited: 0005495
2021-09-07 11:36 joerg Note Edited: 0005495
2021-12-16 16:57 eblake Relationship added related to 0001437
2021-12-16 17:28 geoffclare Note Added: 0005556
2021-12-16 17:29 geoffclare Final Accepted Text => Note: 0005556
2021-12-16 17:29 geoffclare Status New => Resolved
2021-12-16 17:29 geoffclare Resolution Open => Accepted As Marked
2021-12-16 17:29 geoffclare Tag Attached: issue8
2021-12-16 17:35 psmith Note Added: 0005557
2021-12-17 12:21 geoffclare Note Added: 0005559
2022-01-13 10:25 geoffclare Status Resolved => Applied
2022-09-08 15:20 geoffclare Relationship added related to 0000514


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