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