URL: <https://savannah.gnu.org/bugs/?67825>
Summary: $^ is set incorrectly in the case of grouped targets
Group: make
Submitter: joergboe
Submitted: Thu 18 Dec 2025 04:27:57 PM CET
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Unlocked
Component Version: 4.4.1
Operating System: POSIX-Based
Fixed Release: None
Triage Status: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 18 Dec 2025 04:27:57 PM CET By: Anonymous
I have the following Makefile:
MAKEFLAGS += -rR
.RECIPEPREFIX = >
target2 : file2
target1 target2 &: file1
> @echo '$$@ : $@'
> @echo '$$? : $?'
> @echo '$$^ : $^'
> @echo '$$+ : $+'
> @echo '$$< : $<'
> touch target1 target2
file% :
> touch $@
At first I build target2:
> rm target? file?; make target2
touch file1
touch file2
$@ : target2
$? : file1 file2
$^ : file1 file2
$+ : file1 file2
$< : file1
touch target1 target2
This is what I expect; the list of the prerequisites is *file1 file2* and the
list of the 'newer' files is also *file1 file2*.
Now I build target1:
> rm target? file?; make target1
touch file1
touch file2
$@ : target1
$? : file1
$^ : file1
$+ : file1
$< : file1
touch target1 target2
Here the lists are truncated to *file1* only. It seems that the prerequisite
of the first rule *target2 : file2* is not properly propagated to the grouped
target recipe.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67825>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
