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 normal/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/loader.c kern/rescue.c kern/term.c \
21 kern/i386/dl.c kern/parser.c kern/partition.c \
24 kern/generic/millisleep.c \
25 kern/ieee1275/ieee1275.c \
26 term/ieee1275/ofconsole.c \
27 disk/ieee1275/ofdisk.c \
29 kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \
30 env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
31 partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \
32 ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h
33 kernel_elf_CFLAGS = $(COMMON_CFLAGS)
34 kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
36 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
37 DEFSYMFILES += kernel_syms.lst
39 symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
40 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
42 kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
43 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
46 sbin_UTILITIES = grub-mkdevicemap
47 ifeq ($(enable_grub_emu), yes)
48 sbin_UTILITIES += grub-emu
51 # For grub-mkdevicemap.
52 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c
55 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
56 grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
57 commands/configfile.c commands/echo.c commands/help.c \
58 commands/terminal.c commands/ls.c commands/test.c \
59 commands/search.c commands/blocklist.c commands/hexdump.c \
60 lib/hexdump.c commands/halt.c commands/reboot.c \
61 commands/i386/cpuid.c \
62 disk/host.c disk/loopback.c \
64 fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
65 fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
66 fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
67 fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \
71 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
73 normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
74 kern/loader.c kern/main.c kern/misc.c kern/parser.c \
75 grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
76 normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
77 normal/completion.c normal/main.c \
78 normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
79 normal/misc.c normal/script.c \
81 partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
82 partmap/acorn.c partmap/gpt.c \
83 util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
84 util/hostdisk.c util/getroot.c \
87 disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
88 disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
91 grub_emu_LDFLAGS = $(LIBCURSES)
94 sbin_SCRIPTS = grub-install
97 grub_install_SOURCES = util/ieee1275/grub-install.in
100 pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \
101 multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \
102 _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \
103 date.mod datehook.mod lsmmap.mod
106 # Only arch dependant part of normal.mod will be here. Common part for
107 # all architecures of normal.mod is at start and should be kept at sync
108 # with other makefiles.
110 # Please put arch dependant part of normal.mod at the end of list to
111 # keep it simpler to update to different architectures.
113 normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \
114 normal/completion.c normal/execute.c \
115 normal/function.c normal/lexer.c normal/main.c normal/menu.c \
117 normal/menu_viewer.c normal/menu_entry.c \
118 normal/misc.c grub_script.tab.c \
121 normal_mod_CFLAGS = $(COMMON_CFLAGS)
122 normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
123 normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
125 # For _multiboot.mod.
126 _multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
127 loader/multiboot2.c \
128 loader/multiboot_loader.c
129 _multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
130 _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
133 multiboot_mod_SOURCES = loader/multiboot_loader_normal.c
134 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
135 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
138 aout_mod_SOURCES = loader/aout.c
139 aout_mod_CFLAGS = $(COMMON_CFLAGS)
140 aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
143 suspend_mod_SOURCES = commands/ieee1275/suspend.c
144 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
145 suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
148 reboot_mod_SOURCES = commands/reboot.c
149 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
150 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
153 halt_mod_SOURCES = commands/halt.c
154 halt_mod_CFLAGS = $(COMMON_CFLAGS)
155 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
158 serial_mod_SOURCES = term/i386/pc/serial.c
159 serial_mod_CFLAGS = $(COMMON_CFLAGS)
160 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
163 _linux_mod_SOURCES = loader/i386/ieee1275/linux.c
164 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
165 _linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
168 linux_mod_SOURCES = loader/linux_normal.c
169 linux_mod_CFLAGS = $(COMMON_CFLAGS)
170 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
173 nand_mod_SOURCES = disk/ieee1275/nand.c
174 nand_mod_CFLAGS = $(COMMON_CFLAGS)
175 nand_mod_LDFLAGS = $(COMMON_LDFLAGS)
178 memdisk_mod_SOURCES = disk/memdisk.c
179 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
180 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
183 pci_mod_SOURCES = bus/pci.c
184 pci_mod_CFLAGS = $(COMMON_CFLAGS)
185 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
188 lspci_mod_SOURCES = commands/lspci.c
189 lspci_mod_CFLAGS = $(COMMON_CFLAGS)
190 lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
193 datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c
194 datetime_mod_CFLAGS = $(COMMON_CFLAGS)
195 datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
198 date_mod_SOURCES = commands/date.c
199 date_mod_CFLAGS = $(COMMON_CFLAGS)
200 date_mod_LDFLAGS = $(COMMON_LDFLAGS)
203 datehook_mod_SOURCES = hook/datehook.c
204 datehook_mod_CFLAGS = $(COMMON_CFLAGS)
205 datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
208 lsmmap_mod_SOURCES = commands/lsmmap.c
209 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
210 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
212 include $(srcdir)/conf/i386.mk
213 include $(srcdir)/conf/common.mk