We have a mainboard called the p4dpe-g2. It seems to be almost identical
to the p4dpe.
I was faced with several options:
- have a directory named p4dpe and a directory p4dpe-g2, with
almost identical files
- Have a directory for the p4dpe, with #ifdef G2 in many files
- an interesting trick that works:
have a directory p4dpe, and a directory p4dpe/g2
Populate p4dpe/g2 with the files:
cmos.layout, Config, mainboard.c, irq_tables.c, and mptable.c
in other words, the files that will change with mainboard revs
anyway
This last option works. The only change to the config file to build a -g2
motherboard is to change the line:
mainboard supermicro/p4dpe
to
mainboard supermicro/p4dpe/g2
Now this is kind of interesting. For a vendor like supermicro that spins
lots of boards that are very similar, we can take this further: have
supermicro/mainboard/p4d/pr
for the p4dpr
and
supermicro/mainboard/p4d/pe
for the p4dpe. These are similar boards, lots of shared code, and this
structure shows that.
Comments? is this good, bad, or indifferent?
ron