[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 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Â

Just to double check I did:

    $ make --version
    GNU Make 4.0
    Built for x86_64-pc-linux-gnu
    Copyright (C) 1988-2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <    
http://gnu.org/licenses/gpl.html    >
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    ianc@cosworth    :committer-amd64.git$ git clean -fdqx xen/
    ianc@cosworth    :committer-amd64.git$ make -j12 xen -s
    Â__ÂÂ__ÂÂÂÂÂÂÂÂÂÂÂÂ_ÂÂ_ÂÂÂ_____ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ_ÂÂÂÂÂÂÂÂ_ÂÂÂÂÂ_ÂÂÂÂÂÂ
    Â\ \/ /___ _ __ÂÂÂ| || | |___ÂÂ| _ÂÂÂ_ _ __ÂÂ___| |_ __ _| |__ | | ___ 
    Â \ÂÂ// _ \ '_ \ÂÂ| || |_ÂÂÂ/ /_| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
    Â /ÂÂ\ÂÂ__/ | | | |__ÂÂÂ_| / /__| |_| | | | \__ \ || (_| | |_) | |ÂÂ__/
    Â/_/\_\___|_| |_|ÂÂÂÂ|_|(_)_/ÂÂÂÂ\__,_|_| |_|___/\__\__,_|_.__/|_|\___|
    ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
    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$ git grep -A4 define.gendep 
xen/Rules.mk
    xen/Rules.mk:define gendep
    xen/Rules.mk-ÂÂÂÂifneq ($(1),$(subst /,:,$(1)))
    xen/Rules.mk-ÂÂÂÂÂÂÂÂDEPS += $(dir $(1)).$(basename $(notdir $(1))).d
    xen/Rules.mk-ÂÂÂÂendif
    xen/Rules.mk-endef

Maybe the behaviour of basename varies with make versions?

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