bugmake - Bugs: bug #43677, .DELETE_ON_ERROR doesn't work with...


bug #43677: .DELETE_ON_ERROR doesn't work with patterns for main goal's dependencies

Submitter:  Ivan Boldyrev <monoid>
Submitted:  Mon 24 Nov 2014 06:19:16 AM UTC
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  4.2 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup

Mon 13 Jul 2015 04:56:10 AM UTC, comment #1: 

I've pushed a fix for this into Git; it will be in the next release of GNU make.  Thanks for the report!

Paul D. Smith <psmith>
Group administrator
Mon 24 Nov 2014 06:19:16 AM UTC, original submission:  

This is a sample of Makefile:


bug: c_foobar ;

c_%: a_% b_%
        echo $^ > $@

b_%: a_%
        echo $^ > $@

        false > $@

I tested it with make 3.81 on Ubuntu 12.04 LTS, make 4.0 on Ubuntu 14.04.1 LTS, and make 4.0 on Gentoo.

$ make
false > a_foobar
Makefile:13: recipe for target 'a_foobar' failed
make: *** [a_foobar] Error 1
$ make
echo a_foobar > b_foobar
echo a_foobar b_foobar > c_foobar
rm b_foobar

while when you specify a_foobar directly, it is deleted, as expected:

$ make a_foobar
false > a_foobar
Makefile:13: recipe for target 'a_foobar' failed
make: *** [a_foobar] Error 1
make: *** Deleting file 'a_foobar'

If you replace '%' in Makefile with 'foobar', everything works too, so it seems to be pattern-related problem.

When you call pattern rule directly:

$ make c_foobar
false > a_foobar
Makefile:13: recipe for target 'a_foobar' failed
make: *** [a_foobar] Error 1

(not failing rule, but its parent), it also doesn't remove a_foobar, so it is just pattern handling problem.

Ivan Boldyrev <monoid>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by monoid (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-07-13 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.2

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code