thoughts on coalescing libbb/ source files

Robert P. J. Day rpjday at mindspring.com
Mon Mar 27 13:13:53 PST 2006


On Mon, 27 Mar 2006, Rob Landley wrote:

> On Monday 27 March 2006 2:00 pm, Robert P. J. Day wrote:
> > a cleaner variation of the following will have the same effect (i'm
> > not done yet, so no sniping at the quality of code. :-)
> >
> > =========================
> > MULTISRCS := $(shell grep -l "^\#ifdef L_" $(wildcard $(srcdir)/*.c))
> > MULTIOBJS := $(addsuffix .o,$(shell grep -h "^\#ifdef L_" $(wildcard
> > $(srcdir)/*.c) | sed -e "s/^\#ifdef L_//")) ${MULTIOBJS} := $(patsubst
> > %,${LIBBB_DIR}/%, ${MULTIOBJS})
> >
> > allobjs: ${MULTIOBJS}
> >
> > ${MULTIOBJS} : ${MULTISRCS}
> > 	echo CC -DL_$(notdir $@) $^
> > =========================
> >
> >   this would replace *all* of the explicit multi-object rules in
> > libbb/Makefile.in.
>
> The frightening part is that after all the reading I've done of the
> make manual in the past couple weeks, I actually think I may
> understand what that's doing.

it doesn't actually work (yet).  still a few tweaks needed but i'm
confident it will have the same effect as a page and a half of
makefile.  give me a few more hours to mess with it.

rday


More information about the busybox mailing list