bug-make
[Top][All Lists]
Advanced

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

Re: possible bug with order rules


From: Noel Yap
Subject: Re: possible bug with order rules
Date: Sun, 09 Nov 2003 17:11:16 -0500

After a little more digging, it looks like mf1 "works" because it's the first 
rule that gets triggered, not the second.  Unfortunately, in my particular 
case, having the first rule triggered will cause the wrong action to take place.

Here's what I see with "gmake -npqr":

# Implicit Rules

../install/%/.:
#  commands to execute (from `mf1', line 4):
        @echo building $(@): $(^)
        

../install/common/%/.: ../install/common/.
#  commands to execute (from `mf1', line 7):
        @echo building $(@): $(^)


For some reason, the order dependency rule is being changed to a normal 
dependency.

Thanks,
Noel

Noel Yap wrote:
> 
> I'm getting the following output:
> 
> $ ls -ld ../install/common/.
> drwxr-x---    5 yapn     morgan         96 Nov  9 16:52 ../install/common/./
> 
> $ ls -ld ../install/common/make/.:
> ls: ../install/common/make/.\:: No such file or directory
> 
> $ cat mf2
> install.DIR := ../install
> 
> $(install.DIR)/common/%/.: | $(install.DIR)/common/.
>         @echo building $(@): $(^)
> 
> $(install.DIR)/%/.:
>         @echo building $(@): $(^)
> 
> $ gmake -f mf2 ../install/common/make/.
> building ../install/common/make/.: ../install/common/.
> 
> I would expect the rule not to have been triggered.
> 
> When I do a "gmake -npqr" on it, I see:
> 
> # Implicit Rules
> 
> ../install/common/%/.: ../install/common/.
> #  commands to execute (from `mf2', line 4):
>         @echo building $(@): $(^)
> 
> Note that the order dependency rule became a normal dependency.
> 
> If I switch the two rules, everything works fine:
> 
> $ cat mf1
> install.DIR := ../install
> 
> $(install.DIR)/%/.:
>         @echo building $(@): $(^)
> 
> $(install.DIR)/common/%/.: | $(install.DIR)/common/.
>         @echo building $(@): $(^)
> 
> $ gmake -f mf1 ../install/common/make/.
> gmake: `../install/common/make/.' is up to date.
> 
> Any ideas?
> 
> Thanks,
> Noel




reply via email to

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