651c29b79e
Modularize at_keyboard.mod: * conf/i386.rmk (pkglib_MODULES): Add `at_keyboard.mod'. (at_keyboard_mod_SOURCES, at_keyboard_mod_CFLAGS) (at_keyboard_mod_LDFLAGS): New variables. Actual terminal split: * include/grub/term.h (struct grub_term): Split in ... (struct grub_term_input): ... this, and ... (struct grub_term_output): ... this. Update all users. (grub_term_set_current): Split in ... (grub_term_set_current_input): ... this, and ... (grub_term_set_current_output): ... this. (grub_term_get_current): Split in ... (grub_term_get_current_input): ... this, and ... (grub_term_get_current_output): ... this. (grub_term_register): Split in ... (grub_term_register_input): ... this, and ... (grub_term_register_output): ... this. (grub_term_unregister): Split in ... (grub_term_unregister_input): ... this, and ... (grub_term_unregister_output): ... this. (grub_term_iterate): Split in ... (grub_term_iterate_input): ... this, and ... (grub_term_iterate_output): ... this. * kern/term.c (grub_term_list): Split in ... (grub_term_list_input): ... this, and ... (grub_term_list_output): ... this. Update all users. (grub_cur_term): Split in ... (grub_cur_term_input): ... this, and ... (grub_cur_term_output): ... this. Update all users. (grub_term_set_current): Split in ... (grub_term_set_current_input): ... this, and ... (grub_term_set_current_output): ... this. (grub_term_get_current): Split in ... (grub_term_get_current_input): ... this, and ... (grub_term_get_current_output): ... this. (grub_term_register): Split in ... (grub_term_register_input): ... this, and ... (grub_term_register_output): ... this. (grub_term_unregister): Split in ... (grub_term_unregister_input): ... this, and ... (grub_term_unregister_output): ... this. (grub_term_iterate): Split in ... (grub_term_iterate_input): ... this, and ... (grub_term_iterate_output): ... this. * kern/misc.c (grub_abort): Split use of grub_term_get_current() into a check for input and one for output (and only attempt to get keys from user when input works). * util/grub-probe.c (grub_term_get_current): Split in ... (grub_term_get_current_input): ... this, and ... (grub_term_get_current_output): ... this. * util/grub-fstest.c: Likewise. * util/i386/pc/grub-setup.c: Likewise. * util/grub-editenv.c: Likewise. Portability adjustments: * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Remove `term/i386/pc/at_keyboard.c'. * kern/ieee1275/init.c [__i386__] (grub_machine_init): Remove call to grub_keyboard_controller_init() (now handled by terminal .init). * kern/i386/coreboot/init.c (grub_machine_init): Add call to grub_at_keyboard_init(). * include/grub/i386/ieee1275/console.h (grub_keyboard_controller_init) (grub_console_checkkey, grub_console_getkey): Remove (now provided by at_keyboard.mod via input terminal interface). * include/grub/i386/coreboot/console.h: Convert into a stub for `<grub/i386/pc/console.h>'. Migrate full terminals to new API: * term/efi/console.c (grub_console_term): Split into ... (grub_console_term_input): ... this, and ... (grub_console_term_output): ... this. Update all users. * term/ieee1275/ofconsole.c: Remove __i386__ hack. (grub_ofconsole_init): Split into ... (grub_ofconsole_init_input): ... this, and ... (grub_ofconsole_init_output): ... this. (grub_ofconsole_term): Split into ... (grub_ofconsole_term_input): ... this, and ... (grub_ofconsole_term_output): ... this. Update all users. * term/i386/pc/serial.c (grub_serial_term): Split into ... (grub_serial_term_input): ... this, and ... (grub_serial_term_output): ... this. Update all users. * term/i386/pc/console.c (grub_console_term): Split into ... (grub_console_term_input): ... this, and ... (grub_console_term_output): ... this. Update all users. (grub_console_term_input): Only enable it on PC/BIOS platform. (grub_console_init): Remove grub_keyboard_controller_init() call. Migrate input terminals to new API: * term/i386/pc/at_keyboard.c: Replace `cpu' and `machine' with `i386' and `i386/pc' to enable build on x86_64 (this driver is i386-specific anyway). (grub_console_checkkey): Rename to ... (grub_at_keyboard_checkkey): ... this. Static-ize. Update all users. (grub_keyboard_controller_orig): New variable. (grub_console_getkey): Rename to ... (grub_at_keyboard_getkey): ... this. Static-ize. Update all users. (grub_keyboard_controller_init): Static-ize. Save original controller value so that it can be restored ... (grub_keyboard_controller_fini): ... here (new function). (grub_at_keyboard_term): New structure. (GRUB_MOD_INIT(at_keyboard), GRUB_MOD_FINI(at_keyboard)): New functions. Migrate output terminals to new API: * term/i386/pc/vga.c (grub_vga_term): Change type to `struct grub_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. * term/gfxterm.c (grub_video_term): Change type to `struct grub_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. * include/grub/i386/pc/console.h (grub_console_checkkey) (grub_console_getkey): Do not export (no longer needed by gfxterm, etc). Migrate `terminal' command and userland tools to new API: * commands/terminal.c (grub_cmd_terminal): Split into ... (grub_cmd_terminal_input): ... this, and ... (grub_cmd_terminal_output): ... this. (GRUB_MOD_INIT(terminal)): Split `terminal' command in two commands: `terminal_input' and `terminal_output'. * util/grub.d/00_header.in: Adjust `terminal' calls to new `terminal_input' / `terminal_output' API. * util/grub-mkconfig.in: Export ${GRUB_TERMINAL_INPUT} and ${GRUB_TERMINAL_OUTPUT} instead of ${GRUB_TERMINAL} (and if user provided ${GRUB_TERMINAL}, convert it).
196 lines
6.3 KiB
Makefile
196 lines
6.3 KiB
Makefile
# -*- makefile -*-
|
|
|
|
COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin
|
|
COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3
|
|
COMMON_LDFLAGS = -nostdlib -static -lgcc
|
|
|
|
# Used by various components. These rules need to precede them.
|
|
normal/lexer.c_DEPENDENCIES = grub_script.tab.h
|
|
|
|
# Images.
|
|
pkglib_PROGRAMS = kernel.elf
|
|
|
|
# For kernel.elf.
|
|
kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \
|
|
kern/ieee1275/init.c \
|
|
kern/ieee1275/cmain.c kern/ieee1275/openfw.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/i386/dl.c kern/parser.c kern/partition.c \
|
|
kern/env.c \
|
|
kern/time.c \
|
|
kern/generic/millisleep.c \
|
|
kern/ieee1275/ieee1275.c \
|
|
term/ieee1275/ofconsole.c \
|
|
disk/ieee1275/ofdisk.c \
|
|
symlist.c
|
|
kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \
|
|
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
|
|
partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \
|
|
ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h
|
|
kernel_elf_CFLAGS = $(COMMON_CFLAGS)
|
|
kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
|
|
|
|
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
|
|
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
|
|
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
# Utilities.
|
|
sbin_UTILITIES = grub-mkdevicemap
|
|
ifeq ($(enable_grub_emu), yes)
|
|
sbin_UTILITIES += grub-emu
|
|
endif
|
|
|
|
# For grub-mkdevicemap.
|
|
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c
|
|
|
|
# For grub-emu.
|
|
util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
|
|
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
|
|
commands/configfile.c commands/echo.c commands/help.c \
|
|
commands/terminal.c commands/ls.c commands/test.c \
|
|
commands/search.c commands/blocklist.c commands/hexdump.c \
|
|
lib/hexdump.c commands/halt.c commands/reboot.c \
|
|
commands/i386/cpuid.c \
|
|
disk/host.c disk/loopback.c \
|
|
\
|
|
fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
|
|
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
|
|
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
|
|
fs/ufs.c fs/xfs.c fs/afs.c \
|
|
\
|
|
fs/fshelp.c \
|
|
io/gzio.c \
|
|
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
|
|
kern/err.c \
|
|
normal/execute.c kern/file.c kern/fs.c normal/lexer.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/main.c \
|
|
normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \
|
|
normal/color.c \
|
|
partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
|
|
partmap/acorn.c partmap/gpt.c \
|
|
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
|
|
util/hostdisk.c util/getroot.c \
|
|
util/i386/pc/misc.c \
|
|
\
|
|
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
|
|
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
|
|
grub_emu_init.c
|
|
|
|
grub_emu_LDFLAGS = $(LIBCURSES)
|
|
|
|
# Scripts.
|
|
sbin_SCRIPTS = grub-install
|
|
|
|
# For grub-install.
|
|
grub_install_SOURCES = util/ieee1275/grub-install.in
|
|
|
|
# Modules.
|
|
pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \
|
|
multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \
|
|
_linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \
|
|
date.mod datehook.mod
|
|
|
|
# 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/i386/setjmp.S normal/color.c
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For _multiboot.mod.
|
|
_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
|
|
loader/multiboot2.c \
|
|
loader/multiboot_loader.c
|
|
_multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For multiboot.mod.
|
|
multiboot_mod_SOURCES = loader/multiboot_loader_normal.c
|
|
multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For aout.mod.
|
|
aout_mod_SOURCES = loader/aout.c
|
|
aout_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# 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/reboot.c
|
|
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For halt.mod
|
|
halt_mod_SOURCES = commands/halt.c
|
|
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For serial.mod.
|
|
serial_mod_SOURCES = term/i386/pc/serial.c
|
|
serial_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For _linux.mod.
|
|
_linux_mod_SOURCES = loader/i386/ieee1275/linux.c
|
|
_linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For linux.mod.
|
|
linux_mod_SOURCES = loader/linux_normal.c
|
|
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For nand.mod.
|
|
nand_mod_SOURCES = disk/ieee1275/nand.c
|
|
nand_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
nand_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For memdisk.mod.
|
|
memdisk_mod_SOURCES = disk/memdisk.c
|
|
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For pci.mod
|
|
pci_mod_SOURCES = bus/pci.c
|
|
pci_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For lspci.mod
|
|
lspci_mod_SOURCES = commands/lspci.c
|
|
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For datetime.mod
|
|
datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c
|
|
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For date.mod
|
|
date_mod_SOURCES = commands/date.c
|
|
date_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For datehook.mod
|
|
datehook_mod_SOURCES = hook/datehook.c
|
|
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
include $(srcdir)/conf/i386.mk
|
|
include $(srcdir)/conf/common.mk
|