[sane-devel] Moving certain backends to separate directories
Louis Lagendijk
louis at fazant.net
Thu Aug 15 09:43:18 BST 2019
hi Olaf, Povilas
On Tue, 2019-08-13 at 19:34 +0300, Povilas Kanapickas wrote:
> Hi Olaf,
>
> On 8/12/19 3:36 PM, Olaf Meeuwissen wrote:
> > Hi Povilas,
> >
> > Povilas Kanapickas writes:
> >
> > > Hi,
> > >
> > > The genesys backend on the current master comprises of 42 files.
> > > I
> > > propose to move it under `backend/genesys`? The same could
> > > eventually be
> > > done to other larger backends (or maybe even all backends) as the
> > > `backend` directory is becoming hard to navigate.
> >
> > I agree that for backends that consist of more than a "handful" of
> > files
> > it may be convenient/desirable to move them into a directory of
> > their
> > own below backend/. If doing so, we would need a naming convention
> > and
> > what you suggest, using the backend's name as the directory name,
> > makes
> > sense and works fine.
>
> It's great that we agree.
>
> > Moving things to a dedicated backend/$BACKEND_NAME directory also
> > makes
> > it slightly more convenient to limit searches and may make
> > recompiling a
> > bit more performant (depending on how you integrate the build
> > bits).
> >
> > One question though, what are you're thoughts on the automake end
> > of
> > this approach? There are a couple of options here:
> >
> > - add a SUBDIRS variable to backend/Makefile.am and write a
> > dedicated
> > Makefile.am for your backend. This approach will not be able to
> > benefit from any common settings in backend/Makefile.am but
> > keeps it
> > content focussed on the backend at hand.
> >
> > - just insert the directory name everywhere in backend/Makefile.am
> > for
> > files related to your backend. This simply makes that file a
> > tad
> > more verbose. You'd still be able to benefit from common
> > settings
> > but backend/Makefile.am would still have to cater to all
> > backends.
> >
> > - extract the backend/Makefile.am bits for your backend into a
> > snippet
> > for inclusion in backend/Makefile.am. The snippet could either
> > live
> > in backend/ or in backend/$BACKEND_NAME. In both cases I would
> > call
> > it $BACKEND_NAME.am and in both cases it would have to include
> > the
> > $BACKEND_NAME directory in file names. This approach would be
> > able
> > to benefit from common settings in backend/Makefile.am and keep
> > focus
> > on the backend at hand nevertheless.
>
> I think that for the beginning it could probably make sense just to
> edit
> backend/Makefile.am and insert the directory name there. We could
> explore more complex options later.
>
> Regards,
> Povilas
For the backend developers option 1 (SUBDIRS) is easier as it allows
one to cd into the backend directory and call make on that directory
only (if I understand it correctly). But this will be a fair amount of
work. For now just editing backend/Makefile.am will do.
Regards, louis
More information about the sane-devel
mailing list