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_DEPENDENCIES = grub_script.tab.h
13 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
14 DEFSYMFILES += kernel_syms.lst
16 kernel_img_HEADERS = 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 reader.h \
18 symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
19 msdos_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \
22 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
23 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
25 kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
26 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
29 pkglib_PROGRAMS = kernel.img
32 sbin_UTILITIES = grub-mkdevicemap
33 ifeq ($(enable_grub_emu), yes)
34 sbin_UTILITIES += grub-emu
37 # For grub-mkdevicemap.
38 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
39 util/devicemap.c util/misc.c
42 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
43 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
44 commands/configfile.c commands/help.c \
45 commands/search.c commands/handler.c commands/test.c \
46 commands/ls.c commands/blocklist.c commands/hexdump.c \
47 lib/hexdump.c commands/halt.c commands/reboot.c \
48 lib/envblk.c commands/loadenv.c \
49 commands/gptsync.c commands/probe.c commands/xnu_uuid.c \
50 commands/password.c commands/keystatus.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/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
57 fs/befs.c fs/befs_be.c fs/tar.c \
60 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
61 kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \
62 kern/misc.c kern/parser.c kern/partition.c kern/reader.c \
63 kern/rescue_reader.c kern/rescue_parser.c \
64 kern/term.c kern/list.c kern/handler.c fs/fshelp.c \
65 kern/command.c kern/corecmd.c commands/extcmd.c \
66 lib/arg.c normal/cmdline.c normal/datetime.c \
67 normal/completion.c normal/misc.c \
68 normal/handler.c normal/auth.c normal/autofs.c normal/main.c \
71 normal/menu_entry.c normal/menu_viewer.c \
73 script/sh/main.c script/sh/execute.c script/sh/function.c \
74 script/sh/lexer.c script/sh/script.c \
75 partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
77 util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
78 util/hostdisk.c util/getroot.c \
80 disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
81 disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
82 commands/parttool.c parttool/msdospart.c \
83 grub_script.tab.c grub_emu_init.c
85 grub_emu_LDFLAGS = $(LIBCURSES)
87 kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \
88 kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
89 kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
90 kern/misc.c kern/mm.c kern/reader.c kern/term.c \
91 kern/rescue_parser.c kern/rescue_reader.c \
92 kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
93 kern/ieee1275/init.c \
94 kern/ieee1275/mmap.c \
95 term/ieee1275/ofconsole.c \
96 kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
97 kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \
98 kern/generic/millisleep.c kern/time.c \
99 symlist.c kern/$(target_cpu)/cache.S
100 kernel_img_CFLAGS = $(COMMON_CFLAGS)
101 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
102 kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
103 -Wl,-N,-S,-Ttext,0x200000,-Bstatic
106 sbin_SCRIPTS = grub-install
107 bin_SCRIPTS = grub-mkrescue
110 grub_install_SOURCES = util/ieee1275/grub-install.in
113 grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in
116 pkglib_MODULES = halt.mod \
125 pkglib_MODULES += boot.mod
126 boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
127 boot_mod_CFLAGS = $(COMMON_CFLAGS)
128 boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
131 linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
132 linux_mod_CFLAGS = $(COMMON_CFLAGS)
133 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
136 suspend_mod_SOURCES = commands/ieee1275/suspend.c
137 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
138 suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
141 reboot_mod_SOURCES = commands/reboot.c
142 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
143 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
146 halt_mod_SOURCES = commands/halt.c
147 halt_mod_CFLAGS = $(COMMON_CFLAGS)
148 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
151 multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
152 loader/multiboot2.c \
153 loader/multiboot_loader.c
154 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
155 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
158 memdisk_mod_SOURCES = disk/memdisk.c
159 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
160 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
163 lsmmap_mod_SOURCES = commands/lsmmap.c
164 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
165 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
167 include $(srcdir)/conf/common.mk