]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2005-02-15 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Tue, 15 Feb 2005 00:07:01 +0000 (00:07 +0000)
committerokuji <okuji@localhost>
Tue, 15 Feb 2005 00:07:01 +0000 (00:07 +0000)
  * include/grub/normal.h (grub_halt_init): New prototype.
  (grub_halt_fini): Likewise.
  (grub_reboot_init): Likewise.
  (grub_reboot_fini): Likewise.

  * util/grub-emu.c: Include signal.h.
  (main_env): New global variable.
  (grub_machine_init): Ignore SIGINT. Otherwise grub-emu cannot
  catch C-c.
  (grub_machine_fini): New function.
  (main): Call grub_halt_init and grub_reboot_init before
  grub_main, and grub_reboot_fini and grub_halt_fini after it.
  Call setjmp with MAIN_ENV to go back afterwards.
  Call grub_machine_fini right before return.

  * include/grub/util/misc.h: Include setjmp.h.
  (main_env): New prototype.

  * include/grub/kernel.h (grub_machine_fini): New prototype.
  * include/grub/i386/pc/biosdisk.h (grub_biosdisk_fini): Likewise.
  * include/grub/i386/pc/console.h (grub_console_fini): Likewise.

  * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function.
  * kern/i386/pc/init.c (grub_machine_fini): Likewise.
  * term/i386/pc/console.c (grub_console_fini): Likewise.

  * util/i386/pc/misc.c: New file.

  * conf/i386-pc.rmk (grub_emu_SOURCES): Added
  util/i386/pc/misc.c, commands/i386/pc/halt.c and
  commands/i386/pc/reboot.c.

15 files changed:
ChangeLog
conf/i386-pc.mk
conf/i386-pc.rmk
configure
disk/i386/pc/biosdisk.c
include/grub/i386/pc/biosdisk.h
include/grub/i386/pc/console.h
include/grub/kernel.h
include/grub/normal.h
include/grub/util/misc.h
kern/i386/pc/init.c
term/i386/pc/console.c
util/console.c
util/grub-emu.c
util/i386/pc/misc.c [new file with mode: 0644]

index 328274253c60e41fef79b16ffcca6e62579ecf0c..ecf35f4826601bfcca8eeaf8ea5a5e88134e7d68 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2005-02-15  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * include/grub/normal.h (grub_halt_init): New prototype.
+       (grub_halt_fini): Likewise.
+       (grub_reboot_init): Likewise.
+       (grub_reboot_fini): Likewise.
+
+       * util/grub-emu.c: Include signal.h.
+       (main_env): New global variable.
+       (grub_machine_init): Ignore SIGINT. Otherwise grub-emu cannot
+       catch C-c.
+       (grub_machine_fini): New function.
+       (main): Call grub_halt_init and grub_reboot_init before
+       grub_main, and grub_reboot_fini and grub_halt_fini after it.
+       Call setjmp with MAIN_ENV to go back afterwards.
+       Call grub_machine_fini right before return.
+
+       * include/grub/util/misc.h: Include setjmp.h.
+       (main_env): New prototype.
+
+       * include/grub/kernel.h (grub_machine_fini): New prototype.
+       * include/grub/i386/pc/biosdisk.h (grub_biosdisk_fini): Likewise.
+       * include/grub/i386/pc/console.h (grub_console_fini): Likewise.
+
+       * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function.
+       * kern/i386/pc/init.c (grub_machine_fini): Likewise.
+       * term/i386/pc/console.c (grub_console_fini): Likewise.
+       
+       * util/i386/pc/misc.c: New file.
+       
+       * conf/i386-pc.rmk (grub_emu_SOURCES): Added
+       util/i386/pc/misc.c, commands/i386/pc/halt.c and
+       commands/i386/pc/reboot.c.
+
 2005-02-14  Guillem Jover  <guillem@hadrons.org>
 
        * include/grub/dl.h (grub_dl_check_header): New prototype.
