lkml.org 
[lkml]   [2007]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Makefile question (was [RFC] LZO de/compression support - take 6)
On 5/29/07, Michael-Luke Jones <mlj28@cam.ac.uk> wrote:
> On 28 May 2007, at 15:34, Nitin Gupta wrote:
>
> > diff --git a/lib/Kconfig b/lib/Kconfig
> > index 2e7ae6b..eb95eaa 100644
> > --- a/lib/Kconfig
> > +++ b/lib/Kconfig
> > @@ -64,6 +64,12 @@ config ZLIB_INFLATE
> > config ZLIB_DEFLATE
> > tristate
> >
> > +config LZO1X_COMPRESS
> > + tristate
> > +
> > +config LZO1X_DECOMPRESS
> > + tristate
> > +
> > #
> > # Generic allocator support is selected if needed
> > #
> > diff --git a/lib/Makefile b/lib/Makefile
> > index c8c8e20..448ae37 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -49,6 +49,8 @@ obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
> > obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/
> > obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/
> > obj-$(CONFIG_REED_SOLOMON) += reed_solomon/
> > +obj-$(CONFIG_LZO1X_COMPRESS) += lzo1x/
> > +obj-$(CONFIG_LZO1X_DECOMPRESS) += lzo1x/
> >
> > obj-$(CONFIG_TEXTSEARCH) += textsearch.o
> > obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
>
> Hey there,
>
> Is this syntax OK for Makefile use? I'm only asking out of personal
> ignorance and because I'd use:

> > +obj-$(CONFIG_LZO1X_COMPRESS) += lzo1x/
> > +obj-$(CONFIG_LZO1X_DECOMPRESS) += lzo1x/

This is syntactically correct (and wouldn't produce any build errors),
but it's quite ... strange, still. Why would I even want to /build/ the
compress code if all I selected was the decompress option?

Also, when both the options are y, make would just make the first
target, then recurse back into that same directory again and skip
it because it just made it ... which, although harmless, is ... strange.

So I'm not sure if we really want both the options to resolve to the
same make target -- the kernel typically has more users of
_decompress_ than those of _compress_, so it does make some sense
to completely decouple the two into separate directories in lib/ and have
separate Kconfig options (as well as Makefile target subdirs) for them.

> Kconfig:
>
> config LZO1X_COMPRESS
> select LZO1X
> tristate
>
> config LZO1X_DECOMPRESS
> select LZO1X
> tristate
>
> config LZO1X
> tristate (or boolean??)

Hmmm ... if this is /really/ what we want to do, what's wrong with simply:

config LZO1x
tristate

?

> Makefile:
>
> obj-$(CONFIG_LZO1X) += lzo1x/

I find nothing wrong with the style being used for ZLIB presently. Agreed,
users of ZLIB do typically want to select only decompress *without*
compress whereas there's no such user for LZO currently, but I see
nothing wrong in just copying over ZLIB's style for LZO too (i.e. decoupling
the compress and decompress code into separate subdirs in lib/).
And if not, then why have two separate (dummy) Kconfig options either?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-29 12:45    [from the cache]
©2003-2011 Jasper Spaans