4 COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
5 COMMON_CFLAGS = -ffreestanding
6 COMMON_LDFLAGS += -nostdlib
8 # Used by various components. These rules need to precede them.
9 normal/lexer.c_DEPENDENCIES = grub_script.tab.h
13 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
14 DEFSYMFILES += kernel_syms.lst
16 kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
17 env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \
18 symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
19 pc_partition.h ieee1275/ieee1275.h machine/kernel.h
21 symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
22 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
24 kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
25 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
28 pkglib_PROGRAMS = kernel.elf
31 sbin_UTILITIES = grub-mkdevicemap
32 ifeq ($(enable_grub_emu), yes)
33 sbin_UTILITIES += grub-emu
36 # For grub-mkdevicemap.
37 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c
40 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
41 grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
42 commands/configfile.c commands/help.c \
43 commands/search.c commands/terminal.c commands/test.c \
44 commands/ls.c commands/blocklist.c commands/hexdump.c \
45 lib/hexdump.c commands/halt.c commands/reboot.c \
48 fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
49 fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
50 fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
51 fs/ufs.c fs/xfs.c fs/afs.c \
54 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
55 kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \
56 kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \
57 kern/term.c fs/fshelp.c \
58 normal/arg.c normal/cmdline.c normal/command.c \
59 normal/completion.c normal/execute.c \
60 normal/function.c normal/lexer.c normal/main.c normal/menu.c \
61 normal/menu_entry.c normal/misc.c normal/script.c \
63 partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
65 util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
66 util/hostdisk.c util/getroot.c \
67 util/powerpc/ieee1275/misc.c \
69 disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
70 disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
71 grub_script.tab.c grub_emu_init.c
73 grub_emu_LDFLAGS = $(LIBCURSES)
75 kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \
76 kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
77 kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
78 kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
79 kern/ieee1275/init.c \
80 kern/ieee1275/mmap.c \
81 term/ieee1275/ofconsole.c \
82 kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
83 kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \
84 kern/generic/millisleep.c kern/time.c \
85 symlist.c kern/powerpc/cache.S
86 kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h
87 kernel_elf_CFLAGS = $(COMMON_CFLAGS)
88 kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
89 kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
90 -Wl,-N,-S,-Ttext,0x200000,-Bstatic
93 sbin_SCRIPTS = grub-install
94 bin_SCRIPTS = grub-mkrescue
97 grub_install_SOURCES = util/ieee1275/grub-install.in
100 grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in
103 pkglib_MODULES = halt.mod \
115 _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
116 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
117 _linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
120 linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c
121 linux_mod_CFLAGS = $(COMMON_CFLAGS)
122 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
125 normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \
126 normal/completion.c normal/execute.c \
127 normal/function.c normal/lexer.c normal/main.c normal/menu.c \
128 normal/menu_entry.c normal/misc.c grub_script.tab.c \
129 normal/script.c normal/powerpc/setjmp.S normal/color.c
130 normal_mod_CFLAGS = $(COMMON_CFLAGS)
131 normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
132 normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
135 suspend_mod_SOURCES = commands/ieee1275/suspend.c
136 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
137 suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
140 reboot_mod_SOURCES = commands/reboot.c
141 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
142 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
145 halt_mod_SOURCES = commands/halt.c
146 halt_mod_CFLAGS = $(COMMON_CFLAGS)
147 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
150 _multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
151 loader/multiboot2.c \
152 loader/multiboot_loader.c
153 _multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
154 _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
157 multiboot_mod_SOURCES = loader/multiboot_loader_normal.c
158 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
159 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
162 memdisk_mod_SOURCES = disk/memdisk.c
163 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
164 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
167 lsmmap_mod_SOURCES = commands/lsmmap.c
168 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
169 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
171 include $(srcdir)/conf/common.mk