05aaebfb7b
Support for mtime and further expandability of dir command * include/grub/lib/datetime.h: moved to ... * include/grub/datetime.h: ... moved here and added declaration of grub_unixtime2datetime. All users updated * include/grub/fs.h: new syntax for dir and mtime functionin struct grub_fs * include/grub/fshelp.h: new declarations of GRUB_FSHELP_TYPE_MASK and GRUB_FSHELP_FLAGS_MASK * commands/ls.c (grub_ls_list_files): Write mtime in long format * fs/ext2.c (grub_ext2_dir): use new dir syntax and supply mtime (grub_ext2_mtime): new function * fs/hfsplus.c (grub_hfsplus_dir): use new dir syntax and supply mtime (grub_hfsplus_mtime): new function * fs/ufs.c (GRUB_UFS_ATTR_TYPE): new definition (GRUB_UFS_ATTR_FILE): likewise (GRUB_UFS_ATTR_LNK): likewise (struct grub_ufs_sblock): new fields mtime (grub_ufs_read_inode): new parameter to read inode to a separate buffer all users updated (grub_ufs_dir): mtime support (grub_ufs_mtime): new function * fs/affs.c (grub_affs_dir): use new dir syntax * fs/afs.c (grub_afs_dir): likewise * fs/cpio.c (grub_cpio_dir): likewise * fs/fat.c (grub_fat_find_dir): likewise * fs/hfs.c (grub_hfs_dir): likewise * fs/iso9660.c (grub_iso9660_dir): likewise * fs/jfs.c (grub_jfs_dir): likewise * fs/minix.c (grub_minix_dir): likewise * fs/ntfs.c (grub_ntfs_dir): likewise * fs/reiserfs.c (grub_reiserfs_dir): likewise * fs/sfs.c (grub_sfs_dir): likewise * fs/xfs.c (grub_xfs_dir): likewise * util/hostfs.c (grub_hostfs_dir): likewise * lib/datetime.c: moved to ... * normal/datetime.c: ... moved here (grub_unixtime2datetime): new function * kern/rescue.c (grub_rescue_print_files): use new dir syntax * normal/completition.c (iterate_dir): use new dir syntax * normal/misc.c (grub_normal_print_device_info): tell the last modification time of a volume * kern/fs.c (grub_fs_probe): updated dummy function to use new syntax * conf/common.rmk: added lib/datetime.c to ls.mod * conf/i386-coreboot.rmk (grub_emu_SOURCES): add normal/datetime.c (normal_mod_SOURCES): likewise (datetime_mod_SOURCES): Removed lib/datetime.c * conf/i386-efi.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise * conf/x86_64-efi.rmk: likewise
208 lines
6.8 KiB
Makefile
208 lines
6.8 KiB
Makefile
# -*- makefile -*-
|
|
|
|
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
|
|
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
|
|
COMMON_LDFLAGS = -m32 -nostdlib
|
|
|
|
# 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/coreboot/startup.S \
|
|
kern/i386/coreboot/init.c \
|
|
kern/i386/multiboot_mmap.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/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
|
|
kern/i386/dl.c kern/parser.c kern/partition.c \
|
|
kern/i386/tsc.c kern/i386/pit.c \
|
|
kern/generic/rtc_get_time_ms.c \
|
|
kern/generic/millisleep.c \
|
|
kern/env.c \
|
|
term/i386/pc/vga_text.c term/i386/vga_common.c \
|
|
term/i386/pc/at_keyboard.c \
|
|
symlist.c
|
|
kernel_elf_HEADERS = boot.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 \
|
|
machine/boot.h machine/console.h machine/init.h \
|
|
machine/memory.h machine/loader.h list.h handler.h command.h
|
|
kernel_elf_CFLAGS = $(COMMON_CFLAGS)
|
|
kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
|
|
kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-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/minicmd.c commands/cat.c commands/cmp.c \
|
|
commands/configfile.c commands/echo.c commands/help.c \
|
|
commands/handler.c commands/ls.c commands/test.c \
|
|
commands/search.c commands/blocklist.c commands/hexdump.c \
|
|
lib/hexdump.c commands/i386/cpuid.c \
|
|
disk/host.c disk/loopback.c \
|
|
\
|
|
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.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/tar.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 kern/list.c kern/handler.c \
|
|
kern/command.c kern/corecmd.c commands/extcmd.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 \
|
|
lib/arg.c normal/cmdline.c normal/command.c normal/function.c\
|
|
normal/completion.c normal/datetime.c normal/main.c \
|
|
normal/menu_text.c \
|
|
normal/menu.c normal/menu_entry.c normal/menu_viewer.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)
|
|
|
|
sbin_SCRIPTS += grub-install
|
|
grub_install_SOURCES = util/i386/pc/grub-install.in
|
|
|
|
# Modules.
|
|
pkglib_MODULES = linux.mod normal.mod multiboot.mod \
|
|
aout.mod play.mod serial.mod ata.mod \
|
|
memdisk.mod pci.mod lspci.mod reboot.mod \
|
|
halt.mod datetime.mod date.mod datehook.mod \
|
|
lsmmap.mod
|
|
|
|
# For linux.mod.
|
|
linux_mod_SOURCES = loader/i386/linux.c
|
|
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
#
|
|
# Only arch dependant part of normal.mod will be here. Common part for
|
|
# all architecures of normal.mod is at start and should be kept at sync
|
|
# with other makefiles.
|
|
#
|
|
# Please put arch dependant part of normal.mod at the end of list to
|
|
# keep it simpler to update to different architectures.
|
|
#
|
|
normal_mod_SOURCES = normal/cmdline.c normal/command.c \
|
|
normal/completion.c normal/datetime.c normal/execute.c \
|
|
normal/function.c normal/lexer.c normal/main.c normal/menu.c \
|
|
normal/menu_text.c \
|
|
normal/color.c \
|
|
normal/menu_viewer.c normal/menu_entry.c \
|
|
normal/misc.c grub_script.tab.c \
|
|
normal/script.c \
|
|
normal/i386/setjmp.S
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For reboot.mod.
|
|
reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c
|
|
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For halt.mod.
|
|
halt_mod_SOURCES = commands/halt.c kern/i386/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 multiboot.mod.
|
|
multiboot_mod_SOURCES = loader/i386/multiboot.c \
|
|
loader/i386/multiboot_helper.S \
|
|
loader/i386/pc/multiboot2.c \
|
|
loader/multiboot2.c \
|
|
loader/multiboot_loader.c
|
|
multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
# For aout.mod.
|
|
aout_mod_SOURCES = loader/aout.c
|
|
aout_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For play.mod.
|
|
play_mod_SOURCES = commands/i386/pc/play.c
|
|
play_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
play_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
# For ata.mod.
|
|
ata_mod_SOURCES = disk/ata.c
|
|
ata_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
ata_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/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)
|
|
|
|
# For lsmmap.mod
|
|
lsmmap_mod_SOURCES = commands/lsmmap.c
|
|
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
include $(srcdir)/conf/i386.mk
|
|
include $(srcdir)/conf/common.mk
|