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

Re: [Xen-devel] [PATCH] build: fix dependencies for files compiled from their parent directory



>>> On 26.11.15 at 10:51, <ian.campbell@xxxxxxxxxx> wrote:
> On Thu, 2015-11-26 at 00:43 -0700, Jan Beulich wrote:
>> > > > On 25.11.15 at 17:26, <ian.campbell@xxxxxxxxxx> wrote:
>> > On Wed, 2015-11-25 at 09:16 -0700, Jan Beulich wrote:
>> > > The use of $(basename ...) here was wrong (yet I'm sure I tested it).
>> > 
>> > Is the issue here that xen/arch/x86/x86_64/.compat.o.d ought really to
>> > be
>> > xen/arch/x86/.x86_64.compat.o.d?
>> 
>> No, xen/arch/x86/x86_64/.compat.o.d is the correct name. Just
>> that $(dir $(1)).$(basename $(notdir $(1))).d produces
>> xen/arch/x86/x86_64/.compat.d (i.e. strips the .o, which is not in
>> line with $(@D)/.$(@F).d used to generate those files), and hence
>> neither dependency tracking nor cleaning work.
> 
> My tree, which was last built with 98b69a010c24 has:
> 
>     ianc@cosworth    :committer-amd64.git$ find xen -name .\*compat\*
>     xen/arch/x86/.compat.o.d
>     xen/arch/x86/x86_64/.compat.o.d
>     xen/arch/x86/efi/.compat.o.d
>     ianc@cosworth    :committer-amd64.git$ 
> 
> Which is very odd, since the prevailing xen/Rules.mk has:
> 
>     define gendep
>         ifneq ($(1),$(subst /,:,$(1)))
>             DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
>         endif
>     endef
> 
> Which I agree looks as if it should have stripped the .o as you describe,
> but it seems not to have done so. AIUI makes "basename" differs from the
> CLI basename(1) in that the make one will always strip 

You're looking at the wrong thing I'm afraid: How the files get named
depends on the $(@D)/.$(@F).d thing in CFLAGS. What gets put in
$(DEPS) (and hence gets included) depends on the construct above.
So the correctly named files get generated, but they get neither
included for proper dependency checking, nor would they get
deleted by the "clean" rule. And since the inclusion of $(DEPS) has a
minus sign in front, make wouldn't complain about not finding these
files.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.