re-re-re-re-configuring

Nathanael Nerode neroden@twcny.rr.com
Sun Dec 8 14:53:00 GMT 2002


DJ Delorie wrote:
>>So who broke the make dependencies such that we 
>>re-run configure *every* time you type "make"?
> 
> 
> I debugged this, and the dependencies look right, almost (sigh).
> Basically, it boils down to this:
> 
> .PHONY: configure-libiberty maybe-configure-libiberty
> maybe-configure-libiberty:
> configure-libiberty: libiberty/Makefile
> 
>     Considering target file `all-libiberty'.
>      File `all-libiberty' does not exist.
>       Considering target file `configure-libiberty'.
>        File `configure-libiberty' does not exist.
>         Considering target file `libiberty/Makefile'.
>           Pruning file `config.status'.
>           Pruning file `intl/Makefile'.
>          Finished prerequisites of target file `libiberty/Makefile'.
>          Prerequisite `config.status' is older than target `libiberty/Makefile'.
>          Prerequisite `intl/Makefile' is older than target `libiberty/Makefile'.
>         No need to remake target `libiberty/Makefile'.
>        Finished prerequisites of target file `configure-libiberty'.
>       Must remake target `configure-libiberty'.
>       Successfully remade target file `configure-libiberty'.
>      Finished prerequisites of target file `all-libiberty'.
>     Must remake target `all-libiberty'.
> 
> So, even though configure-libiberty is .PHONY and its prereqs are OK,
> it gets "rebuilt" anyway.  Consequently...
> 
>             Considering target file `bfd/Makefile'.
>               Pruning file `config.status'.
>               Pruning file `configure-libiberty'.
>               Pruning file `opcodes/Makefile'.
>              Finished prerequisites of target file `bfd/Makefile'.
>              Prerequisite `config.status' is older than target `bfd/Makefile'.
>              Prerequisite `configure-libiberty' of target `bfd/Makefile' does not exist.
>              Prerequisite `opcodes/Makefile' is older than target `bfd/Makefile'.
>             Must remake target `bfd/Makefile'.
> 
> Even though configure-libiberty is .PHONY, it was "rebuilt" and so
> bfd/Makefile must also be rebuilt.
Arrrr.  Right.  Phony target problem. :-/

> 
> I did a test changing this line:
> 
> bfd/Makefile: configure-libiberty
> 
> to this:
> 
> configure-bfd: configure-libiberty
 >
 > and it seems to work.  I'll work up a patch.
 >

And the reason I didn't do this was due to a different bug.
If libiberty is changed, then since
configure-bfd: configure-libiberty
configure-bfd: bfd/Makefile

bfd/Makefile won't be regenerated.

The correct solution is to change it to
bfd/Makefile: libiberty/Makefile

which I will work up a simple patch for if nobody beats me to it.

(I'll replace all maybe-configure-X: configure-X dependencies with
maybe-configure-X: X/Makefile dependencies.)



More information about the Binutils mailing list