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_DEPENDENCIES = grub_script.tab.h
11 pkglib_PROGRAMS = kernel.img
14 kernel_img_SOURCES = kern/i386/ieee1275/startup.S \
16 kern/i386/ieee1275/init.c \
17 kern/ieee1275/init.c \
18 kern/ieee1275/mmap.c \
19 kern/ieee1275/cmain.c kern/ieee1275/openfw.c \
20 kern/main.c kern/device.c \
21 kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
22 kern/misc.c kern/mm.c kern/reader.c kern/term.c \
23 kern/rescue_parser.c kern/rescue_reader.c \
24 kern/$(target_cpu)/dl.c kern/parser.c kern/partition.c \
26 kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
27 kern/generic/millisleep.c \
28 kern/ieee1275/ieee1275.c \
29 term/ieee1275/ofconsole.c \
30 disk/ieee1275/ofdisk.c \
32 kernel_img_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \
33 env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
34 partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
35 ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \
36 list.h handler.h command.h
37 kernel_img_CFLAGS = $(COMMON_CFLAGS)
38 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
39 kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
41 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
42 DEFSYMFILES += kernel_syms.lst
44 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
45 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
47 kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
48 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
51 sbin_UTILITIES = grub-mkdevicemap
52 ifeq ($(enable_grub_emu), yes)
53 sbin_UTILITIES += grub-emu
56 # For grub-mkdevicemap.
57 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
58 util/devicemap.c util/misc.c
61 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
62 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
63 commands/configfile.c commands/echo.c commands/help.c \
64 commands/handler.c commands/ls.c commands/test.c \
65 commands/search.c commands/blocklist.c commands/hexdump.c \
66 lib/hexdump.c commands/halt.c commands/reboot.c \
67 lib/envblk.c commands/loadenv.c \
68 commands/gptsync.c commands/probe.c commands/xnu_uuid.c \
69 commands/i386/cpuid.c \
70 commands/password.c commands/keystatus.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/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c fs/befs.c \
77 fs/befs_be.c fs/tar.c \
81 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
82 kern/err.c kern/list.c kern/handler.c \
83 kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
84 kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
85 kern/partition.c kern/reader.c kern/term.c \
86 kern/rescue_reader.c kern/rescue_parser.c \
87 lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \
88 normal/handler.c normal/auth.c normal/autofs.c \
89 normal/completion.c normal/main.c normal/menu_text.c \
90 normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
92 script/sh/main.c script/sh/execute.c script/sh/function.c \
93 script/sh/lexer.c script/sh/script.c grub_script.tab.c \
94 partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
95 partmap/acorn.c partmap/gpt.c \
96 util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
97 util/hostdisk.c util/getroot.c \
99 disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
100 disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
103 grub_emu_LDFLAGS = $(LIBCURSES)
106 sbin_SCRIPTS = grub-install
109 grub_install_SOURCES = util/ieee1275/grub-install.in
112 pkglib_MODULES = halt.mod reboot.mod suspend.mod \
113 multiboot.mod aout.mod serial.mod linux.mod \
114 nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \
115 date.mod datehook.mod lsmmap.mod mmap.mod
118 pkglib_MODULES += boot.mod
119 boot_mod_SOURCES = commands/boot.c
120 boot_mod_CFLAGS = $(COMMON_CFLAGS)
121 boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
124 mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
125 mmap_mod_CFLAGS = $(COMMON_CFLAGS)
126 mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
127 mmap_mod_ASFLAGS = $(COMMON_ASFLAGS)
130 multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
131 loader/i386/multiboot_helper.S \
132 loader/multiboot2.c \
133 loader/multiboot_loader.c
134 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
135 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
136 multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS)
139 aout_mod_SOURCES = loader/aout.c
140 aout_mod_CFLAGS = $(COMMON_CFLAGS)
141 aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
144 suspend_mod_SOURCES = commands/ieee1275/suspend.c
145 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
146 suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
149 reboot_mod_SOURCES = commands/reboot.c
150 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
151 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
154 halt_mod_SOURCES = commands/halt.c
155 halt_mod_CFLAGS = $(COMMON_CFLAGS)
156 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
159 serial_mod_SOURCES = term/i386/pc/serial.c
160 serial_mod_CFLAGS = $(COMMON_CFLAGS)
161 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
164 linux_mod_SOURCES = loader/i386/ieee1275/linux.c
165 linux_mod_CFLAGS = $(COMMON_CFLAGS)
166 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
169 nand_mod_SOURCES = disk/ieee1275/nand.c
170 nand_mod_CFLAGS = $(COMMON_CFLAGS)
171 nand_mod_LDFLAGS = $(COMMON_LDFLAGS)
174 memdisk_mod_SOURCES = disk/memdisk.c
175 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
176 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
179 pci_mod_SOURCES = bus/pci.c
180 pci_mod_CFLAGS = $(COMMON_CFLAGS)
181 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
184 lspci_mod_SOURCES = commands/lspci.c
185 lspci_mod_CFLAGS = $(COMMON_CFLAGS)
186 lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
189 datetime_mod_SOURCES = lib/i386/datetime.c
190 datetime_mod_CFLAGS = $(COMMON_CFLAGS)
191 datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
194 date_mod_SOURCES = commands/date.c
195 date_mod_CFLAGS = $(COMMON_CFLAGS)
196 date_mod_LDFLAGS = $(COMMON_LDFLAGS)
199 datehook_mod_SOURCES = hook/datehook.c
200 datehook_mod_CFLAGS = $(COMMON_CFLAGS)
201 datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
204 lsmmap_mod_SOURCES = commands/lsmmap.c
205 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
206 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
208 include $(srcdir)/conf/i386.mk
209 include $(srcdir)/conf/common.mk