From 4e93851c0fd7467290d3539298a446a424178b58 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 7 May 2006 18:28:24 +0000 Subject: [PATCH] 2006-05-07 Yoshinori K. Okuji Use the environment context in the menu. Remove the commands "default" and "timeout", and use variables instead. * normal/menu.c: Include grub/env.h. (print_entry): Cast TITLE to silence gcc. (get_timeout): New function. (set_timeout): Likewise. (get_entry_number): Likewise. (run_menu): Use a default entry, a fallback entry and a timeout in the environment variables "default", "fallback" and "timeout". Also, tweak the default entry if it is not within the current menu entries. (grub_menu_run): Use a fallback entry in the environment variable "fallback". * normal/main.c (read_config_file): Do not initialize NEWMENU->DEFAULT_ENTRY, NEWMENU->FALLBACK_ENTRY or NEWMENU->TIMEOUT. (grub_normal_execute): Use a data slot to store the menu. * include/grub/normal.h (struct grub_menu): Removed default_entry, fallback_entry and timeout. (struct grub_menu_list): Removed. (grub_menu_list_t): Likewise. (struct grub_context): Likewise. (grub_context_t): Likewise. (grub_context_get): Likewise. (grub_context_get_current_menu): Likewise. (grub_context_push_menu): Likewise. (grub_context_pop_menu): Likewise. (grub_default_init): Likewise. (grub_default_fini): Likewise. (grub_timeout_init): Likewise. (grub_timeout_fini): Likewise. * conf/sparc64-ieee1275.rmk (pkgdata_MODULES): Removed default.mod and timeout.mod. (normal_mod_SOURCES): Removed normal/context.c. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. * conf/i386-pc.rmk (grub_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Removed commands/default.c, commands/timeout.c and normal/context.c. (normal_mod_SOURCES): Removed normal/context.c. * conf/common.rmk (pkgdata_MODULES): Removed default.mod and timeout.mod. (default_mod_SOURCES): Removed. (default_mod_CFLAGS): Likewise. (default_mod_LDFLAGS): Likewise. (timeout_mod_SOURCES): Removed. (timeout_mod_CFLAGS): Likewise. (timeout_mod_LDFLAGS): Likewise. * DISTLIST: Removed commands/default.c, commands/timeout.c and normal/context.c. * commands/default.c: Removed. * commands/timeout.c: Likewise. * normal/context.c: Likewise. --- ChangeLog | 69 ++++++++++++++++++++ DISTLIST | 3 - commands/default.c | 57 ----------------- commands/timeout.c | 55 ---------------- conf/common.mk | 114 +-------------------------------- conf/common.rmk | 12 +--- conf/i386-efi.mk | 33 ++-------- conf/i386-efi.rmk | 8 +-- conf/i386-pc.mk | 65 ++++--------------- conf/i386-pc.rmk | 10 +-- conf/powerpc-ieee1275.mk | 63 +++--------------- conf/powerpc-ieee1275.rmk | 8 +-- conf/sparc64-ieee1275.mk | 131 ++------------------------------------ conf/sparc64-ieee1275.rmk | 4 +- include/grub/normal.h | 35 +--------- normal/context.c | 75 ---------------------- normal/main.c | 8 +-- normal/menu.c | 118 +++++++++++++++++++++++++++++----- 18 files changed, 225 insertions(+), 643 deletions(-) delete mode 100644 commands/default.c delete mode 100644 commands/timeout.c delete mode 100644 normal/context.c diff --git a/ChangeLog b/ChangeLog index e85a7cf81..c31e53409 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,72 @@ +2006-05-07 Yoshinori K. Okuji + + Use the environment context in the menu. Remove the commands + "default" and "timeout", and use variables instead. + + * normal/menu.c: Include grub/env.h. + (print_entry): Cast TITLE to silence gcc. + (get_timeout): New function. + (set_timeout): Likewise. + (get_entry_number): Likewise. + (run_menu): Use a default entry, a fallback entry and a timeout + in the environment variables "default", "fallback" and + "timeout". Also, tweak the default entry if it is not within the + current menu entries. + (grub_menu_run): Use a fallback entry in the environment variable + "fallback". + + * normal/main.c (read_config_file): Do not initialize + NEWMENU->DEFAULT_ENTRY, NEWMENU->FALLBACK_ENTRY or + NEWMENU->TIMEOUT. + (grub_normal_execute): Use a data slot to store the menu. + + * include/grub/normal.h (struct grub_menu): Removed default_entry, + fallback_entry and timeout. + (struct grub_menu_list): Removed. + (grub_menu_list_t): Likewise. + (struct grub_context): Likewise. + (grub_context_t): Likewise. + (grub_context_get): Likewise. + (grub_context_get_current_menu): Likewise. + (grub_context_push_menu): Likewise. + (grub_context_pop_menu): Likewise. + (grub_default_init): Likewise. + (grub_default_fini): Likewise. + (grub_timeout_init): Likewise. + (grub_timeout_fini): Likewise. + + * conf/sparc64-ieee1275.rmk (pkgdata_MODULES): Removed default.mod + and timeout.mod. + (normal_mod_SOURCES): Removed normal/context.c. + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Removed + commands/default.c, commands/timeout.c and normal/context.c. + (normal_mod_SOURCES): Removed normal/context.c. + + * conf/i386-pc.rmk (grub_emu_SOURCES): Removed commands/default.c, + commands/timeout.c and normal/context.c. + (normal_mod_SOURCES): Removed normal/context.c. + + * conf/i386-efi.rmk (grub_emu_SOURCES): Removed + commands/default.c, commands/timeout.c and normal/context.c. + (normal_mod_SOURCES): Removed normal/context.c. + + * conf/common.rmk (pkgdata_MODULES): Removed default.mod and + timeout.mod. + (default_mod_SOURCES): Removed. + (default_mod_CFLAGS): Likewise. + (default_mod_LDFLAGS): Likewise. + (timeout_mod_SOURCES): Removed. + (timeout_mod_CFLAGS): Likewise. + (timeout_mod_LDFLAGS): Likewise. + + * DISTLIST: Removed commands/default.c, commands/timeout.c and + normal/context.c. + + * commands/default.c: Removed. + * commands/timeout.c: Likewise. + * normal/context.c: Likewise. + 2006-05-07 Vesa Jaaskelainen * kern/i386/pc/startup.S (grub_exit): Added missing .code32 tag. diff --git a/DISTLIST b/DISTLIST index 3aeccc781..725fd14cd 100644 --- a/DISTLIST +++ b/DISTLIST @@ -34,13 +34,11 @@ commands/boot.c commands/cat.c commands/cmp.c commands/configfile.c -commands/default.c commands/help.c commands/ls.c commands/search.c commands/terminal.c commands/test.c -commands/timeout.c commands/videotest.c commands/i386/pc/halt.c commands/i386/pc/play.c @@ -213,7 +211,6 @@ normal/arg.c normal/cmdline.c normal/command.c normal/completion.c -normal/context.c normal/execute.c normal/function.c normal/lexer.c diff --git a/commands/default.c b/commands/default.c deleted file mode 100644 index 43a95a0a7..000000000 --- a/commands/default.c +++ /dev/null @@ -1,57 +0,0 @@ -/* default.c - set the default boot entry */ -/* - * 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 -#include -#include -#include -#include - -/* This is a simple version. This should support a saved boot entry, - a label, etc. */ -static grub_err_t -grub_cmd_default (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_menu_t menu; - - if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "entry number required"); - - menu = grub_context_get_current_menu (); - if (menu) - menu->default_entry = grub_strtoul (args[0], 0, 0); - - return grub_errno; -} - - - -GRUB_MOD_INIT(default) -{ - (void)mod; /* To stop warning. */ - grub_register_command ("default", grub_cmd_default, GRUB_COMMAND_FLAG_MENU, - "default ENTRY", "Set the default entry", 0); -} - -GRUB_MOD_FINI(default) -{ - grub_unregister_command ("default"); -} diff --git a/commands/timeout.c b/commands/timeout.c deleted file mode 100644 index c796aa8b0..000000000 --- a/commands/timeout.c +++ /dev/null @@ -1,55 +0,0 @@ -/* timeout.c - set the timeout */ -/* - * 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 -#include -#include -#include -#include - -static grub_err_t -grub_cmd_timeout (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_menu_t menu; - - if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "timeout value required"); - - menu = grub_context_get_current_menu (); - if (menu) - menu->timeout = grub_strtoul (args[0], 0, 0); - - return grub_errno; -} - - - -GRUB_MOD_INIT(timeout) -{ - (void)mod; /* To stop warning. */ - grub_register_command ("timeout", grub_cmd_timeout, GRUB_COMMAND_FLAG_MENU, - "timeout SECS", "Set the timeout", 0); -} - -GRUB_MOD_FINI(timeout) -{ - grub_unregister_command ("timeout"); -} diff --git a/conf/common.mk b/conf/common.mk index 34cc22a76..3e1548542 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1039,7 +1039,7 @@ gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkgdata_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ - loopback.mod default.mod timeout.mod configfile.mod \ + loopback.mod configfile.mod \ terminfo.mod test.mod # For hello.mod. @@ -1658,118 +1658,6 @@ fs-loopback_mod-disk_loopback.lst: disk/loopback.c genfslist.sh loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For default.mod -default_mod_SOURCES = commands/default.c -CLEANFILES += default.mod mod-default.o mod-default.c pre-default.o default_mod-commands_default.o und-default.lst -ifneq ($(default_mod_EXPORTS),no) -CLEANFILES += def-default.lst -DEFSYMFILES += def-default.lst -endif -MOSTLYCLEANFILES += default_mod-commands_default.d -UNDSYMFILES += und-default.lst - -default.mod: pre-default.o mod-default.o - -rm -f $@ - $(CC) $(default_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ - -pre-default.o: default_mod-commands_default.o - -rm -f $@ - $(CC) $(default_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - -mod-default.o: mod-default.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $< - -mod-default.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'default' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(default_mod_EXPORTS),no) -def-default.lst: pre-default.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 default/' > $@ -endif - -und-default.lst: pre-default.o - echo 'default' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -default_mod-commands_default.o: commands/default.c - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $< - -default_mod-commands_default.d: commands/default.c - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -M $< | sed 's,default\.o[ :]*,default_mod-commands_default.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include default_mod-commands_default.d - -CLEANFILES += cmd-default_mod-commands_default.lst fs-default_mod-commands_default.lst -COMMANDFILES += cmd-default_mod-commands_default.lst -FSFILES += fs-default_mod-commands_default.lst - -cmd-default_mod-commands_default.lst: commands/default.c gencmdlist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh default > $@ || (rm -f $@; exit 1) - -fs-default_mod-commands_default.lst: commands/default.c genfslist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh default > $@ || (rm -f $@; exit 1) - - -default_mod_CFLAGS = $(COMMON_CFLAGS) -default_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For timeout.mod -timeout_mod_SOURCES = commands/timeout.c -CLEANFILES += timeout.mod mod-timeout.o mod-timeout.c pre-timeout.o timeout_mod-commands_timeout.o und-timeout.lst -ifneq ($(timeout_mod_EXPORTS),no) -CLEANFILES += def-timeout.lst -DEFSYMFILES += def-timeout.lst -endif -MOSTLYCLEANFILES += timeout_mod-commands_timeout.d -UNDSYMFILES += und-timeout.lst - -timeout.mod: pre-timeout.o mod-timeout.o - -rm -f $@ - $(CC) $(timeout_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ - -pre-timeout.o: timeout_mod-commands_timeout.o - -rm -f $@ - $(CC) $(timeout_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - -mod-timeout.o: mod-timeout.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $< - -mod-timeout.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'timeout' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(timeout_mod_EXPORTS),no) -def-timeout.lst: pre-timeout.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 timeout/' > $@ -endif - -und-timeout.lst: pre-timeout.o - echo 'timeout' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -timeout_mod-commands_timeout.o: commands/timeout.c - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $< - -timeout_mod-commands_timeout.d: commands/timeout.c - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -M $< | sed 's,timeout\.o[ :]*,timeout_mod-commands_timeout.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include timeout_mod-commands_timeout.d - -CLEANFILES += cmd-timeout_mod-commands_timeout.lst fs-timeout_mod-commands_timeout.lst -COMMANDFILES += cmd-timeout_mod-commands_timeout.lst -FSFILES += fs-timeout_mod-commands_timeout.lst - -cmd-timeout_mod-commands_timeout.lst: commands/timeout.c gencmdlist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh timeout > $@ || (rm -f $@; exit 1) - -fs-timeout_mod-commands_timeout.lst: commands/timeout.c genfslist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh timeout > $@ || (rm -f $@; exit 1) - - -timeout_mod_CFLAGS = $(COMMON_CFLAGS) -timeout_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For configfile.mod configfile_mod_SOURCES = commands/configfile.c CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o und-configfile.lst diff --git a/conf/common.rmk b/conf/common.rmk index 870570741..686e3ede1 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -121,7 +121,7 @@ gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkgdata_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ - loopback.mod default.mod timeout.mod configfile.mod \ + loopback.mod configfile.mod \ terminfo.mod test.mod # For hello.mod. @@ -179,16 +179,6 @@ loopback_mod_SOURCES = disk/loopback.c loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For default.mod -default_mod_SOURCES = commands/default.c -default_mod_CFLAGS = $(COMMON_CFLAGS) -default_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For timeout.mod -timeout_mod_SOURCES = commands/timeout.c -timeout_mod_CFLAGS = $(COMMON_CFLAGS) -timeout_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For configfile.mod configfile_mod_SOURCES = commands/configfile.c configfile_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 29bf011d0..4c9219f24 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -63,10 +63,10 @@ grub_mkimage-util_resolve.d: util/resolve.c # fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c # For grub-emu. -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ +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 \ - commands/search.c commands/timeout.c \ + commands/search.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -629,16 +629,16 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c grub_script.tab.c \ normal/script.c normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o @@ -646,7 +646,7 @@ normal.mod: pre-normal.o mod-normal.o $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ @@ -741,25 +741,6 @@ fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_context.o: normal/context.c - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -normal_mod-normal_context.d: normal/context.c - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,context\.o[ :]*,normal_mod-normal_context.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include normal_mod-normal_context.d - -CLEANFILES += cmd-normal_mod-normal_context.lst fs-normal_mod-normal_context.lst -COMMANDFILES += cmd-normal_mod-normal_context.lst -FSFILES += fs-normal_mod-normal_context.lst - -cmd-normal_mod-normal_context.lst: normal/context.c gencmdlist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_context.lst: normal/context.c genfslist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_execute.o: normal/execute.c $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index b1d342f36..e8d62b999 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -33,10 +33,10 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ # fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c # For grub-emu. -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ +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 \ - commands/search.c commands/timeout.c \ + commands/search.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -97,7 +97,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c grub_script.tab.c \ normal/script.c normal/i386/setjmp.S diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index b774b7aed..bac9120a8 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -763,10 +763,10 @@ grub_probefs-fs_hfsplus.d: fs/hfsplus.c # For grub-emu. -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ +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 \ - commands/search.c commands/timeout.c \ + commands/search.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -777,17 +777,17 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/context.c normal/main.c \ + normal/completion.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.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_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.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_function.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.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 grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_timeout.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.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_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.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-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.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_function.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.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_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.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_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.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 grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.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_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.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-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.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_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.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_init.d -grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.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_function.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.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 grub_emu-grub_emu_init.o +grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.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_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.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 grub_emu-grub_emu_init.o $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c @@ -822,14 +822,6 @@ grub_emu-commands_configfile.d: commands/configfile.c -include grub_emu-commands_configfile.d -grub_emu-commands_default.o: commands/default.c - $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< - -grub_emu-commands_default.d: commands/default.c - set -e; $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,default\.o[ :]*,grub_emu-commands_default.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include grub_emu-commands_default.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 $@ $< @@ -870,14 +862,6 @@ grub_emu-commands_search.d: commands/search.c -include grub_emu-commands_search.d -grub_emu-commands_timeout.o: commands/timeout.c - $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< - -grub_emu-commands_timeout.d: commands/timeout.c - set -e; $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,timeout\.o[ :]*,grub_emu-commands_timeout.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include grub_emu-commands_timeout.d - 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 $@ $< @@ -1182,14 +1166,6 @@ grub_emu-normal_completion.d: normal/completion.c -include grub_emu-normal_completion.d -grub_emu-normal_context.o: normal/context.c - $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< - -grub_emu-normal_context.d: normal/context.c - set -e; $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,context\.o[ :]*,grub_emu-normal_context.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include grub_emu-normal_context.d - grub_emu-normal_main.o: normal/main.c $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< @@ -1598,16 +1574,16 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c grub_script.tab.c \ normal/script.c normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o @@ -1615,7 +1591,7 @@ normal.mod: pre-normal.o mod-normal.o $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ @@ -1710,25 +1686,6 @@ fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_context.o: normal/context.c - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -normal_mod-normal_context.d: normal/context.c - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,context\.o[ :]*,normal_mod-normal_context.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include normal_mod-normal_context.d - -CLEANFILES += cmd-normal_mod-normal_context.lst fs-normal_mod-normal_context.lst -COMMANDFILES += cmd-normal_mod-normal_context.lst -FSFILES += fs-normal_mod-normal_context.lst - -cmd-normal_mod-normal_context.lst: normal/context.c gencmdlist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_context.lst: normal/context.c genfslist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_execute.o: normal/execute.c $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 811137dfc..d02a6ed78 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -79,10 +79,10 @@ grub_probefs_SOURCES = util/i386/pc/grub-probefs.c \ fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c # For grub-emu. -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ +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 \ - commands/search.c commands/timeout.c \ + commands/search.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -93,7 +93,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/context.c normal/main.c \ + normal/completion.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ @@ -140,7 +140,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c grub_script.tab.c \ normal/script.c normal/i386/setjmp.S diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 692f044ae..9afc70ba9 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -66,9 +66,9 @@ grub_mkimage-util_resolve.d: util/resolve.c # For grub-emu grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ + commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ - commands/ls.c commands/timeout.c \ + commands/ls.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -78,7 +78,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ @@ -86,10 +86,10 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/console.c util/grub-emu.c util/misc.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ util/powerpc/ieee1275/misc.c grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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_parser.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_completion.o grub_emu-normal_context.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.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_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.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_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.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_parser.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_completion.d grub_emu-normal_context.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.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_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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_parser.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_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.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_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.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_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.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_parser.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_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.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_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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_parser.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_completion.o grub_emu-normal_context.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.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_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.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_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.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_parser.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_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.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_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c @@ -124,14 +124,6 @@ grub_emu-commands_configfile.d: commands/configfile.c -include grub_emu-commands_configfile.d -grub_emu-commands_default.o: commands/default.c - $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< - -grub_emu-commands_default.d: commands/default.c - set -e; $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,default\.o[ :]*,grub_emu-commands_default.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include grub_emu-commands_default.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 $@ $< @@ -172,14 +164,6 @@ grub_emu-commands_ls.d: commands/ls.c -include grub_emu-commands_ls.d -grub_emu-commands_timeout.o: commands/timeout.c - $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< - -grub_emu-commands_timeout.d: commands/timeout.c - set -e; $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,timeout\.o[ :]*,grub_emu-commands_timeout.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include grub_emu-commands_timeout.d - grub_emu-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< @@ -452,14 +436,6 @@ grub_emu-normal_completion.d: normal/completion.c -include grub_emu-normal_completion.d -grub_emu-normal_context.o: normal/context.c - $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< - -grub_emu-normal_context.d: normal/context.c - set -e; $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $< | sed 's,context\.o[ :]*,grub_emu-normal_context.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include grub_emu-normal_context.d - grub_emu-normal_execute.o: normal/execute.c $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $< @@ -1002,16 +978,16 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c grub_script.tab.c \ normal/script.c normal/powerpc/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o @@ -1019,7 +995,7 @@ normal.mod: pre-normal.o mod-normal.o $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o +pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o -rm -f $@ $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ @@ -1114,25 +1090,6 @@ fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_context.o: normal/context.c - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -normal_mod-normal_context.d: normal/context.c - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,context\.o[ :]*,normal_mod-normal_context.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include normal_mod-normal_context.d - -CLEANFILES += cmd-normal_mod-normal_context.lst fs-normal_mod-normal_context.lst -COMMANDFILES += cmd-normal_mod-normal_context.lst -FSFILES += fs-normal_mod-normal_context.lst - -cmd-normal_mod-normal_context.lst: normal/context.c gencmdlist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_context.lst: normal/context.c genfslist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_execute.o: normal/execute.c $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 34872e9cd..cc38da30f 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -36,9 +36,9 @@ grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \ # For grub-emu grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ + commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ - commands/ls.c commands/timeout.c \ + commands/ls.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ disk/loopback.c \ fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ @@ -48,7 +48,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ @@ -102,7 +102,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c grub_script.tab.c \ normal/script.c normal/powerpc/setjmp.S diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 8756844b8..90dcd534b 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -288,7 +288,7 @@ pkgdata_MODULES = fat.mod ufs.mod ext2.mod minix.mod \ hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \ boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ - default.mod timeout.mod configfile.mod search.mod gzio.mod xfs.mod \ + configfile.mod search.mod gzio.mod xfs.mod \ affs.mod sfs.mod acorn.mod # For fshelp.mod. @@ -868,17 +868,17 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c normal/script.c \ normal/sparc64/setjmp.S \ grub_script.tab.c -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d normal_mod-grub_script_tab.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d normal_mod-grub_script_tab.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o @@ -886,7 +886,7 @@ normal.mod: pre-normal.o mod-normal.o $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o +pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o -rm -f $@ $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ @@ -981,25 +981,6 @@ fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_context.o: normal/context.c - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -normal_mod-normal_context.d: normal/context.c - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,context\.o[ :]*,normal_mod-normal_context.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include normal_mod-normal_context.d - -CLEANFILES += cmd-normal_mod-normal_context.lst fs-normal_mod-normal_context.lst -COMMANDFILES += cmd-normal_mod-normal_context.lst -FSFILES += fs-normal_mod-normal_context.lst - -cmd-normal_mod-normal_context.lst: normal/context.c gencmdlist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_context.lst: normal/context.c genfslist.sh - set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_execute.o: normal/execute.c $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -2147,113 +2128,11 @@ help_mod_LDFLAGS = $(COMMON_LDFLAGS) # For default.mod default_mod_SOURCES = commands/default.c -CLEANFILES += default.mod mod-default.o mod-default.c pre-default.o default_mod-commands_default.o und-default.lst -ifneq ($(default_mod_EXPORTS),no) -CLEANFILES += def-default.lst -DEFSYMFILES += def-default.lst -endif -MOSTLYCLEANFILES += default_mod-commands_default.d -UNDSYMFILES += und-default.lst - -default.mod: pre-default.o mod-default.o - -rm -f $@ - $(CC) $(default_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ - -pre-default.o: default_mod-commands_default.o - -rm -f $@ - $(CC) $(default_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - -mod-default.o: mod-default.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $< - -mod-default.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'default' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(default_mod_EXPORTS),no) -def-default.lst: pre-default.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 default/' > $@ -endif - -und-default.lst: pre-default.o - echo 'default' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -default_mod-commands_default.o: commands/default.c - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $< - -default_mod-commands_default.d: commands/default.c - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -M $< | sed 's,default\.o[ :]*,default_mod-commands_default.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include default_mod-commands_default.d - -CLEANFILES += cmd-default_mod-commands_default.lst fs-default_mod-commands_default.lst -COMMANDFILES += cmd-default_mod-commands_default.lst -FSFILES += fs-default_mod-commands_default.lst - -cmd-default_mod-commands_default.lst: commands/default.c gencmdlist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh default > $@ || (rm -f $@; exit 1) - -fs-default_mod-commands_default.lst: commands/default.c genfslist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh default > $@ || (rm -f $@; exit 1) - - default_mod_CFLAGS = $(COMMON_CFLAGS) default_mod_LDFLAGS = $(COMMON_LDFLAGS) # For timeout.mod timeout_mod_SOURCES = commands/timeout.c -CLEANFILES += timeout.mod mod-timeout.o mod-timeout.c pre-timeout.o timeout_mod-commands_timeout.o und-timeout.lst -ifneq ($(timeout_mod_EXPORTS),no) -CLEANFILES += def-timeout.lst -DEFSYMFILES += def-timeout.lst -endif -MOSTLYCLEANFILES += timeout_mod-commands_timeout.d -UNDSYMFILES += und-timeout.lst - -timeout.mod: pre-timeout.o mod-timeout.o - -rm -f $@ - $(CC) $(timeout_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ - -pre-timeout.o: timeout_mod-commands_timeout.o - -rm -f $@ - $(CC) $(timeout_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^ - -mod-timeout.o: mod-timeout.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $< - -mod-timeout.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'timeout' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(timeout_mod_EXPORTS),no) -def-timeout.lst: pre-timeout.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 timeout/' > $@ -endif - -und-timeout.lst: pre-timeout.o - echo 'timeout' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -timeout_mod-commands_timeout.o: commands/timeout.c - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $< - -timeout_mod-commands_timeout.d: commands/timeout.c - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -M $< | sed 's,timeout\.o[ :]*,timeout_mod-commands_timeout.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ - --include timeout_mod-commands_timeout.d - -CLEANFILES += cmd-timeout_mod-commands_timeout.lst fs-timeout_mod-commands_timeout.lst -COMMANDFILES += cmd-timeout_mod-commands_timeout.lst -FSFILES += fs-timeout_mod-commands_timeout.lst - -cmd-timeout_mod-commands_timeout.lst: commands/timeout.c gencmdlist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh timeout > $@ || (rm -f $@; exit 1) - -fs-timeout_mod-commands_timeout.lst: commands/timeout.c genfslist.sh - set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh timeout > $@ || (rm -f $@; exit 1) - - timeout_mod_CFLAGS = $(COMMON_CFLAGS) timeout_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 727127ae9..5b1101977 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -84,7 +84,7 @@ pkgdata_MODULES = fat.mod ufs.mod ext2.mod minix.mod \ hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \ boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ - default.mod timeout.mod configfile.mod search.mod gzio.mod xfs.mod \ + configfile.mod search.mod gzio.mod xfs.mod \ affs.mod sfs.mod acorn.mod # For fshelp.mod. @@ -154,7 +154,7 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/context.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_entry.c normal/misc.c normal/script.c \ normal/sparc64/setjmp.S \ diff --git a/include/grub/normal.h b/include/grub/normal.h index 1862e272d..f73649abd 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -1,7 +1,7 @@ /* normal.h - prototypes for the normal mode */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2006 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 @@ -105,15 +105,6 @@ typedef struct grub_menu_entry *grub_menu_entry_t; /* The menu. */ struct grub_menu { - /* The default entry number. */ - int default_entry; - - /* The fallback entry number. */ - int fallback_entry; - - /* The timeout to boot the default entry automatically. */ - int timeout; - /* The size of a menu. */ int size; @@ -122,22 +113,6 @@ struct grub_menu }; typedef struct grub_menu *grub_menu_t; -/* A list of menus. */ -struct grub_menu_list -{ - grub_menu_t menu; - struct grub_menu_list *next; -}; -typedef struct grub_menu_list *grub_menu_list_t; - -/* The context. A context holds some global information. */ -struct grub_context -{ - /* The menu list. */ - grub_menu_list_t menu_list; -}; -typedef struct grub_context *grub_context_t; - /* This is used to store the names of filesystem modules for auto-loading. */ struct grub_fs_module_list { @@ -175,10 +150,6 @@ void grub_menu_init_page (int nested, int edit); int grub_arg_parse (grub_command_t parser, int argc, char **argv, struct grub_arg_list *usr, char ***args, int *argnum); void grub_arg_show_help (grub_command_t cmd); -grub_context_t grub_context_get (void); -grub_menu_t grub_context_get_current_menu (void); -grub_menu_t grub_context_push_menu (grub_menu_t menu); -void grub_context_pop_menu (void); char *grub_normal_do_completion (char *buf, int *restore, void (*hook) (const char *item, grub_completion_type_t type, int count)); grub_err_t grub_normal_print_device_info (const char *name); @@ -209,10 +180,6 @@ void grub_halt_init (void); void grub_halt_fini (void); void grub_reboot_init (void); void grub_reboot_fini (void); -void grub_default_init (void); -void grub_default_fini (void); -void grub_timeout_init (void); -void grub_timeout_fini (void); void grub_configfile_init (void); void grub_configfile_fini (void); void grub_search_init (void); diff --git a/normal/context.c b/normal/context.c deleted file mode 100644 index 0125e3008..000000000 --- a/normal/context.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 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 - * 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 this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include - -static struct grub_context context = - { - .menu_list = 0 - }; - -/* Return a pointer to the context. */ -grub_context_t -grub_context_get (void) -{ - return &context; -} - -/* Return the current menu. */ -grub_menu_t -grub_context_get_current_menu (void) -{ - if (context.menu_list) - return context.menu_list->menu; - - return 0; -} - -/* Push a new menu. Return this menu. If any error occurs, return NULL. */ -grub_menu_t -grub_context_push_menu (grub_menu_t menu) -{ - grub_menu_list_t menu_list; - - menu_list = grub_malloc (sizeof (*menu_list)); - if (! menu_list) - return 0; - - menu_list->menu = menu; - menu_list->next = context.menu_list; - context.menu_list = menu_list; - - return menu; -} - -/* Pop a menu. */ -void -grub_context_pop_menu (void) -{ - grub_menu_list_t menu_list; - - menu_list = context.menu_list; - if (menu_list) - { - context.menu_list = menu_list->next; - grub_free (menu_list); - } -} - diff --git a/normal/main.c b/normal/main.c index 355d28b82..da42749d1 100644 --- a/normal/main.c +++ b/normal/main.c @@ -1,7 +1,7 @@ /* main.c - the normal mode main routine */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2001,2002,2003,2005 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002,2003,2005,2006 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 @@ -187,9 +187,6 @@ read_config_file (const char *config) newmenu = grub_malloc (sizeof (*newmenu)); if (! newmenu) return 0; - newmenu->default_entry = 0; - newmenu->fallback_entry = -1; - newmenu->timeout = -1; newmenu->size = 0; newmenu->entry_list = 0; current_menu = newmenu; @@ -431,8 +428,9 @@ grub_normal_execute (const char *config, int nested) if (menu) { + grub_env_set_data_slot ("menu", menu); grub_menu_run (menu, nested); - grub_context_pop_menu (); + grub_env_unset_data_slot ("menu"); free_menu (menu); } else diff --git a/normal/menu.c b/normal/menu.c index c32a7d987..b712581ab 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005 Free Software Foundation, Inc. + * Copyright (C) 2003,2004,2005,2006 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 @@ -23,6 +23,7 @@ #include #include #include +#include static void draw_border (void) @@ -111,7 +112,8 @@ print_entry (int y, int highlight, grub_menu_entry_t entry) /* XXX How to show this error? */ return; - len = grub_utf8_to_ucs4 (unicode_title, title, grub_strlen (title)); + len = grub_utf8_to_ucs4 (unicode_title, (grub_uint8_t *) title, + grub_strlen (title)); if (len < 0) { /* It is an invalid sequence. */ @@ -202,14 +204,92 @@ grub_menu_init_page (int nested, int edit) print_message (nested, edit); } +/* Return the current timeout. If the variable "timeout" is not set or + invalid, return -1. */ +static int +get_timeout (void) +{ + char *val; + int timeout; + + val = grub_env_get ("timeout"); + if (! val) + return -1; + + grub_error_push (); + + timeout = (int) grub_strtoul (val, 0, 0); + + /* If the value is invalid, unset the variable. */ + if (grub_errno != GRUB_ERR_NONE) + { + grub_env_unset ("timeout"); + grub_errno = GRUB_ERR_NONE; + timeout = -1; + } + + grub_error_pop (); + + return timeout; +} + +/* Set current timeout in the variable "timeout". */ +static void +set_timeout (int timeout) +{ + /* Ignore TIMEOUT if it is zero, because it will be unset really soon. */ + if (timeout > 0) + { + char buf[16]; + + grub_sprintf (buf, "%d", timeout); + grub_env_set ("timeout", buf); + } +} + +/* Get the entry number from the variable NAME. */ +static int +get_entry_number (const char *name) +{ + char *val; + int entry; + + val = grub_env_get (name); + if (! val) + return -1; + + grub_error_push (); + + entry = (int) grub_strtoul (val, 0, 0); + + if (grub_errno != GRUB_ERR_NONE) + { + grub_errno = GRUB_ERR_NONE; + entry = -1; + } + + grub_error_pop (); + + return entry; +} + static int run_menu (grub_menu_t menu, int nested) { int first, offset; unsigned long saved_time; + int default_entry; first = 0; - offset = menu->default_entry; + + default_entry = get_entry_number ("default"); + + /* If DEFAULT_ENTRY is not within the menu entries, fall back to + the first entry. */ + if (default_entry < 0 || default_entry >= menu->size) + default_entry = 0; + + offset = default_entry; if (offset > GRUB_TERM_NUM_ENTRIES - 1) { first = offset - (GRUB_TERM_NUM_ENTRIES - 1); @@ -228,15 +308,19 @@ run_menu (grub_menu_t menu, int nested) while (1) { int c; + int timeout; - if (menu->timeout > 0) + timeout = get_timeout (); + + if (timeout > 0) { unsigned long current_time; current_time = grub_get_rtc (); if (current_time - saved_time >= GRUB_TICKS_PER_SECOND) { - menu->timeout--; + timeout--; + set_timeout (timeout); saved_time = current_time; } @@ -245,28 +329,28 @@ run_menu (grub_menu_t menu, int nested) They are required to clear the line. */ grub_printf ("\ The highlighted entry will be booted automatically in %d seconds. ", - menu->timeout); + timeout); grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); grub_refresh (); } - if (menu->timeout == 0) + if (timeout == 0) { - menu->timeout = -1; - return menu->default_entry; + grub_env_unset ("timeout"); + return default_entry; } - if (grub_checkkey () >= 0 || menu->timeout < 0) + if (grub_checkkey () >= 0 || timeout < 0) { c = GRUB_TERM_ASCII_CHAR (grub_getkey ()); - if (menu->timeout >= 0) + if (timeout >= 0) { grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); grub_printf ("\ "); - menu->timeout = -1; - menu->fallback_entry = -1; + grub_env_unset ("timeout"); + grub_env_unset ("fallback"); grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); } @@ -361,6 +445,7 @@ grub_menu_run (grub_menu_t menu, int nested) { int boot_entry; grub_menu_entry_t e; + int fallback_entry; boot_entry = run_menu (menu, nested); if (boot_entry < 0) @@ -376,13 +461,14 @@ grub_menu_run (grub_menu_t menu, int nested) /* Deal with a fallback entry. */ /* FIXME: Multiple fallback entries like GRUB Legacy. */ - if (menu->fallback_entry >= 0) + fallback_entry = get_entry_number ("fallback"); + if (fallback_entry >= 0) { grub_print_error (); grub_errno = GRUB_ERR_NONE; - e = get_entry (menu, menu->fallback_entry); - menu->fallback_entry = -1; + e = get_entry (menu, fallback_entry); + grub_env_unset ("fallback"); grub_printf ("\n Falling back to \'%s\'\n\n", e->title); run_menu_entry (e); }