@@ -17,6 +51,9 @@
        `grub_dl_check_header' instead of explicit checks.  Remove arch
        specific ELF header checks.
 
+       * util/grub-emu.c (grub_arch_dl_check_header): Remove the
+       argument SIZE.
+
 2005-02-13  Hollis Blanchard  <hollis@penguinppc.org>
 
        * conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add ls.mod.
index 3334aaa846f893155aadc3261d8e29466737ab6e..a99cac8bfadeeb7980249392c35fb11c07067234 100644 (file)
@@ -497,261 +497,274 @@ grub_setup-fs_fshelp.d: fs/fshelp.c
 
 
 # For grub
-grub_emu_SOURCES = kern/main.c kern/device.c fs/fshelp.c               \
-       kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c          \
-        kern/misc.c kern/loader.c kern/rescue.c kern/term.c            \
-       kern/partition.c kern/env.c commands/ls.c partmap/amiga.c       \
-       partmap/pc.c partmap/apple.c                                    \
-       commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c               \
-       util/i386/pc/biosdisk.c fs/fat.c fs/ext2.c fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/iso9660.c \
-       normal/cmdline.c normal/command.c normal/main.c normal/menu.c normal/arg.c      \
-       util/console.c util/grub-emu.c util/misc.c util/i386/pc/getroot.c commands/help.c \
-       disk/loopback.c
-CLEANFILES += grub-emu grub_emu-kern_main.o grub_emu-kern_device.o grub_emu-fs_fshelp.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_err.o grub_emu-kern_misc.o grub_emu-kern_loader.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_partition.o grub_emu-kern_env.o grub_emu-commands_ls.o grub_emu-partmap_amiga.o grub_emu-partmap_pc.o grub_emu-partmap_apple.o grub_emu-commands_terminal.o grub_emu-commands_boot.o grub_emu-commands_cmp.o grub_emu-commands_cat.o grub_emu-util_i386_pc_biosdisk.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_ufs.o grub_emu-fs_minix.o grub_emu-fs_hfs.o grub_emu-fs_jfs.o grub_emu-fs_iso9660.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_arg.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_getroot.o grub_emu-commands_help.o grub_emu-disk_loopback.o
-MOSTLYCLEANFILES += grub_emu-kern_main.d grub_emu-kern_device.d grub_emu-fs_fshelp.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_err.d grub_emu-kern_misc.d grub_emu-kern_loader.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_partition.d grub_emu-kern_env.d grub_emu-commands_ls.d grub_emu-partmap_amiga.d grub_emu-partmap_pc.d grub_emu-partmap_apple.d grub_emu-commands_terminal.d grub_emu-commands_boot.d grub_emu-commands_cmp.d grub_emu-commands_cat.d grub_emu-util_i386_pc_biosdisk.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_ufs.d grub_emu-fs_minix.d grub_emu-fs_hfs.d grub_emu-fs_jfs.d grub_emu-fs_iso9660.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_arg.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_getroot.d grub_emu-commands_help.d grub_emu-disk_loopback.d
-
-grub-emu: grub_emu-kern_main.o grub_emu-kern_device.o grub_emu-fs_fshelp.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_err.o grub_emu-kern_misc.o grub_emu-kern_loader.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_partition.o grub_emu-kern_env.o grub_emu-commands_ls.o grub_emu-partmap_amiga.o grub_emu-partmap_pc.o grub_emu-partmap_apple.o grub_emu-commands_terminal.o grub_emu-commands_boot.o grub_emu-commands_cmp.o grub_emu-commands_cat.o grub_emu-util_i386_pc_biosdisk.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_ufs.o grub_emu-fs_minix.o grub_emu-fs_hfs.o grub_emu-fs_jfs.o grub_emu-fs_iso9660.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_arg.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_getroot.o grub_emu-commands_help.o grub_emu-disk_loopback.o
+grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c       \
+       commands/help.c commands/terminal.c commands/ls.c               \
+       commands/i386/pc/halt.c commands/i386/pc/reboot.c               \
+       disk/loopback.c                                                 \
+       fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c fs/jfs.c   \
+       fs/minix.c fs/ufs.c                                             \
+       kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c       \
+       kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c     \
+       kern/partition.c kern/rescue.c kern/term.c                      \
+       normal/arg.c normal/cmdline.c normal/command.c normal/main.c    \
+       normal/menu.c                                                   \
+       partmap/amiga.c partmap/apple.c partmap/pc.c                    \
+       util/console.c util/grub-emu.c util/misc.c                      \
+       util/i386/pc/biosdisk.c util/i386/pc/getroot.c                  \
+       util/i386/pc/misc.c
+CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ufs.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o
+MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ufs.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_i386_pc_misc.d
+
+grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ufs.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o
        $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS)
 
-grub_emu-kern_main.o: kern/main.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_boot.o: commands/boot.c
+       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_main.d: kern/main.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-commands_boot.d: commands/boot.c
+       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_main.d
+-include grub_emu-commands_boot.d
 
-grub_emu-kern_device.o: kern/device.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_cat.o: commands/cat.c
+       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_device.d: kern/device.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-commands_cat.d: commands/cat.c
+       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_device.d
+-include grub_emu-commands_cat.d
 
-grub_emu-fs_fshelp.o: fs/fshelp.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_cmp.o: commands/cmp.c
+       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_fshelp.d: fs/fshelp.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+grub_emu-commands_cmp.d: commands/cmp.c
+       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_fshelp.d
+-include grub_emu-commands_cmp.d
 
-grub_emu-kern_disk.o: kern/disk.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_help.o: commands/help.c
+       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_disk.d: kern/disk.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-commands_help.d: commands/help.c
+       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_disk.d
+-include grub_emu-commands_help.d
 
-grub_emu-kern_dl.o: kern/dl.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_terminal.o: commands/terminal.c
+       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_dl.d: kern/dl.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-commands_terminal.d: commands/terminal.c
+       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_dl.d
+-include grub_emu-commands_terminal.d
 
-grub_emu-kern_file.o: kern/file.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_ls.o: commands/ls.c
+       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_file.d: kern/file.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-commands_ls.d: commands/ls.c
+       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_file.d
+-include grub_emu-commands_ls.d
 
-grub_emu-kern_fs.o: kern/fs.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_i386_pc_halt.o: commands/i386/pc/halt.c
+       $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_fs.d: kern/fs.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-commands_i386_pc_halt.d: commands/i386/pc/halt.c
+       set -e;           $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,halt\.o[ :]*,grub_emu-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_fs.d
+-include grub_emu-commands_i386_pc_halt.d
 
-grub_emu-kern_err.o: kern/err.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c
+       $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_err.d: kern/err.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+grub_emu-commands_i386_pc_reboot.d: commands/i386/pc/reboot.c
+       set -e;           $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,reboot\.o[ :]*,grub_emu-commands_i386_pc_reboot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_err.d
+-include grub_emu-commands_i386_pc_reboot.d
 
-grub_emu-kern_misc.o: kern/misc.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-disk_loopback.o: disk/loopback.c
+       $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_misc.d: kern/misc.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-disk_loopback.d: disk/loopback.c
+       set -e;           $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_misc.d
+-include grub_emu-disk_loopback.d
 
-grub_emu-kern_loader.o: kern/loader.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_ext2.o: fs/ext2.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_loader.d: kern/loader.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-fs_ext2.d: fs/ext2.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_loader.d
+-include grub_emu-fs_ext2.d
 
-grub_emu-kern_rescue.o: kern/rescue.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_fat.o: fs/fat.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_rescue.d: kern/rescue.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-fs_fat.d: fs/fat.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_rescue.d
+-include grub_emu-fs_fat.d
 
-grub_emu-kern_term.o: kern/term.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_fshelp.o: fs/fshelp.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_term.d: kern/term.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-fs_fshelp.d: fs/fshelp.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_term.d
+-include grub_emu-fs_fshelp.d
 
-grub_emu-kern_partition.o: kern/partition.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_hfs.o: fs/hfs.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_partition.d: kern/partition.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+grub_emu-fs_hfs.d: fs/hfs.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_partition.d
+-include grub_emu-fs_hfs.d
 
-grub_emu-kern_env.o: kern/env.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_iso9660.o: fs/iso9660.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-kern_env.d: kern/env.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+grub_emu-fs_iso9660.d: fs/iso9660.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-kern_env.d
+-include grub_emu-fs_iso9660.d
 
-grub_emu-commands_ls.o: commands/ls.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_jfs.o: fs/jfs.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-commands_ls.d: commands/ls.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-fs_jfs.d: fs/jfs.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-commands_ls.d
+-include grub_emu-fs_jfs.d
 
-grub_emu-partmap_amiga.o: partmap/amiga.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_minix.o: fs/minix.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-partmap_amiga.d: partmap/amiga.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+grub_emu-fs_minix.d: fs/minix.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-partmap_amiga.d
+-include grub_emu-fs_minix.d
 
-grub_emu-partmap_pc.o: partmap/pc.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-fs_ufs.o: fs/ufs.c
+       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-partmap_pc.d: partmap/pc.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+grub_emu-fs_ufs.d: fs/ufs.c
+       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-partmap_pc.d
+-include grub_emu-fs_ufs.d
 
-grub_emu-partmap_apple.o: partmap/apple.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_device.o: kern/device.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-partmap_apple.d: partmap/apple.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+grub_emu-kern_device.d: kern/device.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-partmap_apple.d
+-include grub_emu-kern_device.d
 
-grub_emu-commands_terminal.o: commands/terminal.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_disk.o: kern/disk.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-commands_terminal.d: commands/terminal.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-kern_disk.d: kern/disk.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-commands_terminal.d
+-include grub_emu-kern_disk.d
 
-grub_emu-commands_boot.o: commands/boot.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_dl.o: kern/dl.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-commands_boot.d: commands/boot.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-kern_dl.d: kern/dl.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-commands_boot.d
+-include grub_emu-kern_dl.d
 
-grub_emu-commands_cmp.o: commands/cmp.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_env.o: kern/env.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-commands_cmp.d: commands/cmp.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+grub_emu-kern_env.d: kern/env.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
--include grub_emu-commands_cmp.d
+-include grub_emu-kern_env.d
 
-grub_emu-commands_cat.o: commands/cat.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_err.o: kern/err.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-commands_cat.d: commands/cat.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+grub_emu-kern_err.d: kern/err.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
--include grub_emu-commands_cat.d
+-include grub_emu-kern_err.d
 
-grub_emu-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_file.o: kern/file.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-kern_file.d: kern/file.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-util_i386_pc_biosdisk.d
+-include grub_emu-kern_file.d
 
-grub_emu-fs_fat.o: fs/fat.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_fs.o: kern/fs.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_fat.d: fs/fat.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-kern_fs.d: kern/fs.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_fat.d
+-include grub_emu-kern_fs.d
 
-grub_emu-fs_ext2.o: fs/ext2.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_loader.o: kern/loader.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_ext2.d: fs/ext2.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+grub_emu-kern_loader.d: kern/loader.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_ext2.d
+-include grub_emu-kern_loader.d
 
-grub_emu-fs_ufs.o: fs/ufs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_main.o: kern/main.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_ufs.d: fs/ufs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-kern_main.d: kern/main.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_ufs.d
+-include grub_emu-kern_main.d
 
-grub_emu-fs_minix.o: fs/minix.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_misc.o: kern/misc.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_minix.d: fs/minix.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-kern_misc.d: kern/misc.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_minix.d
+-include grub_emu-kern_misc.d
 
-grub_emu-fs_hfs.o: fs/hfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_partition.o: kern/partition.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_hfs.d: fs/hfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-kern_partition.d: kern/partition.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_hfs.d
+-include grub_emu-kern_partition.d
 
-grub_emu-fs_jfs.o: fs/jfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_rescue.o: kern/rescue.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_jfs.d: fs/jfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-kern_rescue.d: kern/rescue.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_jfs.d
+-include grub_emu-kern_rescue.d
 
-grub_emu-fs_iso9660.o: fs/iso9660.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-kern_term.o: kern/term.c
+       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-fs_iso9660.d: fs/iso9660.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+grub_emu-kern_term.d: kern/term.c
+       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
--include grub_emu-fs_iso9660.d
+-include grub_emu-kern_term.d
+
+grub_emu-normal_arg.o: normal/arg.c
+       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+
+grub_emu-normal_arg.d: normal/arg.c
+       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+
+-include grub_emu-normal_arg.d
 
 grub_emu-normal_cmdline.o: normal/cmdline.c
        $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
@@ -785,13 +798,29 @@ grub_emu-normal_menu.d: normal/menu.c
 
 -include grub_emu-normal_menu.d
 
-grub_emu-normal_arg.o: normal/arg.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-partmap_amiga.o: partmap/amiga.c
+       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-normal_arg.d: normal/arg.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+grub_emu-partmap_amiga.d: partmap/amiga.c
+       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
--include grub_emu-normal_arg.d
+-include grub_emu-partmap_amiga.d
+
+grub_emu-partmap_apple.o: partmap/apple.c
+       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+
+grub_emu-partmap_apple.d: partmap/apple.c
+       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+
+-include grub_emu-partmap_apple.d
+
+grub_emu-partmap_pc.o: partmap/pc.c
+       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+
+grub_emu-partmap_pc.d: partmap/pc.c
+       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+
+-include grub_emu-partmap_pc.d
 
 grub_emu-util_console.o: util/console.c
        $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
@@ -817,6 +846,14 @@ grub_emu-util_misc.d: util/misc.c
 
 -include grub_emu-util_misc.d
 
+grub_emu-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
+       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+
+grub_emu-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
+       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+
+-include grub_emu-util_i386_pc_biosdisk.d
+
 grub_emu-util_i386_pc_getroot.o: util/i386/pc/getroot.c
        $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
@@ -825,21 +862,14 @@ grub_emu-util_i386_pc_getroot.d: util/i386/pc/getroot.c
 
 -include grub_emu-util_i386_pc_getroot.d
 
-grub_emu-commands_help.o: commands/help.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-
-grub_emu-commands_help.d: commands/help.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-
--include grub_emu-commands_help.d
+grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c
+       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
-grub_emu-disk_loopback.o: disk/loopback.c
-       $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+grub_emu-util_i386_pc_misc.d: util/i386/pc/misc.c
+       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_i386_pc_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
-grub_emu-disk_loopback.d: disk/loopback.c
-       set -e;           $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+-include grub_emu-util_i386_pc_misc.d
 
--include grub_emu-disk_loopback.d
 
 grub_emu_LDFLAGS = -lncurses
 
index 018bcb3ea04ce248d7ca78d8887b536a4ff0cdd7..d5728e2510a5da88b6c6b9cb704fcccf97d0cd48 100644 (file)
@@ -65,16 +65,22 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \
        fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c kern/file.c kern/fs.c kern/env.c fs/fshelp.c
 
 # For grub
-grub_emu_SOURCES = kern/main.c kern/device.c fs/fshelp.c               \
-       kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c          \
-        kern/misc.c kern/loader.c kern/rescue.c kern/term.c            \
-       kern/partition.c kern/env.c commands/ls.c partmap/amiga.c       \
-       partmap/pc.c partmap/apple.c                                    \
-       commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c               \
-       util/i386/pc/biosdisk.c fs/fat.c fs/ext2.c fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/iso9660.c \
-       normal/cmdline.c normal/command.c normal/main.c normal/menu.c normal/arg.c      \
-       util/console.c util/grub-emu.c util/misc.c util/i386/pc/getroot.c commands/help.c \
-       disk/loopback.c
+grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c       \
+       commands/help.c commands/terminal.c commands/ls.c               \
+       commands/i386/pc/halt.c commands/i386/pc/reboot.c               \
+       disk/loopback.c                                                 \
+       fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c fs/jfs.c   \
+       fs/minix.c fs/ufs.c                                             \
+       kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c       \
+       kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c     \
+       kern/partition.c kern/rescue.c kern/term.c                      \
+       normal/arg.c normal/cmdline.c normal/command.c normal/main.c    \
+       normal/menu.c                                                   \
+       partmap/amiga.c partmap/apple.c partmap/pc.c                    \
+       util/console.c util/grub-emu.c util/misc.c                      \
+       util/i386/pc/biosdisk.c util/i386/pc/getroot.c                  \
+       util/i386/pc/misc.c
+
 grub_emu_LDFLAGS = -lncurses
 
 # For genmoddep.
index e6b909e9103da9b5d3af1f6336c514560b320d96..d73b54bf55a033adeebeef6626b0da50b2a3da20 100644 (file)
--- a/configure
+++ b/configure
@@ -951,7 +951,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd "$ac_popdir"
+    cd $ac_popdir
   done
 fi
 
@@ -1986,7 +1986,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2044,7 +2045,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2160,7 +2162,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2214,7 +2217,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2259,7 +2263,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2303,7 +2308,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2393,7 +2399,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2422,7 +2429,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2492,7 +2500,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2544,7 +2553,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2615,7 +2625,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2667,7 +2678,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2744,7 +2756,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2807,7 +2820,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2924,7 +2938,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2980,7 +2995,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3056,7 +3072,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3112,7 +3129,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3168,7 +3186,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3249,7 +3268,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3305,7 +3325,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4191,7 +4212,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4233,7 +4255,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4290,7 +4313,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4666,7 +4690,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4836,7 +4861,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4901,7 +4927,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4963,7 +4990,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5003,7 +5031,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5059,7 +5088,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5099,7 +5129,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5163,7 +5194,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5194,8 +5226,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -5307,7 +5341,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5369,7 +5404,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5409,7 +5445,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5465,7 +5502,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5505,7 +5543,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5569,7 +5608,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5600,8 +5640,10 @@ See \`config.log' for more details." >&2;}
 esac
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
-echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -5723,7 +5765,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5826,7 +5869,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6688,6 +6732,11 @@ esac
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -6726,12 +6775,6 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
         fi;;
       esac
     done` || { (exit 1); exit 1; }
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
index 723c394dedb1ba2c822547a35af51cf859c92370..fc73eff9e58b2abdf40bba720e873ed180fc63f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -333,3 +333,9 @@ grub_biosdisk_init (void)
 {
   grub_disk_dev_register (&grub_biosdisk_dev);
 }
