On Mon, Apr 27, 2009 at 9:09 AM, Bean
<address@hidden> wrote:
Hi,
Currently, the organization of conf files are not optimal. There are a
lot of duplication in *.rmk files. For example, i386-efi.rmk and
x86_64-efi.rmk are basically the same, and grub-emu appears in every
rmk, but there is only minor difference between each one. Also,
related item are scattered around, which make it more likely for
casual mistakes, like forgeting to add files in grub_emu_SOURCES, etc.
Basically I agree that it should be reorganized but some remarks follow
Here are some of my thoughts:
1, Fine tune rmk layout
rmk are split into different blocks accordding to function, such as
common, commands, fs and partmap. Each block consists of generic and
platform dependent parts. For example, for i386-efi, the full set of
makefiles to be included is:
common-i386-efi.rmk
common-efi.rmk
common-i386.rmk
common.rmk
commands-i386-efi.rmk
commands-efi.rmk
commands-i386.rmk
commands.rmk
fs-i386-efi.rmk
fs-efi.rmk
fs-i386.rmk
fs.rmk
partmap-i386-efi.rmk
partmap-efi.rmk
partmap-i386.rmk
partmap.rmk
Of course, not all of them needs to be present, we can use -include to
add them to the main makefile.
I'm not sure that fine-graining is really necessary. Basically the most important point is to eliminate duplication and group related things together
However it's a good thing to have a separate efi.rmk and perhaps same applies to ieee1275.rmk
2, Group related items together
For example, for the fat module, we could write it like this:
# For fat.mod.
fat_mod_SOURCES = fs/fat.c
fat_mod_CFLAGS = $(COMMON_CFLAGS)
fat_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += fat.mod
grub_probe_SOURCES += fs/fat.c
grub_fstest_SOURCES += fs/fat.c
grub_emu_SOURCES += fs/fat.c
It's better to unify the last three into a variable FS_SOURCES which will be added to tools sources in corresponding files. This is useful because different platforms provide different set of tools
--
Bean
_______________________________________________
Grub-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/grub-devel