Hi again!

On 01/02/16 21:29, Luke Shumaker wrote:
Here is an "improved" makefile that I think demonstrates the situation
more clearly.

        default: a.foo
        
        %.foo: %.correct
                @echo $@ from $<
        
        %.foo: %.mislead
                @echo $@ from $<
        
        %.correct: %.correct_src
                @echo $@ from $<
        
        %.mislead: %.mislead_src
                @echo $@ from $<
        
        a.correct_src:
                @echo touch $@
        
        # Note that there is no rule to make a.mislead_src
        
        # If the misleading_target line is commented out, 'default' succeeds:
        # > a.correct from correct_src
        # > a.foo from a.correct
        # If the line isn't commented out, 'default' fails:
        # > make: *** No rule to make target 'a.mislead', needed by 'a.foo'.  
Stop.
        misleading_target: a.mislead

I had to work through this several times to convince myself that this
wasn't a simple misunderstanding of trying to apply ≤3.81 pattern
rules in a post-3.82 world.
Without looking at the source, this feels a lot like the
.DELETE_ON_ERROR: bug that was in either 3.81 or 3.82 (I can't
recall which).

A little more info which might be pertinent... In moving to a newer Kubuntu (14.04 to 16.04), I've implicitly switched from GNU Make 3.81 to 4.1. Having hit what is likely the same problem, I had to try out some other versions. Both the code I'm working on now and Luke's test above manifest a problem in 3.82, 4.1 and 4.2.1, but not in 3.81.

Cheers,

Steven

_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to