+
+void
+grub_biosdisk_fini (void)
+{
+  grub_disk_dev_unregister (&grub_biosdisk_dev);
+}
index 760e0734c5cf33a4af61f9d039da68f78266f904..d6a5ee8e22d7f7cc9c80da52f246a147ce620fc6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2005  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -43,5 +43,6 @@ int grub_biosdisk_get_diskinfo_standard (int drive,
 int grub_biosdisk_get_num_floppies (void);
 
 void grub_biosdisk_init (void);
+void grub_biosdisk_fini (void);
 
 #endif /* ! GRUB_BIOSDISK_MACHINE_HEADER */
index e8a89fe0c0717cefb43580f9d00efc0794b5de5e..7e71d05379bdf274b32f1e2b700ae9ec3705d2c0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2005  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -51,6 +51,9 @@ void grub_console_setcursor (int on);
 /* Initialize the console system.  */
 void grub_console_init (void);
 
+/* Finish the console system.  */
+void grub_console_fini (void);
+
 #endif
 
 #endif /* ! GRUB_CONSOLE_MACHINE_HEADER */
index d300193379801e8d9f63ec38b20fb338a4ed13d1..4e2eca3e51f29e33e17aadc80db38599b5c40876 100644 (file)
@@ -52,6 +52,9 @@ void grub_main (void);
 /* The machine-specific initialization. This must initialize memory.  */
 void grub_machine_init (void);
 
+/* The machine-specific finalization.  */
+void grub_machine_fini (void);
+
 /* Register all the exported symbols. This is automatically generated.  */
 void grub_register_exported_symbols (void);
 
index 39a5b1b15c9003fb4894a907c5c0b50aef4ca515..3ab367fe268078f338fdf574964b0f8d7b7326d4 100644 (file)
@@ -122,6 +122,7 @@ extern grub_jmp_buf grub_exit_env;
 void grub_enter_normal_mode (const char *config);
 void grub_normal_execute (const char *config, int nested);
 void grub_menu_run (grub_menu_t menu, int nested);
+void grub_menu_entry_run (grub_menu_entry_t entry);
 void grub_cmdline_run (int nested);
 int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
                      int echo_char, int readline);
