[U-Boot] U-Boot approved way to set up vendor common/ directory?

currently writing a wiki page for upcoming embedded linux course on how to set up a "common" vendor directory to avoid duplication, partial result here:
http://www.crashcourse.ca/wiki/index.php/U-Boot_common
and curious about a couple different ways to do it that both seem reasonable.
the example i use as a "good" way is how freescale is set up, with common directory having Makefile so the common directory is added to "libs-y" in top-level Makefile. and the common/Makefile will then have, to some extent, conditional inclusion based on, perhaps, some subset of that vendor's boards, as in:
... snip ... obj-$(CONFIG_MPC8541CDS) += cds_pci_ft.o obj-$(CONFIG_MPC8548CDS) += cds_pci_ft.o obj-$(CONFIG_MPC8555CDS) += cds_pci_ft.o ... snip ...
so that approach, while having a nice design, does require the common Makefile to perhaps do piles of checking for the target board and having lots of conditional "obj-y" lines.
the other approach i see is siemens, which has a common/ directory with a small amount of content and no Makefile:
$ tree common common ├── board.c ├── factoryset.c └── factoryset.h $
whereupon the lack of a common/Makefile requires individual siemens board Makefiles to specifically pull in object files from the common directory, as in:
obj-y += board.o ifndef CONFIG_SPL_BUILD obj-y += ../common/factoryset.o endif
which also seems fine, as long as there's not too much of that -- i'd hate to have a board makefile that was awash in references to "../common/...", but that's just me.
anyway, is there a preferred style for this?
rday
participants (1)
-
Robert P. J. Day