bug-make
[Top][All Lists]
Advanced

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

Re: make falling over builtin rules ?


From: Philip Guenther
Subject: Re: make falling over builtin rules ?
Date: Mon, 16 Mar 2009 11:23:43 -0700

On Mon, Mar 16, 2009 at 6:13 AM, Stefan Seefeld <address@hidden> wrote:
> I have run into a situation where GNU make complains about circular
> dependencies, where there are none:
...
> src.cu.o: %.cu.o: %.cu
>       address@hidden "compiling..."
>
> will result in the message:
>
> make: Circular src.cu <- src.cu.o dependency dropped.
> compiling...
>
> When I replace '.cu' by '.cc', the warning / error message goes away.
> It also goes away if I disable builtin rules (via -r).
>
> Can you please confirm whether this is a GNU make bug, or user error ?

User error.  Generating ${base}.o from ${base} (where base=src.cu in
this case) is a reverse of the normal logic that ${base} is the
executable generated from ${base}.o.  So make is correct: there is
circular dependency.

The correct thing to do is not use the .o suffix in a way that
conflicts with the precedents going back to Unix version 7.

For example, instead of using ".cu.o" and ".cu", use ".cuo" and ".cu".


Philip Guenther




reply via email to

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