@@ -163,6 +164,10 @@ void grub_loop_init (void);
 void grub_loop_fini (void);
 void grub_help_init (void);
 void grub_help_fini (void);
+void grub_halt_init (void);
+void grub_halt_fini (void);
+void grub_reboot_init (void);
+void grub_reboot_fini (void);
 #endif
 
 #endif /* ! GRUB_NORMAL_HEADER */
index 63ec9f16353b2c9967a72c6dab9cbd4104542e85..73060f5adbddff4061a8fca7fa6e639aa6bebcf9 100644 (file)
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <setjmp.h>
 
 extern char *progname;
 extern int verbosity;
+extern jmp_buf main_env;
 
 void grub_util_info (const char *fmt, ...);
 void grub_util_error (const char *fmt, ...) __attribute__ ((noreturn));
index 3a4c32ff6a8e2b9e732e0b40f8a1953ee2614383..d88fb66bf7bbcb304e1e2bfa394d638f74def901 100644 (file)
@@ -232,6 +232,13 @@ grub_machine_init (void)
   grub_env_set ("prefix", make_install_device ());
 }
 
+void
+grub_machine_fini (void)
+{
+  grub_biosdisk_fini ();
+  grub_console_fini ();
+}
+
 /* Return the end of the core image.  */
 grub_addr_t
 grub_arch_modules_addr (void)
