help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding second route through rules


From: Luke Shumaker
Subject: Re: Finding second route through rules
Date: Mon, 01 Feb 2016 16:29:15 -0500
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi Steven,

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.

Having to keep track of the bar's, baz's, qu+x's didn't help either :)
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

Besides changing names, I also moved the "correct" branch up, to
remove the possibility that it was choosing the "mislead" branch
simply because it was listed first, which is what make does if
everything else ties.

I believe that this is a bug, but I'm not Paul.

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).

-- 
Happy hacking,
~ Luke Shumaker

reply via email to

[Prev in Thread] Current Thread [Next in Thread]