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 script/sh/lexer.c.dep: grub_script.tab.h
14 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
15 DEFSYMFILES += kernel_syms.lst
17 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
18 env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
19 symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
20 pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \
23 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
24 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
26 kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
27 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
30 pkglib_PROGRAMS = kernel.img
33 sbin_UTILITIES = grub-mkdevicemap
34 ifeq ($(enable_grub_emu), yes)
35 sbin_UTILITIES += grub-emu
38 # For grub-mkdevicemap.
39 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
40 util/devicemap.c util/misc.c
43 util/grub-emu.c.dep: grub_emu_init.h
45 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
46 commands/configfile.c commands/help.c \
47 commands/search.c commands/handler.c commands/test.c \
48 commands/ls.c commands/blocklist.c commands/hexdump.c \
49 lib/hexdump.c commands/halt.c commands/reboot.c \
50 commands/gptsync.c commands/probe.c commands/xnu_uuid.c \
53 fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
54 fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
55 fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
56 fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \
59 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
60 kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \
61 kern/misc.c kern/parser.c kern/partition.c kern/reader.c \
62 kern/rescue_reader.c kern/rescue_parser.c \
63 kern/term.c kern/list.c kern/handler.c fs/fshelp.c \
64 kern/command.c kern/corecmd.c commands/extcmd.c \
65 lib/arg.c normal/cmdline.c normal/datetime.c \
66 normal/completion.c normal/misc.c \
67 normal/handler.c normal/autofs.c normal/main.c \
70 normal/menu_entry.c normal/menu_viewer.c \
72 script/sh/main.c script/sh/execute.c script/sh/function.c \
73 script/sh/lexer.c script/sh/script.c \
74 partmap/amiga.c partmap/apple.c partmap/pc.c partmap/bsdlabel.c \
75 partmap/sun.c partmap/acorn.c \
76 util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
77 util/hostdisk.c util/getroot.c \
79 disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
80 disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
81 commands/parttool.c parttool/pcpart.c \
82 grub_script.tab.c grub_emu_init.c
84 grub_emu_LDFLAGS = $(LIBCURSES)
86 kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \
87 kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
88 kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
89 kern/misc.c kern/mm.c kern/reader.c kern/term.c \
90 kern/rescue_parser.c kern/rescue_reader.c \
91 kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
92 kern/ieee1275/init.c \
93 kern/ieee1275/mmap.c \
94 term/ieee1275/ofconsole.c \
95 kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
96 kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \
97 kern/generic/millisleep.c kern/time.c \
98 symlist.c kern/$(target_cpu)/cache.S
99 kernel_img_CFLAGS = $(COMMON_CFLAGS)
100 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
101 kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
102 -Wl,-N,-S,-Ttext,0x200000,-Bstatic
105 sbin_SCRIPTS = grub-install
106 bin_SCRIPTS = grub-mkrescue
109 grub_install_SOURCES = util/ieee1275/grub-install.in
112 grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in
115 pkglib_MODULES = halt.mod \
124 pkglib_MODULES += boot.mod
125 boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
126 boot_mod_CFLAGS = $(COMMON_CFLAGS)
127 boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
130 linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
131 linux_mod_CFLAGS = $(COMMON_CFLAGS)
132 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
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 memdisk_mod_SOURCES = disk/memdisk.c
158 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
159 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
162 lsmmap_mod_SOURCES = commands/lsmmap.c
163 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
164 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
166 include $(srcdir)/conf/common.mk