3 COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin
4 COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3
5 COMMON_LDFLAGS = -nostdlib
7 # Used by various components. These rules need to precede them.
8 script/sh/lexer.c.dep: grub_script.tab.h
12 pkglib_PROGRAMS = kernel.img
15 kernel_img_SOURCES = kern/i386/ieee1275/startup.S \
17 kern/i386/ieee1275/init.c \
18 kern/ieee1275/init.c \
19 kern/ieee1275/mmap.c \
20 kern/ieee1275/cmain.c kern/ieee1275/openfw.c \
21 kern/main.c kern/device.c \
22 kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
23 kern/misc.c kern/mm.c kern/reader.c kern/term.c \
24 kern/rescue_parser.c kern/rescue_reader.c \
25 kern/$(target_cpu)/dl.c kern/parser.c kern/partition.c \
27 kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
28 kern/generic/millisleep.c \
29 kern/ieee1275/ieee1275.c \
30 term/ieee1275/ofconsole.c \
31 disk/ieee1275/ofdisk.c \
33 kernel_img_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \
34 env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
35 partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \
36 ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \
37 list.h handler.h command.h
38 kernel_img_CFLAGS = $(COMMON_CFLAGS)
39 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
40 kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
42 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
43 DEFSYMFILES += kernel_syms.lst
45 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
46 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
48 kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
49 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
52 sbin_UTILITIES = grub-mkdevicemap
53 ifeq ($(enable_grub_emu), yes)
54 sbin_UTILITIES += grub-emu
57 # For grub-mkdevicemap.
58 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
59 util/devicemap.c util/misc.c
62 util/grub-emu.c.dep: grub_emu_init.h
64 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
65 commands/configfile.c commands/echo.c commands/help.c \
66 commands/handler.c commands/ls.c commands/test.c \
67 commands/search.c commands/blocklist.c commands/hexdump.c \
68 lib/hexdump.c commands/halt.c commands/reboot.c \
69 commands/gptsync.c commands/probe.c commands/xnu_uuid.c \
70 commands/i386/cpuid.c \
71 disk/host.c disk/loopback.c \
73 fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
74 fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
75 fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
76 fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \
80 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
81 kern/err.c kern/list.c kern/handler.c \
82 kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
83 kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
84 kern/partition.c kern/reader.c kern/term.c \
85 kern/rescue_reader.c kern/rescue_parser.c \
86 lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \
87 normal/handler.c normal/autofs.c \
88 normal/completion.c normal/main.c normal/menu_text.c \
89 normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
91 script/sh/main.c script/sh/execute.c script/sh/function.c \
92 script/sh/lexer.c script/sh/script.c grub_script.tab.c \
93 partmap/amiga.c partmap/apple.c partmap/pc.c partmap/bsdlabel.c \
94 partmap/sun.c partmap/acorn.c partmap/gpt.c \
95 util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
96 util/hostdisk.c util/getroot.c \
98 disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
99 disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
102 grub_emu_LDFLAGS = $(LIBCURSES)
105 sbin_SCRIPTS = grub-install
108 grub_install_SOURCES = util/ieee1275/grub-install.in
111 pkglib_MODULES = halt.mod reboot.mod suspend.mod \
112 multiboot.mod aout.mod serial.mod linux.mod \
113 nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \
114 date.mod datehook.mod lsmmap.mod mmap.mod
117 pkglib_MODULES += boot.mod
118 boot_mod_SOURCES = commands/boot.c
119 boot_mod_CFLAGS = $(COMMON_CFLAGS)
120 boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
123 mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
124 mmap_mod_CFLAGS = $(COMMON_CFLAGS)
125 mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
126 mmap_mod_ASFLAGS = $(COMMON_ASFLAGS)
129 multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
130 loader/i386/multiboot_helper.S \
131 loader/multiboot2.c \
132 loader/multiboot_loader.c
133 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
134 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
135 multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS)
138 aout_mod_SOURCES = loader/aout.c
139 aout_mod_CFLAGS = $(COMMON_CFLAGS)
140 aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
143 suspend_mod_SOURCES = commands/ieee1275/suspend.c
144 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
145 suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
148 reboot_mod_SOURCES = commands/reboot.c
149 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
150 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
153 halt_mod_SOURCES = commands/halt.c
154 halt_mod_CFLAGS = $(COMMON_CFLAGS)
155 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
158 serial_mod_SOURCES = term/i386/pc/serial.c
159 serial_mod_CFLAGS = $(COMMON_CFLAGS)
160 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
163 linux_mod_SOURCES = loader/i386/ieee1275/linux.c
164 linux_mod_CFLAGS = $(COMMON_CFLAGS)
165 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
168 nand_mod_SOURCES = disk/ieee1275/nand.c
169 nand_mod_CFLAGS = $(COMMON_CFLAGS)
170 nand_mod_LDFLAGS = $(COMMON_LDFLAGS)
173 memdisk_mod_SOURCES = disk/memdisk.c
174 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
175 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
178 pci_mod_SOURCES = bus/pci.c
179 pci_mod_CFLAGS = $(COMMON_CFLAGS)
180 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
183 lspci_mod_SOURCES = commands/lspci.c
184 lspci_mod_CFLAGS = $(COMMON_CFLAGS)
185 lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
188 datetime_mod_SOURCES = lib/i386/datetime.c
189 datetime_mod_CFLAGS = $(COMMON_CFLAGS)
190 datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
193 date_mod_SOURCES = commands/date.c
194 date_mod_CFLAGS = $(COMMON_CFLAGS)
195 date_mod_LDFLAGS = $(COMMON_LDFLAGS)
198 datehook_mod_SOURCES = hook/datehook.c
199 datehook_mod_CFLAGS = $(COMMON_CFLAGS)
200 datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
203 lsmmap_mod_SOURCES = commands/lsmmap.c
204 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
205 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
207 include $(srcdir)/conf/i386.mk
208 include $(srcdir)/conf/common.mk