Re: [PATCH v3 5/7] drivers: s390: Avoids building drivers if ARCH is not s390.

From: Leonardo Bras
Date: Wed Oct 03 2018 - 21:01:05 EST


On Mon, Oct 1, 2018 at 9:46 AM Heiko Carstens <heiko.carstens@xxxxxxxxxx> wrote:
>
> On Thu, Sep 27, 2018 at 11:08:14PM -0300, Leonardo BrÃs wrote:
> > Avoids building s390 drivers if 'make drivers/s390/' is called but
> > ARCH is not s390.
> >
> > Signed-off-by: Leonardo BrÃs <leobras.c@xxxxxxxxx>
> > ---
> > drivers/s390/Makefile | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/s390/Makefile b/drivers/s390/Makefile
> > index a863b0462b43..0575f02dba45 100644
> > --- a/drivers/s390/Makefile
> > +++ b/drivers/s390/Makefile
> > @@ -3,7 +3,7 @@
> > # Makefile for the S/390 specific device drivers
> > #
> >
> > -obj-y += cio/ block/ char/ crypto/ net/ scsi/ virtio/
> > -
> > -drivers-y += drivers/s390/built-in.a
> > -
> > +ifeq ($(ARCH),s390)
> > + obj-y += cio/ block/ char/ crypto/ net/ scsi/ virtio/
> > + drivers-y += drivers/s390/built-in.a
> > +endif
>
> And then somebody wants to build with e.g. "make drivers/s390/cio/" and it
> still doesn't work. So _if_ this should be supported then it should work
> with all directory levels and all configuration options. Otherwise this is
> going to be a never ending story.
>


It makes sense.
I proposed this change to help me solving a problem described here
(https://lkml.org/lkml/2018/10/3/707), and for this it was enough if it didn't
build when "make drivers/s390/" was called.

Sorry I didn't send the e-mail with the reason earlier.

For solving my problem it was not necessary, but if you think it's interesting,
I could refactor all drivers/s390 Makefiles to make them all build only if
we are dealing with the s390 architecture.

What do you think?

Thanks for the reply,

Leonardo Bras