[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 Thu, 2015-11-26 at 03:38 -0700, Jan Beulich wrote:
> > > > 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.

Aha, gotcha now:

$ make clean
[...]
make[3]: Leaving directory 
'/local/scratch/ianc/devel/committer-amd64.git/xen/arch/x86/x86_64'
rm -f *.o *~ core .*.d x86_64/.compat.d x86_64/.mm.d x86_64/.physdev.d 
x86_64/.platform_hypercall.d

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Ian.


_______________________________________________
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®.