thoughts on coalescing libbb/ source files
Rob Landley
rob at landley.net
Mon Mar 27 21:07:12 UTC 2006
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.
> rday
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list