93f3a1d868
* commands/default.h: New file. * commands/timeout.h: Likewise. * normal/context.c: Likewise. * util/misc.c: Do not include sys/times.h. Include sys/time.h and grub/machine/time.h. (grub_get_rtc): Rewritten with gettimeofday. * util/grub-emu.c (main): Call grub_default_init and grub_timeout_init before grub_normal_init, and call grub_timeout_fini and grub_default_fini after grub_main. * util/console.c (grub_ncurses_checkkey): Return the read character or -1. * normal/menu.c (run_menu): Set MENU->TIMEOUT to -1 once it timeouts. * normal/main.c (read_config_file): Push MENU. If this fails, print an error and wait for a user input. Print an error only if GRUB_ERRNO is not GRUB_ERR_NONE. If a menu is empty or an error occurs, pop MENU. (grub_normal_execute): Pop and free MENU after grub_menu_run returns. * kern/loader.c (grub_loader_boot): Call grub_machine_fini. * include/grub/powerpc/ieee1275/time.h [GRUB_UTIL]: Do not include time.h. [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as without GRUB_UTIL. * include/grub/i386/pc/time.h [GRUB_UTIL]: Do not include time.h. [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as without GRUB_UTIL. * include/grub/normal.h (struct grub_menu_list): New struct. (grub_menu_list_t): New type. (struct grub_context): New struct. (grub_context_t): New type. (grub_register_command): Got rid of EXPORT_FUNC. (grub_unregister_command): Likewise. (grub_context_get): New prototype. (grub_context_get_current_menu): Likewise. (grub_context_push_menu): Likewise. (grub_context_pop_menu): Likewise. [GRUB_UTIL] (grub_default_init): Likewise. [GRUB_UTIL] (grub_default_fini): Likewise. [GRUB_UTIL] (grub_timeout_init): Likewise. [GRUB_UTIL] (grub_timeout_fini): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/default.c, commands/timeout.c and normal/context.c. (pkgdata_MODULES): Added default.mod and timeout.mod. (normal_mod_SOURCES): Added normal/context.c. (default_mod_SOURCES): New variable. (default_mod_CFLAGS): Likewise. (timeout_mod_SOURCES): Likewise. (timeout_mod_CFLAGS): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Copied from conf/i386-pc.rmk. (pkgdata_MODULES): Added default.mod and timeout.mod. (normal_mod_SOURCES): Added normal/context.c. (default_mod_SOURCES): New variable. (default_mod_CFLAGS): Likewise. (timeout_mod_SOURCES): Likewise. (timeout_mod_CFLAGS): Likewise. * Makefile.in (all-local): Added $(MKFILES).
231 lines
6.7 KiB
Makefile
231 lines
6.7 KiB
Makefile
# -*- makefile -*-
|
|
|
|
COMMON_ASFLAGS = -nostdinc -fno-builtin
|
|
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3
|
|
|
|
# Images.
|
|
pkgdata_IMAGES = boot.img diskboot.img kernel.img pxeboot.img
|
|
|
|
# For boot.img.
|
|
boot_img_SOURCES = boot/i386/pc/boot.S
|
|
boot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
boot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
|
|
|
|
# For pxeboot.img
|
|
pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S
|
|
pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
pxeboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000
|
|
|
|
# For diskboot.img.
|
|
diskboot_img_SOURCES = boot/i386/pc/diskboot.S
|
|
diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
diskboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000
|
|
|
|
# For kernel.img.
|
|
kernel_img_SOURCES = kern/i386/pc/startup.S 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/i386/dl.c kern/i386/pc/init.c kern/partition.c \
|
|
kern/env.c disk/i386/pc/biosdisk.c \
|
|
term/i386/pc/console.c \
|
|
symlist.c
|
|
kernel_img_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
|
|
file.h fs.h kernel.h loader.h misc.h mm.h net.h rescue.h symbol.h \
|
|
term.h types.h machine/biosdisk.h machine/boot.h \
|
|
machine/console.h machine/init.h machine/memory.h \
|
|
machine/loader.h partition.h pc_partition.h machine/time.h machine/vga.h
|
|
kernel_img_CFLAGS = $(COMMON_CFLAGS)
|
|
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8200
|
|
|
|
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) gensymlist.sh
|
|
sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
|
|
|
|
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) genkernsyms.sh
|
|
sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
|
|
|
|
# Utilities.
|
|
bin_UTILITIES = grub-mkimage
|
|
sbin_UTILITIES = grub-setup grub-emu
|
|
noinst_UTILITIES = genmoddep
|
|
|
|
# For grub-mkimage.
|
|
grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
|
|
util/resolve.c
|
|
grub_mkimage_LDFLAGS = -llzo
|
|
|
|
# For grub-setup.
|
|
grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \
|
|
util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \
|
|
kern/err.c kern/misc.c fs/fat.c fs/ext2.c \
|
|
kern/partition.c partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.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_emu.
|
|
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
|
|
commands/default.c commands/help.c commands/terminal.c \
|
|
commands/ls.c commands/timeout.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/context.c \
|
|
normal/main.c normal/menu.c normal/menu_entry.c \
|
|
partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.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.
|
|
genmoddep_SOURCES = util/genmoddep.c
|
|
|
|
# Modules.
|
|
pkgdata_MODULES = _chain.mod _linux.mod linux.mod fat.mod ufs.mod \
|
|
ext2.mod minix.mod hfs.mod jfs.mod normal.mod hello.mod vga.mod \
|
|
font.mod _multiboot.mod ls.mod boot.mod cmp.mod cat.mod \
|
|
terminal.mod fshelp.mod chain.mod multiboot.mod amiga.mod \
|
|
apple.mod pc.mod sun.mod loopback.mod reboot.mod halt.mod \
|
|
help.mod default.mod timeout.mod
|
|
|
|
# For _chain.mod.
|
|
_chain_mod_SOURCES = loader/i386/pc/chainloader.c
|
|
_chain_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For chain.mod.
|
|
chain_mod_SOURCES = loader/i386/pc/chainloader_normal.c
|
|
chain_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For fshelp.mod.
|
|
fshelp_mod_SOURCES = fs/fshelp.c
|
|
fshelp_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For fat.mod.
|
|
fat_mod_SOURCES = fs/fat.c
|
|
fat_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For ext2.mod.
|
|
ext2_mod_SOURCES = fs/ext2.c
|
|
ext2_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For ufs.mod.
|
|
ufs_mod_SOURCES = fs/ufs.c
|
|
ufs_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For minix.mod.
|
|
minix_mod_SOURCES = fs/minix.c
|
|
minix_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For hfs.mod.
|
|
hfs_mod_SOURCES = fs/hfs.c
|
|
hfs_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For jfs.mod.
|
|
jfs_mod_SOURCES = fs/jfs.c
|
|
jfs_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For iso9660.mod.
|
|
iso9660_mod_SOURCES = fs/iso9660.c
|
|
iso9660_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For _linux.mod.
|
|
_linux_mod_SOURCES = loader/i386/pc/linux.c
|
|
_linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For linux.mod.
|
|
linux_mod_SOURCES = loader/i386/pc/linux_normal.c
|
|
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For normal.mod.
|
|
normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \
|
|
normal/context.c normal/main.c normal/menu.c \
|
|
normal/menu_entry.c normal/i386/setjmp.S
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
# For hello.mod.
|
|
hello_mod_SOURCES = hello/hello.c
|
|
hello_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For boot.mod.
|
|
boot_mod_SOURCES = commands/boot.c
|
|
boot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For terminal.mod.
|
|
terminal_mod_SOURCES = commands/terminal.c
|
|
terminal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For ls.mod.
|
|
ls_mod_SOURCES = commands/ls.c
|
|
ls_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For cmp.mod.
|
|
cmp_mod_SOURCES = commands/cmp.c
|
|
cmp_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For cat.mod.
|
|
cat_mod_SOURCES = commands/cat.c
|
|
cat_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For help.mod.
|
|
help_mod_SOURCES = commands/help.c
|
|
help_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For reboot.mod.
|
|
reboot_mod_SOURCES = commands/i386/pc/reboot.c
|
|
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For halt.mod.
|
|
halt_mod_SOURCES = commands/i386/pc/halt.c
|
|
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For vga.mod.
|
|
vga_mod_SOURCES = term/i386/pc/vga.c
|
|
vga_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For font.mod.
|
|
font_mod_SOURCES = font/manager.c
|
|
font_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For _multiboot.mod.
|
|
_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c
|
|
_multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For multiboot.mod.
|
|
multiboot_mod_SOURCES = loader/i386/pc/multiboot_normal.c
|
|
multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For amiga.mod
|
|
amiga_mod_SOURCES = partmap/amiga.c
|
|
amiga_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For apple.mod
|
|
apple_mod_SOURCES = partmap/apple.c
|
|
apple_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For pc.mod
|
|
pc_mod_SOURCES = partmap/pc.c
|
|
pc_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For sun.mod
|
|
sun_mod_SOURCES = partmap/sun.c
|
|
sun_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For loopback.mod
|
|
loopback_mod_SOURCES = disk/loopback.c
|
|
loopback_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For default.mod
|
|
default_mod_SOURCES = commands/default.c
|
|
default_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For timeout.mod
|
|
timeout_mod_SOURCES = commands/timeout.c
|
|
timeout_mod_CFLAGS = $(COMMON_CFLAGS)
|