2008-07-17 09:50:26 +00:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
|
|
|
COMMON_ASFLAGS = -nostdinc -fno-builtin -m64
|
|
|
|
COMMON_CFLAGS = -fno-builtin -m64
|
|
|
|
COMMON_LDFLAGS = -melf_x86_64 -nostdlib
|
|
|
|
|
|
|
|
# Used by various components. These rules need to precede them.
|
|
|
|
normal/execute.c_DEPENDENCIES = grub_script.tab.h
|
|
|
|
normal/command.c_DEPENDENCIES = grub_script.tab.h
|
|
|
|
normal/function.c_DEPENDENCIES = grub_script.tab.h
|
|
|
|
normal/lexer.c_DEPENDENCIES = grub_script.tab.h
|
|
|
|
|
|
|
|
# Utilities.
|
|
|
|
bin_UTILITIES = grub-mkimage
|
|
|
|
#sbin_UTILITIES = grub-mkdevicemap
|
|
|
|
#ifeq ($(enable_grub_emu), yes)
|
|
|
|
#sbin_UTILITIES += grub-emu
|
|
|
|
#endif
|
|
|
|
|
|
|
|
# For grub-mkimage.
|
|
|
|
grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
|
|
|
|
util/resolve.c
|
|
|
|
|
|
|
|
# For grub-setup.
|
2008-09-08 13:52:30 +00:00
|
|
|
#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
# util/misc.c util/getroot.c kern/device.c kern/disk.c \
|
|
|
|
# kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \
|
|
|
|
# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \
|
|
|
|
# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \
|
|
|
|
# kern/fs.c kern/env.c fs/fshelp.c
|
|
|
|
|
|
|
|
# For grub-mkdevicemap.
|
2008-09-25 14:15:24 +00:00
|
|
|
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c
|
2008-07-17 09:50:26 +00:00
|
|
|
|
|
|
|
# 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/help.c \
|
|
|
|
commands/terminal.c commands/ls.c commands/test.c \
|
2008-07-27 13:51:30 +00:00
|
|
|
commands/search.c commands/hexdump.c lib/hexdump.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
commands/halt.c commands/reboot.c \
|
|
|
|
commands/i386/cpuid.c \
|
|
|
|
disk/loopback.c \
|
|
|
|
\
|
2009-02-09 18:00:36 +00:00
|
|
|
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
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 \
|
|
|
|
\
|
|
|
|
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/context.c normal/main.c \
|
2009-02-03 13:22:26 +00:00
|
|
|
normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
|
2009-02-13 20:06:27 +00:00
|
|
|
normal/menu_text.c \
|
2009-02-03 13:22:26 +00:00
|
|
|
normal/misc.c normal/script.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
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 \
|
2008-09-08 13:52:30 +00:00
|
|
|
util/hostdisk.c util/getroot.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
util/i386/pc/misc.c \
|
|
|
|
\
|
2008-08-23 Bean <bean123ch@gmail.com>
* conf/common.rmk (grub_probe_SOURCES): Add disk/mdraid_linux.c.
(grub_fstest_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c,
disk/mdraid_linux.c and disk/dmraid_nvidia.c and lib/crc.c.
(pkglib_MODULES): Add raid5rec.mod, raid6rec.mod, mdraid.mod and
dm_nv.mod.
(raid5rec_mod_SOURCES): New macro.
(raid5rec_mod_CFLAGS): Likewise.
(raid5rec_mod_LDFLAGS): Likewise.
(raid6rec_mod_SOURCES): Likewise.
(raid6rec_mod_CFLAGS): Likewise.
(raid6rec_mod_LDFLAGS): Likewise.
(mdraid_mod_SOURCES): Likewise.
(mdraid_mod_CFLAGS): Likewise.
(mdraid_mod_LDFLAGS): Likewise.
(dm_nv_mod_SOURCES): Likewise.
(dm_nv_mod_CFLAGS): Likewise.
(dm_nv_mod_LDFLAGS): Likewise.
* conf/i386-pc.rmk (grub_setup_SOURCES): Add disk/mdraid_linux.c.
(grub_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c,
disk/mdraid_linux.c and disk/dmraid_nvidia.c.
* conf/i386-coreboot.rmk (grub_emu_SOURCES): Add disk/raid5_recover.c,
disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c.
* conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.
* conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise.
* conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise.
* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
* disk/raid5_recover.c: New file.
* disk/raid6_recover.c: Likewise.
* disk/mdraid_linux.c: Likewise.
* disk/dmraid_nvidia.c: Likewise.
* disk/i386/pc/biosdisk.c: Set total_sectors of cdrom device to
ULONG_MAX.
* disk/raid.c (grub_raid_open): Use the size of the smallest disk to
calculate the size of raid device.
(grub_raid_read): Simplify raid0 code. Support raid4, raid6 and four
different layout of raid5.
(grub_raid_scan_device): Remove code specific to mdraid.
(grub_raid_list): New variable.
(free_array): New function.
(grub_raid_register): Likewise.
(grub_raid_unregister): Likewise.
(grub_raid_rescan): Likewise.
(GRUB_MOD_INIT): Don't iterate device here.
(GRUB_MOD_FINI): Use free_array to release resource.
* include/grub/raid.h: Remove macro and structure specific to mdraid.
(grub_raid5_recover_func_t): New function variable type.
(grub_raid6_recover_func_t): Likewise.
(grub_raid5_recover_func): New variable.
(grub_raid6_recover_func): Likewise.
(grub_raid_register): New function.
(grub_raid_unregister): Likewise.
(grub_raid_rescan): Likewise.
(grub_raid_block_xor): Likewise.
* util/grub-fstest.c: Add #include <grub/raid.h> and <grub/lib/crc.h>.
(CMD_CRC): New macro.
(part): Removed.
(read_file): Handle device as well as file.
(cmd_crc): New function.
(fstest): Handle multiple disks.
(options): Remove part, raw and long, add root and diskcount.
(usage): Add crc, remove -p, -r, -l, add -r and -c.
(main): Find the first non option entry and ignore subsequence options,
add handling for the new options, support multiple disks.
* util/grub-probe.c (probe): Add mdraid to abstraction_name.
2008-08-23 14:51:19 +00:00
|
|
|
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
|
|
|
|
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
grub_emu_init.c
|
|
|
|
|
|
|
|
grub_emu_LDFLAGS = $(LIBCURSES)
|
|
|
|
|
|
|
|
# Scripts.
|
|
|
|
sbin_SCRIPTS = grub-install
|
|
|
|
|
|
|
|
# For grub-install.
|
|
|
|
grub_install_SOURCES = util/i386/efi/grub-install.in
|
|
|
|
|
|
|
|
# Modules.
|
|
|
|
pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \
|
2008-09-07 16:09:21 +00:00
|
|
|
halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \
|
2008-08-15 15:39:02 +00:00
|
|
|
datetime.mod date.mod datehook.mod
|
2008-07-17 09:50:26 +00:00
|
|
|
|
|
|
|
# For kernel.mod.
|
|
|
|
kernel_mod_EXPORTS = no
|
|
|
|
kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.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/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
|
|
|
|
kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
|
2008-08-07 19:21:25 +00:00
|
|
|
kern/time.c \
|
|
|
|
kern/i386/tsc.c kern/i386/pit.c \
|
2008-08-05 11:54:37 +00:00
|
|
|
kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
term/efi/console.c disk/efi/efidisk.c
|
|
|
|
kernel_mod_HEADERS = arg.h 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 \
|
|
|
|
efi/efi.h efi/time.h efi/disk.h machine/loader.h
|
|
|
|
kernel_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
kernel_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
MOSTLYCLEANFILES += symlist.c
|
|
|
|
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
|
|
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
|
|
|
|
symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh
|
|
|
|
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
|
|
|
|
kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh
|
|
|
|
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
|
|
|
|
2009-01-31 09:15:43 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2008-07-17 09:50:26 +00:00
|
|
|
normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \
|
2009-01-31 09:15:43 +00:00
|
|
|
normal/completion.c normal/execute.c \
|
2008-07-17 09:50:26 +00:00
|
|
|
normal/function.c normal/lexer.c normal/main.c normal/menu.c \
|
2009-02-13 20:06:27 +00:00
|
|
|
normal/menu_text.c \
|
2009-01-31 09:15:43 +00:00
|
|
|
normal/color.c \
|
|
|
|
normal/menu_viewer.c normal/menu_entry.c \
|
|
|
|
normal/misc.c grub_script.tab.c \
|
|
|
|
normal/script.c \
|
|
|
|
normal/x86_64/setjmp.S
|
2008-07-17 09:50:26 +00:00
|
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
|
|
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For _chain.mod.
|
|
|
|
_chain_mod_SOURCES = loader/efi/chainloader.c
|
|
|
|
_chain_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
_chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For chain.mod.
|
|
|
|
chain_mod_SOURCES = loader/efi/chainloader_normal.c
|
|
|
|
chain_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For appleldr.mod.
|
|
|
|
appleldr_mod_SOURCES = loader/efi/appleloader.c
|
|
|
|
appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For _linux.mod.
|
|
|
|
_linux_mod_SOURCES = loader/i386/efi/linux.c
|
|
|
|
_linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For linux.mod.
|
2008-08-18 13:46:31 +00:00
|
|
|
linux_mod_SOURCES = loader/linux_normal.c
|
2008-07-17 09:50:26 +00:00
|
|
|
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For halt.mod.
|
|
|
|
halt_mod_SOURCES = commands/halt.c
|
|
|
|
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
|
|
|
|
|
|
# For reboot.mod.
|
|
|
|
reboot_mod_SOURCES = commands/reboot.c
|
|
|
|
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
reboot_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)
|
|
|
|
|
2008-08-15 15:39:02 +00:00
|
|
|
# For datetime.mod
|
|
|
|
datetime_mod_SOURCES = lib/datetime.c lib/efi/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)
|
|
|
|
|
2008-09-07 16:09:21 +00:00
|
|
|
include $(srcdir)/conf/i386.mk
|
2008-07-17 09:50:26 +00:00
|
|
|
include $(srcdir)/conf/common.mk
|