4e93851c0f
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.
128 lines
4.2 KiB
Makefile
128 lines
4.2 KiB
Makefile
|
|
# -*- makefile -*-
|
|
|
|
COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
|
|
COMMON_CFLAGS = -ffreestanding -msoft-float
|
|
COMMON_LDFLAGS += -nostdlib
|
|
|
|
# Images.
|
|
|
|
MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
|
|
file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h symbol.h \
|
|
term.h types.h powerpc/libgcc.h loader.h \
|
|
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
|
|
machine/kernel.h
|
|
|
|
grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) config.h gensymlist.sh
|
|
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) config.h genkernsyms.sh
|
|
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
# Programs
|
|
pkgdata_PROGRAMS = grubof
|
|
|
|
# Utilities.
|
|
bin_UTILITIES = grub-emu
|
|
sbin_UTILITIES = grub-mkimage
|
|
noinst_UTILITIES = genmoddep
|
|
|
|
# For grub-mkimage.
|
|
grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \
|
|
util/resolve.c
|
|
|
|
# For grub-emu
|
|
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
|
|
commands/configfile.c commands/help.c \
|
|
commands/search.c commands/terminal.c commands/test.c \
|
|
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 \
|
|
fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c \
|
|
io/gzio.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/parser.c kern/partition.c kern/rescue.c kern/term.c \
|
|
normal/arg.c normal/cmdline.c normal/command.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 \
|
|
partmap/acorn.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
|
|
|
|
grub_emu_LDFLAGS = $(LIBCURSES)
|
|
|
|
grubof_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
|
|
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
|
|
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
|
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
|
kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \
|
|
kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
|
|
kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \
|
|
grubof_symlist.c kern/powerpc/cache.S
|
|
grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h
|
|
grubof_CFLAGS = $(COMMON_CFLAGS)
|
|
grubof_ASFLAGS = $(COMMON_ASFLAGS)
|
|
grubof_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
|
|
-Wl,-N,-S,-Ttext,0x200000,-Bstatic
|
|
|
|
# For genmoddep.
|
|
genmoddep_SOURCES = util/genmoddep.c
|
|
|
|
# Scripts.
|
|
sbin_SCRIPTS = grub-install
|
|
|
|
# For grub-install.
|
|
grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in
|
|
|
|
# Modules.
|
|
pkgdata_MODULES = halt.mod \
|
|
_linux.mod \
|
|
linux.mod \
|
|
normal.mod \
|
|
reboot.mod \
|
|
suspend.mod
|
|
|
|
# For _linux.mod.
|
|
_linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
|
|
_linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For linux.mod.
|
|
linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c
|
|
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For normal.mod.
|
|
normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.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
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
# For suspend.mod
|
|
suspend_mod_SOURCES = commands/ieee1275/suspend.c
|
|
suspend_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For reboot.mod
|
|
reboot_mod_SOURCES = commands/ieee1275/reboot.c
|
|
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For halt.mod
|
|
halt_mod_SOURCES = commands/ieee1275/halt.c
|
|
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
include $(srcdir)/conf/common.mk
|