index ea7a05a9ec51d7961c6581aa779f819d6b809acc..9b225945a83513c14f65ad86d17dbe4fb2159d6e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2003  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2003,2005  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -123,3 +123,9 @@ grub_console_init (void)
   grub_term_register (&grub_console_term);
   grub_term_set_current (&grub_console_term);
 }
+
+void
+grub_console_fini (void)
+{
+  grub_term_unregister (&grub_console_term);
+}
index a0918f8b69b0c68c7e79410a7d0e85bb62733961..5740590808a0d240dce33e29b9896718b14bfccf 100644 (file)
@@ -1,7 +1,7 @@
 /*  console.c -- Ncurses console for GRUB.  */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003  Free Software Foundation, Inc.
+ *  Copyright (C) 2003,2005  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -206,3 +206,9 @@ grub_console_init (void)
   grub_term_register (&grub_ncurses_term);
   grub_term_set_current (&grub_ncurses_term);
 }
+
+void
+grub_console_fini (void)
+{
+  grub_ncurses_fini ();
+}
index 766b709f65178b6d791e7aacef8b10861099b2ef..60fdaa947548bb77713c283a2c5ce81cc2826c06 100644 (file)
@@ -22,6 +22,7 @@
 #include <sys/stat.h>
 #include <argp.h>
 #include <string.h>
