[OpenWrt-Devel] [PATCH] treewide: simplify inclusion of subtarget image files
mail at adrianschmutzler.de
mail at adrianschmutzler.de
Sun Jun 7 07:56:31 EDT 2020
Hi Matthias,
> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Matthias Schiffer
> Sent: Sonntag, 7. Juni 2020 13:33
> To: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> Cc: openwrt-devel at lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH] treewide: simplify inclusion of
> subtarget image files
>
> On 6/7/20 1:11 PM, Adrian Schmutzler wrote:
> > Many target use a repetitive if-include scheme for their subtarget
> > image files, though their names are consistent with the subtarget
> > names.
> >
> > This patch removes these redundant conditions and just uses the
> > variable for the include where the target setup allows it.
> >
> > For sunxi, this includes a trivial rename of the subtarget image
> > Makefiles.
> >
> > Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> > ---
> [...]
> > diff --git a/target/linux/ath79/image/Makefile
> > b/target/linux/ath79/image/Makefile
> > index 529baf8f57..a555cfc6d5 100644
> > --- a/target/linux/ath79/image/Makefile
> > +++ b/target/linux/ath79/image/Makefile
> > @@ -68,20 +68,16 @@ define Device/Default
> > append-rootfs | pad-rootfs | append-metadata | check-size endef
> >
> > +include $(SUBTARGET).mk
> > +
> > ifeq ($(SUBTARGET),generic)
> > -include ./generic.mk
> > -include ./generic-tp-link.mk
> > -include ./generic-ubnt.mk
> > -endif
> > -ifeq ($(SUBTARGET),mikrotik)
> > -include ./mikrotik.mk
> > -endif
> > -ifeq ($(SUBTARGET),nand)
> > -include ./nand.mk
> > +include generic-tp-link.mk
> > +include generic-ubnt.mk
>
> How about moving these lines into generic.mk, etc.? That way we could get
> rid of the ifeq ($(SUBTARGET),...) completely.
I considered that as well, but personally I like it better "my" way, as the image/Makefile provides "an overview" of the relevant files rather than having a cascading arrangement. (Of course, that's purely matter of taste and your proposed method wouldn't be worse by any means.)
Best
Adrian
>
> > endif
> > +
> > ifeq ($(SUBTARGET),tiny)
> > -include ./tiny.mk
> > -include ./tiny-netgear.mk
> > -include ./tiny-tp-link.mk
> > +include tiny-netgear.mk
> > +include tiny-tp-link.mk
> > endif
> > +
> > $(eval $(call BuildImage))
> [...]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20200607/c61361de/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list