3 COMMON_ASFLAGS = -nostdinc -fno-builtin -m64
4 COMMON_CFLAGS = -fno-builtin -m64
5 COMMON_LDFLAGS = -melf_x86_64 -nostdlib
7 # Used by various components. These rules need to precede them.
8 script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
11 bin_UTILITIES = grub-mkimage
12 sbin_UTILITIES = grub-mkdevicemap
13 #ifeq ($(enable_grub_emu), yes)
14 #sbin_UTILITIES += grub-emu
18 grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
22 #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \
23 # util/misc.c util/getroot.c kern/device.c kern/disk.c \
24 # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \
25 # fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \
26 # fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \
27 # kern/fs.c kern/env.c fs/fshelp.c
29 # For grub-mkdevicemap.
30 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
31 util/devicemap.c util/misc.c
34 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
35 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
36 commands/configfile.c commands/help.c \
37 commands/handler.c commands/ls.c commands/test.c \
38 commands/search.c commands/hexdump.c lib/hexdump.c \
39 commands/halt.c commands/reboot.c \
40 commands/i386/cpuid.c \
41 commands/password.c commands/keystatus.c \
42 lib/envblk.c commands/loadenv.c \
45 fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
46 fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
47 fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
48 fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
51 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
52 kern/err.c kern/list.c kern/handler.c \
53 kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
54 kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
55 kern/partition.c kern/readerescue.c kern/term.c \
56 lib/arg.c normal/cmdline.c normal/misc.c normal/auth.c \
58 normal/completion.c normal/datetime.c normal/context.c \
60 normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
63 script/sh/main.c script/sh/execute.c script/sh/function.c \
64 script/sh/lexer.c script/sh/script.c grub_script.tab.c \
65 partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
66 partmap/acorn.c partmap/gpt.c \
67 util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
68 util/hostdisk.c util/getroot.c \
70 disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
71 disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
72 commands/parttool.c parttool/msdospart.c \
75 grub_emu_LDFLAGS = $(LIBCURSES)
78 sbin_SCRIPTS = grub-install
81 grub_install_SOURCES = util/i386/efi/grub-install.in
84 pkglib_MODULES = kernel.mod chain.mod appleldr.mod \
85 halt.mod reboot.mod linux.mod pci.mod lspci.mod \
86 datetime.mod date.mod datehook.mod loadbios.mod \
87 fixvideo.mod mmap.mod acpi.mod
90 kernel_mod_EXPORTS = no
91 kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \
92 kern/main.c kern/device.c \
93 kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
94 kern/misc.c kern/mm.c kern/reader.c kern/term.c \
95 kern/rescue_parser.c kern/rescue_reader.c \
96 kern/$(target_cpu)/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
97 kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
98 kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
99 kern/i386/tsc.c kern/i386/pit.c \
100 kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \
101 term/efi/console.c disk/efi/efidisk.c
102 kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
103 env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
104 partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
105 efi/efi.h efi/time.h efi/disk.h machine/loader.h i386/pit.h list.h \
107 kernel_mod_CFLAGS = $(COMMON_CFLAGS)
108 kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)
109 kernel_mod_LDFLAGS = $(COMMON_LDFLAGS)
111 MOSTLYCLEANFILES += symlist.c
112 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
113 DEFSYMFILES += kernel_syms.lst
115 symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh
116 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
118 kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh
119 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
122 pkglib_MODULES += boot.mod
123 boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
124 boot_mod_CFLAGS = $(COMMON_CFLAGS)
125 boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
128 acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c
129 acpi_mod_CFLAGS = $(COMMON_CFLAGS)
130 acpi_mod_LDFLAGS = $(COMMON_LDFLAGS)
133 mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \
135 mmap_mod_CFLAGS = $(COMMON_CFLAGS)
136 mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
139 chain_mod_SOURCES = loader/efi/chainloader.c
140 chain_mod_CFLAGS = $(COMMON_CFLAGS)
141 chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
144 appleldr_mod_SOURCES = loader/efi/appleloader.c
145 appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
146 appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
149 linux_mod_SOURCES = loader/i386/efi/linux.c loader/i386/linux_trampoline.S
150 linux_mod_CFLAGS = $(COMMON_CFLAGS)
151 linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
152 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
155 halt_mod_SOURCES = commands/halt.c
156 halt_mod_CFLAGS = $(COMMON_CFLAGS)
157 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
160 reboot_mod_SOURCES = commands/reboot.c
161 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
162 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
165 pci_mod_SOURCES = bus/pci.c
166 pci_mod_CFLAGS = $(COMMON_CFLAGS)
167 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
170 lspci_mod_SOURCES = commands/lspci.c
171 lspci_mod_CFLAGS = $(COMMON_CFLAGS)
172 lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
175 datetime_mod_SOURCES = lib/efi/datetime.c
176 datetime_mod_CFLAGS = $(COMMON_CFLAGS)
177 datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
180 date_mod_SOURCES = commands/date.c
181 date_mod_CFLAGS = $(COMMON_CFLAGS)
182 date_mod_LDFLAGS = $(COMMON_LDFLAGS)
185 datehook_mod_SOURCES = hook/datehook.c
186 datehook_mod_CFLAGS = $(COMMON_CFLAGS)
187 datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
190 loadbios_mod_SOURCES = commands/efi/loadbios.c
191 loadbios_mod_CFLAGS = $(COMMON_CFLAGS)
192 loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS)
195 fixvideo_mod_SOURCES = commands/efi/fixvideo.c
196 fixvideo_mod_CFLAGS = $(COMMON_CFLAGS)
197 fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS)
199 pkglib_MODULES += xnu.mod
200 xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\
201 loader/macho.c loader/xnu.c loader/i386/xnu_helper.S
202 xnu_mod_CFLAGS = $(COMMON_CFLAGS)
203 xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
204 xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
206 include $(srcdir)/conf/common.mk