On Thu, 2015-11-26 at 00:43 -0700, Jan Beulich wrote:
> > > > On 25.11.15 at 17:26, <ian.campb...@citrix.com> 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@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to