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

Re: [Xen-devel] [XEN PATCH v2 02/12] xen/build: Use obj-y += subdir/ instead of subdir-y



On Wed, Jan 29, 2020 at 03:19:05PM +0100, Jan Beulich wrote:
> On 17.01.2020 11:53, Anthony PERARD wrote:
> > +# Handle objects in subdirs
> > +# 
> > ---------------------------------------------------------------------------
> > +# o if we encounter foo/ in $(obj-y), replace it by foo/built_in.o
> > +#   and add the directory to the list of dirs to descend into: $(subdir-y)
> > +__subdir-y := $(filter %/, $(obj-y))
> > +subdir-y   += $(__subdir-y)
> 
> I realize I'll be called guilty of bike-shedding again, and I also
> realize this is the way Linux does it, but what use is the
> intermediate __subdir-y? Linux has no 2nd use, and hence I also
> don't see why we would gain one. I further think according to our
> style there should be no use of tabs here.

I though the extra __subdir-y that Linux does was to do the filtering on
obj-y right way and not at a later time when subdir-y is used. But in
Linux (now that I look more closely at it), subdir-y is initialised with
:= to have the right type, so the extra __subdir-y doesn't appear to be
useful. (And I didn't find any subdir-y=)

So, I'll add a "subdir-y :=" somewhere and remove the need for
__subdir-y. (And hopefully, no one will add a subdir-y=dir somewhere and
break the build.)

As for using space instead of tabs, I can do that. I just need to figure
out how to configure my editor properly to use tab only when needed.

> > +obj-y              := $(patsubst %/, %/built_in.o, $(obj-y))
> > +
> > +subdir-n := $(subdir-n) $(subdir-) \
> > +           $(filter %/, $(obj-n) $(obj-))
> 
> This will easily fit on one line (and isn't anything cloned from
> Linux).

Will do.

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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