3 COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
4 COMMON_CFLAGS = -fno-builtin -m32
5 COMMON_LDFLAGS = -melf_i386 -nostdlib
7 # Used by various components. These rules need to precede them.
8 script/lexer.c_DEPENDENCIES = grub_script.tab.h
11 bin_UTILITIES = grub-mkimage
14 grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
15 util/misc.c util/resolve.c
16 util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
19 #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \
20 # util/misc.c util/getroot.c kern/device.c kern/disk.c \
21 # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \
22 # fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \
23 # fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \
24 # kern/fs.c kern/env.c fs/fshelp.c
27 sbin_SCRIPTS = grub-install
30 grub_install_SOURCES = util/i386/efi/grub-install.in
33 pkglib_PROGRAMS = kernel.img
34 pkglib_MODULES = chain.mod appleldr.mod \
35 linux.mod halt.mod reboot.mod pci.mod lspci.mod \
36 datetime.mod date.mod datehook.mod loadbios.mod \
37 fixvideo.mod mmap.mod acpi.mod
40 kernel_img_RELOCATABLE = yes
41 kernel_img_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \
42 kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
43 kern/misc.c kern/mm.c kern/term.c \
44 kern/rescue_parser.c kern/rescue_reader.c \
45 kern/$(target_cpu)/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
46 kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
47 term/efi/console.c disk/efi/efidisk.c \
48 kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
49 kern/i386/tsc.c kern/i386/pit.c \
50 kern/generic/rtc_get_time_ms.c \
51 kern/generic/millisleep.c
52 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
53 env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
54 partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
55 efi/efi.h efi/time.h efi/disk.h i386/pit.h list.h handler.h command.h \
57 kernel_img_CFLAGS = $(COMMON_CFLAGS)
58 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
59 kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
61 MOSTLYCLEANFILES += symlist.c
62 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
63 DEFSYMFILES += kernel_syms.lst
65 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
66 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
68 kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
69 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
72 pkglib_MODULES += boot.mod
73 boot_mod_SOURCES = commands/boot.c
74 boot_mod_CFLAGS = $(COMMON_CFLAGS)
75 boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
78 acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c
79 acpi_mod_CFLAGS = $(COMMON_CFLAGS)
80 acpi_mod_LDFLAGS = $(COMMON_LDFLAGS)
83 mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \
85 mmap_mod_CFLAGS = $(COMMON_CFLAGS)
86 mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
89 chain_mod_SOURCES = loader/efi/chainloader.c
90 chain_mod_CFLAGS = $(COMMON_CFLAGS)
91 chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
94 appleldr_mod_SOURCES = loader/efi/appleloader.c
95 appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
96 appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
99 linux_mod_SOURCES = loader/i386/efi/linux.c
100 linux_mod_CFLAGS = $(COMMON_CFLAGS)
101 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
104 halt_mod_SOURCES = commands/halt.c
105 halt_mod_CFLAGS = $(COMMON_CFLAGS)
106 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
109 reboot_mod_SOURCES = commands/reboot.c
110 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
111 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
114 pci_mod_SOURCES = bus/pci.c
115 pci_mod_CFLAGS = $(COMMON_CFLAGS)
116 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
119 lspci_mod_SOURCES = commands/lspci.c
120 lspci_mod_CFLAGS = $(COMMON_CFLAGS)
121 lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
124 datetime_mod_SOURCES = lib/efi/datetime.c
125 datetime_mod_CFLAGS = $(COMMON_CFLAGS)
126 datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
129 date_mod_SOURCES = commands/date.c
130 date_mod_CFLAGS = $(COMMON_CFLAGS)
131 date_mod_LDFLAGS = $(COMMON_LDFLAGS)
134 datehook_mod_SOURCES = hook/datehook.c
135 datehook_mod_CFLAGS = $(COMMON_CFLAGS)
136 datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
139 loadbios_mod_SOURCES = commands/efi/loadbios.c
140 loadbios_mod_CFLAGS = $(COMMON_CFLAGS)
141 loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS)
144 fixvideo_mod_SOURCES = commands/efi/fixvideo.c
145 fixvideo_mod_CFLAGS = $(COMMON_CFLAGS)
146 fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS)
148 pkglib_MODULES += efi_uga.mod
149 efi_uga_mod_SOURCES = video/efi_uga.c
150 efi_uga_mod_CFLAGS = $(COMMON_CFLAGS)
151 efi_uga_mod_LDFLAGS = $(COMMON_LDFLAGS)
153 pkglib_MODULES += efi_gop.mod
154 efi_gop_mod_SOURCES = video/efi_gop.c
155 efi_gop_mod_CFLAGS = $(COMMON_CFLAGS)
156 efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
158 pkglib_MODULES += xnu.mod
159 xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c \
160 loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c
161 xnu_mod_CFLAGS = $(COMMON_CFLAGS)
162 xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
163 xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
165 include $(srcdir)/conf/i386.mk
166 include $(srcdir)/conf/common.mk