+#include <signal.h>
 
 #include <grub/mm.h>
 #include <grub/setjmp.h>
@@ -45,6 +46,9 @@
 
 #define DEFAULT_DEVICE_MAP     DEFAULT_DIRECTORY "/device.map"
 
+/* Used for going back to the main function.  */
+jmp_buf main_env;
+
 grub_addr_t
 grub_arch_modules_addr (void)
 {
@@ -71,8 +75,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
 void
 grub_machine_init (void)
 {
+  signal (SIGINT, SIG_IGN);
   grub_console_init ();
 }
+
+void
+grub_machine_fini (void)
+{
+  grub_console_fini ();
+}
 \f
 
 const char *argp_program_version = PACKAGE_STRING;
@@ -139,7 +150,7 @@ main (int argc, char *argv[])
   
   argp_parse (&argp, argc, argv, 0, 0, &args);
 
-  /* More sure there is a root device.  */
+  /* Make sure that there is a root device.  */
   if (! args.root_dev)
     {
       args.root_dev = grub_guess_root_device (args.dir ? : DEFAULT_DIRECTORY);
@@ -177,13 +188,18 @@ main (int argc, char *argv[])
   grub_terminal_init ();
   grub_loop_init ();
   grub_help_init ();
+  grub_halt_init ();
+  grub_reboot_init ();
   
   /* XXX: Should normal mode be started by default?  */
   grub_normal_init ();
 
   /* Start GRUB!  */
-  grub_main ();
+  if (setjmp (main_env) == 0)
+    grub_main ();
 
+  grub_reboot_fini ();
+  grub_halt_fini ();
   grub_help_fini ();
   grub_loop_fini ();
   grub_util_biosdisk_fini ();
@@ -201,6 +217,8 @@ main (int argc, char *argv[])
   grub_amiga_partition_map_fini ();
   grub_pc_partition_map_fini ();
   grub_apple_partition_map_fini ();
+
+  grub_machine_fini ();
   
   return 0;
 }
diff --git a/util/i386/pc/misc.c b/util/i386/pc/misc.c
new file mode 100644 (file)
index 0000000..c180b1c
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2005  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <setjmp.h>
+
+#include <grub/util/misc.h>
+
+void
+grub_reboot (void)
+{
+  longjmp (main_env, 1);
+}
+
+void
+grub_halt (int no_apm __attribute__ ((unused)))
+{
+  grub_reboot ();
+}