From daf0f0ba3e7432f9157e892c9319cd94678d5dce Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 22 Jul 2007 19:17:27 +0000 Subject: [PATCH] 2007-07-22 Robert Millan * geninitheader.sh: Process file specified in first parameter rather than hardcoding grub_modules_init.lst. * geninit.sh: Likewise. Also, construct header name dynamicaly rather than hardcoding grub_modules_init.h. * conf/common.rmk: Rename grub_modules_init.[ch] files associated with grub-emu to grub_emu_init.[ch]. Add rules to build analogous grub_probe_init.[ch] and grub_setup_init.[ch]. * conf/powerpc-ieee1275.rmk (grub_emu_DEPENDENCIES): Replace grub_modules_init.h with grub_emu_init.h. (grub_probe_DEPENDENCIES, grub_probe_SOURCES): Add new grub_probe_init.[ch] files. * conf/i386-efi.rmk: Likewise. * conf/i386-pc.rmk: Likewise. (grub_setup_DEPENDENCIES, grub_setup_SOURCES): Add new grub_setup_init.[ch] files. * util/grub-emu.c: Replace grub_modules_init.h with grub_emu_init.h. * util/grub-probe.c: Include grub_probe_init.h. Use grub_init_all() to initialize modules rather than a list of hardcoded functions. * util/i386/pc/grub-setup.c: Include grub_setup_init.h. Use grub_init_all() to initialize modules rather than a list of hardcoded functions. --- ChangeLog | 27 ++++++++++++++++++++++++++ conf/common.mk | 40 ++++++++++++++++++++++++++++++++------- conf/common.rmk | 40 ++++++++++++++++++++++++++++++++------- conf/i386-efi.mk | 17 +++++++++++------ conf/i386-efi.rmk | 5 +++-- conf/i386-pc.mk | 32 ++++++++++++++++++++----------- conf/i386-pc.rmk | 8 +++++--- conf/powerpc-ieee1275.mk | 17 +++++++++++------ conf/powerpc-ieee1275.rmk | 5 +++-- config.h.in | 4 ++-- geninit.sh | 11 ++++++++--- geninitheader.sh | 7 +++++-- util/grub-emu.c | 2 +- util/grub-probe.c | 29 +++++----------------------- util/i386/pc/grub-setup.c | 25 ++++++------------------ 15 files changed, 174 insertions(+), 95 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6afa398c3..3e5c50393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2007-07-22 Robert Millan + + * geninitheader.sh: Process file specified in first parameter rather + than hardcoding grub_modules_init.lst. + * geninit.sh: Likewise. Also, construct header name dynamicaly rather + than hardcoding grub_modules_init.h. + + * conf/common.rmk: Rename grub_modules_init.[ch] files associated with + grub-emu to grub_emu_init.[ch]. Add rules to build analogous + grub_probe_init.[ch] and grub_setup_init.[ch]. + + * conf/powerpc-ieee1275.rmk (grub_emu_DEPENDENCIES): Replace + grub_modules_init.h with grub_emu_init.h. + (grub_probe_DEPENDENCIES, grub_probe_SOURCES): Add new + grub_probe_init.[ch] files. + * conf/i386-efi.rmk: Likewise. + * conf/i386-pc.rmk: Likewise. + (grub_setup_DEPENDENCIES, grub_setup_SOURCES): Add new + grub_setup_init.[ch] files. + + * util/grub-emu.c: Replace grub_modules_init.h with grub_emu_init.h. + * util/grub-probe.c: Include grub_probe_init.h. Use grub_init_all() + to initialize modules rather than a list of hardcoded functions. + * util/i386/pc/grub-setup.c: Include grub_setup_init.h. Use + grub_init_all() to initialize modules rather than a list of hardcoded + functions. + 2007-07-22 Robert Millan * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Set diff --git a/conf/common.mk b/conf/common.mk index 44c11f3cc..5026364a3 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -6,18 +6,44 @@ grub_script.tab.c grub_script.tab.h: normal/parser.y DISTCLEANFILES += grub_script.tab.c grub_script.tab.h # For grub-emu. -grub_modules_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) +grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ -DISTCLEANFILES += grub_modules_init.lst +DISTCLEANFILES += grub_emu_init.lst -grub_modules_init.h: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh grub_modules_init.lst - rm -f $@; sh $(srcdir)/geninitheader.sh > $@ -DISTCLEANFILES += grub_modules_init.h +grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_emu_init.h -grub_emu_init.c: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_modules_init.lst grub_modules_init.h - rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@ +grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ DISTCLEANFILES += grub_emu_init.c +# For grub-probe. +grub_probe_init.lst: geninit.sh $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_probe_init.lst + +grub_probe_init.h: grub_probe_init.lst $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_probe_init.h + +grub_probe_init.c: grub_probe_init.lst $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) geninit.sh grub_probe_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_probe_init.c + +# For grub-setup. +grub_setup_init.lst: geninit.sh $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_setup_init.lst + +grub_setup_init.h: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_setup_init.h + +grub_setup_init.c: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) geninit.sh grub_setup_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_setup_init.c + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< diff --git a/conf/common.rmk b/conf/common.rmk index e7cafa49c..a73f013e7 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -6,18 +6,44 @@ grub_script.tab.c grub_script.tab.h: normal/parser.y DISTCLEANFILES += grub_script.tab.c grub_script.tab.h # For grub-emu. -grub_modules_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) +grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ -DISTCLEANFILES += grub_modules_init.lst +DISTCLEANFILES += grub_emu_init.lst -grub_modules_init.h: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh grub_modules_init.lst - rm -f $@; sh $(srcdir)/geninitheader.sh > $@ -DISTCLEANFILES += grub_modules_init.h +grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_emu_init.h -grub_emu_init.c: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_modules_init.lst grub_modules_init.h - rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@ +grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ DISTCLEANFILES += grub_emu_init.c +# For grub-probe. +grub_probe_init.lst: geninit.sh $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_probe_init.lst + +grub_probe_init.h: grub_probe_init.lst $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_probe_init.h + +grub_probe_init.c: grub_probe_init.lst $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) geninit.sh grub_probe_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_probe_init.c + +# For grub-setup. +grub_setup_init.lst: geninit.sh $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_setup_init.lst + +grub_setup_init.h: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_setup_init.h + +grub_setup_init.c: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) geninit.sh grub_setup_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_setup_init.c + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 9d52d6fc9..90ad3b029 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -59,6 +59,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c # For grub-probe. +grub_probe_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ util/biosdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ @@ -66,12 +67,12 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ - disk/lvm.c disk/raid.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_ufs.d grub_probe-fs_minix.d grub_probe-fs_hfs.d grub_probe-fs_jfs.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-fs_xfs.d grub_probe-fs_affs.d grub_probe-fs_sfs.d grub_probe-fs_hfsplus.d grub_probe-disk_lvm.d grub_probe-disk_raid.d + disk/lvm.c disk/raid.c grub_probe_init.c +CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_ufs.d grub_probe-fs_minix.d grub_probe-fs_hfs.d grub_probe-fs_jfs.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-fs_xfs.d grub_probe-fs_affs.d grub_probe-fs_sfs.d grub_probe-fs_hfsplus.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -185,10 +186,14 @@ grub_probe-disk_raid.o: disk/raid.c $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-disk_raid.d +grub_probe-grub_probe_init.o: grub_probe_init.c + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-grub_probe_init.d + # For grub-emu. grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \ - grub_modules_init.h + grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index f86c7d61a..50c5a88be 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -27,6 +27,7 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-probe. +grub_probe_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ util/biosdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ @@ -34,11 +35,11 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ - disk/lvm.c disk/raid.c + disk/lvm.c disk/raid.c grub_probe_init.c # For grub-emu. grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \ - grub_modules_init.h + grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 7438bbeb4..9dbefca7f 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -212,18 +212,19 @@ grub_mkimage-util_resolve.o: util/resolve.c grub_mkimage_LDFLAGS = $(LIBLZO) # For grub-setup. +grub_setup_DEPENDENCIES = grub_setup_init.h grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ util/misc.c util/getroot.c kern/device.c kern/disk.c \ kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ partmap/gpt.c fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c \ fs/hfsplus.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ - util/raid.c util/lvm.c -CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-util_raid.o grub_setup-util_lvm.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-fs_fat.d grub_setup-fs_ext2.d grub_setup-fs_xfs.d grub_setup-fs_affs.d grub_setup-fs_sfs.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-fs_ufs.d grub_setup-fs_minix.d grub_setup-fs_hfs.d grub_setup-fs_jfs.d grub_setup-fs_hfsplus.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-util_raid.d grub_setup-util_lvm.d + util/raid.c util/lvm.c grub_setup_init.c +CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-fs_fat.d grub_setup-fs_ext2.d grub_setup-fs_xfs.d grub_setup-fs_affs.d grub_setup-fs_sfs.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-fs_ufs.d grub_setup-fs_minix.d grub_setup-fs_hfs.d grub_setup-fs_jfs.d grub_setup-fs_hfsplus.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-util_raid.o grub_setup-util_lvm.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-util_raid.o grub_setup-util_lvm.o $(LDFLAGS) $(grub_setup_LDFLAGS) +grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o + $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< @@ -337,6 +338,10 @@ grub_setup-util_lvm.o: util/lvm.c $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-util_lvm.d +grub_setup-grub_setup_init.o: grub_setup_init.c + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< +-include grub_setup-grub_setup_init.d + # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c @@ -356,6 +361,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c # For grub-probe. +grub_probe_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ util/biosdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ @@ -363,12 +369,12 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ - disk/lvm.c disk/raid.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_ufs.d grub_probe-fs_minix.d grub_probe-fs_hfs.d grub_probe-fs_jfs.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-fs_xfs.d grub_probe-fs_affs.d grub_probe-fs_sfs.d grub_probe-fs_hfsplus.d grub_probe-disk_lvm.d grub_probe-disk_raid.d + disk/lvm.c disk/raid.c grub_probe_init.c +CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_ufs.d grub_probe-fs_minix.d grub_probe-fs_hfs.d grub_probe-fs_jfs.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-fs_xfs.d grub_probe-fs_affs.d grub_probe-fs_sfs.d grub_probe-fs_hfsplus.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -482,10 +488,14 @@ grub_probe-disk_raid.o: disk/raid.c $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-disk_raid.d +grub_probe-grub_probe_init.o: grub_probe_init.c + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-grub_probe_init.d + # For grub-emu. grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \ - grub_modules_init.h + grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index aa5b54684..de8bfa777 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -62,18 +62,20 @@ grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ grub_mkimage_LDFLAGS = $(LIBLZO) # For grub-setup. +grub_setup_DEPENDENCIES = grub_setup_init.h grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ util/misc.c util/getroot.c kern/device.c kern/disk.c \ kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ partmap/gpt.c fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c \ fs/hfsplus.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ - util/raid.c util/lvm.c + util/raid.c util/lvm.c grub_setup_init.c # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-probe. +grub_probe_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ util/biosdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ @@ -81,11 +83,11 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ - disk/lvm.c disk/raid.c + disk/lvm.c disk/raid.c grub_probe_init.c # For grub-emu. grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \ - grub_modules_init.h + grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 353165305..a8b352dfd 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -71,6 +71,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c # For grub-probe. +grub_probe_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ util/biosdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ @@ -78,12 +79,12 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ - disk/lvm.c disk/raid.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_ufs.d grub_probe-fs_minix.d grub_probe-fs_hfs.d grub_probe-fs_jfs.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-fs_xfs.d grub_probe-fs_affs.d grub_probe-fs_sfs.d grub_probe-fs_hfsplus.d grub_probe-disk_lvm.d grub_probe-disk_raid.d + disk/lvm.c disk/raid.c grub_probe_init.c +CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_ufs.d grub_probe-fs_minix.d grub_probe-fs_hfs.d grub_probe-fs_jfs.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-fs_xfs.d grub_probe-fs_affs.d grub_probe-fs_sfs.d grub_probe-fs_hfsplus.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_ufs.o grub_probe-fs_minix.o grub_probe-fs_hfs.o grub_probe-fs_jfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-fs_xfs.o grub_probe-fs_affs.o grub_probe-fs_sfs.o grub_probe-fs_hfsplus.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -197,10 +198,14 @@ grub_probe-disk_raid.o: disk/raid.c $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-disk_raid.d +grub_probe-grub_probe_init.o: grub_probe_init.c + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-grub_probe_init.d + # For grub-emu grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \ - grub_modules_init.h + grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index fe55ca78d..b289e0249 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -39,6 +39,7 @@ grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-probe. +grub_probe_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ util/biosdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ @@ -46,11 +47,11 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c \ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \ - disk/lvm.c disk/raid.c + disk/lvm.c disk/raid.c grub_probe_init.c # For grub-emu grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \ - grub_modules_init.h + grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ diff --git a/config.h.in b/config.h.in index c22d5b12b..1aef2123b 100644 --- a/config.h.in +++ b/config.h.in @@ -88,10 +88,10 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of a `long', as computed by sizeof. */ +/* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of a `void *', as computed by sizeof. */ +/* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define it to either start or _start */ diff --git a/geninit.sh b/geninit.sh index 47e5e0ad0..43d2d1640 100644 --- a/geninit.sh +++ b/geninit.sh @@ -11,6 +11,11 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +lst="$1" +shift + +header=`echo "${lst}" | sed -e "s/\.lst$/.h/g"` + cat <. */ -#include +#include <$header> EOF @@ -46,7 +51,7 @@ while read line; do if echo $@ | grep $file >/dev/null; then echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/ grub_\1_init ();/' fi -done < grub_modules_init.lst +done < ${lst} cat </dev/null; then echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/ grub_\1_fini ();/' fi -done < grub_modules_init.lst +done < ${lst} cat < #include -#include +#include /* Used for going back to the main function. */ jmp_buf main_env; diff --git a/util/grub-probe.c b/util/grub-probe.c index f82d4053f..d7eb9c457 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -29,6 +29,8 @@ #include #include +#include + #include #include #include @@ -243,36 +245,15 @@ main (int argc, char *argv[]) /* Initialize the emulated biosdisk driver. */ grub_util_biosdisk_init (dev_map ? : DEFAULT_DEVICE_MAP); - grub_pc_partition_map_init (); - grub_gpt_partition_map_init (); - grub_apple_partition_map_init (); - grub_raid_init (); - grub_lvm_init (); - /* Initialize filesystems. */ - grub_fat_init (); - grub_ext2_init (); - grub_ufs_init (); - grub_minix_init (); - grub_jfs_init (); - grub_xfs_init (); + /* Initialize all modules. */ + grub_init_all (); /* Do it. */ probe (path); /* Free resources. */ - grub_ext2_fini (); - grub_fat_fini (); - grub_ufs_fini (); - grub_minix_fini (); - grub_jfs_fini (); - grub_xfs_fini (); - - grub_lvm_fini (); - grub_raid_fini (); - grub_gpt_partition_map_fini (); - grub_apple_partition_map_fini (); - grub_pc_partition_map_fini (); + grub_fini_all (); grub_util_biosdisk_fini (); free (dev_map); diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 240a9553e..f17d5c452 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -34,6 +34,8 @@ #include #include +#include + #include #include #include @@ -658,9 +660,10 @@ main (int argc, char *argv[]) /* Initialize the emulated biosdisk driver. */ grub_util_biosdisk_init (dev_map ? : DEFAULT_DEVICE_MAP); - grub_pc_partition_map_init (); - grub_gpt_partition_map_init (); + /* Initialize all modules. */ + grub_init_all (); + dest_dev = get_device_name (argv[optind]); if (! dest_dev) { @@ -678,14 +681,6 @@ main (int argc, char *argv[]) prefix = grub_get_prefix (dir ? : DEFAULT_DIRECTORY); - /* Initialize filesystems. */ - grub_fat_init (); - grub_ext2_init (); - grub_ufs_init (); - grub_minix_init (); - grub_hfs_init (); - grub_jfs_init (); - if (root_dev) { char *tmp = get_device_name (root_dev); @@ -754,15 +749,7 @@ main (int argc, char *argv[]) root_dev, dest_dev, must_embed); /* Free resources. */ - grub_ext2_fini (); - grub_fat_fini (); - grub_ufs_fini (); - grub_minix_fini (); - grub_hfs_fini (); - grub_jfs_fini (); - - grub_gpt_partition_map_fini (); - grub_pc_partition_map_fini (); + grub_fini_all (); grub_util_biosdisk_fini (); free (boot_file);