[Peter Samuelson]
> > There are two ways to handle this:
> >
> > obj-$(CONFIG_WD80x3) += wd.o 8390.o
> > obj-$(CONFIG_EL2) += 3c503.o 8390.o
> > obj-$(CONFIG_NE2000) += ne.o 8390.o
> > obj-$(CONFIG_NE2_MCA) += ne2.o 8390.o
> > obj-$(CONFIG_HPLAN) += hp.o 8390.o
[John Alvord <[EMAIL PROTECTED]>]
> You can avoid duplicates with
> obj-$(CONFIG_WD80x3) += wd.o
> ifneq (,$(findstring 8390.o,obj-$(CONFIG_WD80x3))
> obj-$(CONFIG_WD80x3) += 8390.o
> endif
>
> Which is wordy but accomplishes the objective of avoiding duplicates.
I said "there are two ways to handle this". You snipped the second,
which was:
> > ...Or do horrible games with 'if' statements and temporary
> > variables with names like $(NEED_8390) to ensure that it gets
> > included once if needed and not if not -- thereby pretty much
> > defeating the readability of the new-style makefiles.
I would consider your approach a variant of the "horrible games with if
statements and temporary variables". (:
Here's an exercise to the reader: reformat drivers/net/Makefile using
John Alford's approach, diff the two, and take a look. Then come back
and tell me LINK_FIRST -- 0-2 lines in the Makefile depending on your
ordering requirements, plus about five lines in Rules.make (*yes*, it
really is that simple) -- is really uglier.
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/