3 COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
4 COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
5 COMMON_LDFLAGS = -m32 -nostdlib
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/coreboot/startup.S \
15 kern/i386/coreboot/init.c \
16 kern/i386/multiboot_mmap.c \
17 kern/main.c kern/device.c \
18 kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
19 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 \
22 kern/i386/tsc.c kern/i386/pit.c \
23 kern/generic/rtc_get_time_ms.c \
24 kern/generic/millisleep.c \
26 term/i386/pc/vga_text.c term/i386/vga_common.c \
27 term/i386/pc/at_keyboard.c \
29 kernel_elf_HEADERS = arg.h boot.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 machine/boot.h machine/console.h machine/init.h \
33 machine/memory.h machine/loader.h
34 kernel_elf_CFLAGS = $(COMMON_CFLAGS)
35 kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
36 kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic
38 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
39 DEFSYMFILES += kernel_syms.lst
41 symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
42 /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
44 kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
45 /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
48 sbin_UTILITIES = grub-mkdevicemap
49 ifeq ($(enable_grub_emu), yes)
50 sbin_UTILITIES += grub-emu
53 # For grub-mkdevicemap.
54 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c
57 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
58 grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
59 commands/configfile.c commands/echo.c commands/help.c \
60 commands/terminal.c commands/ls.c commands/test.c \
61 commands/search.c commands/blocklist.c commands/hexdump.c \
62 lib/hexdump.c commands/i386/cpuid.c \
63 disk/host.c disk/loopback.c \
65 fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
66 fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
67 fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
68 fs/ufs.c fs/xfs.c fs/afs.c \
72 kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
74 normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
75 kern/loader.c kern/main.c kern/misc.c kern/parser.c \
76 grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
77 normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
78 normal/completion.c normal/main.c \
79 normal/menu.c normal/menu_entry.c 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 pkglib_MODULES = _linux.mod linux.mod normal.mod \
95 _multiboot.mod multiboot.mod aout.mod \
96 play.mod serial.mod ata.mod \
97 memdisk.mod pci.mod lspci.mod reboot.mod \
98 halt.mod datetime.mod date.mod datehook.mod \
102 _linux_mod_SOURCES = loader/i386/linux.c
103 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
104 _linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
107 linux_mod_SOURCES = loader/linux_normal.c
108 linux_mod_CFLAGS = $(COMMON_CFLAGS)
109 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
112 normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \
113 normal/completion.c normal/execute.c \
114 normal/function.c normal/lexer.c normal/main.c normal/menu.c \
115 normal/menu_entry.c normal/misc.c grub_script.tab.c \
116 normal/script.c normal/i386/setjmp.S normal/color.c
117 normal_mod_CFLAGS = $(COMMON_CFLAGS)
118 normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
119 normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
122 reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c
123 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
124 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
127 halt_mod_SOURCES = commands/halt.c kern/i386/halt.c
128 halt_mod_CFLAGS = $(COMMON_CFLAGS)
129 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
132 serial_mod_SOURCES = term/i386/pc/serial.c
133 serial_mod_CFLAGS = $(COMMON_CFLAGS)
134 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
136 # For _multiboot.mod.
137 _multiboot_mod_SOURCES = loader/i386/pc/multiboot.c \
138 loader/i386/pc/multiboot2.c \
139 loader/multiboot2.c \
140 loader/multiboot_loader.c
141 _multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
142 _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
145 multiboot_mod_SOURCES = loader/multiboot_loader_normal.c
146 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
147 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
150 aout_mod_SOURCES = loader/aout.c
151 aout_mod_CFLAGS = $(COMMON_CFLAGS)
152 aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
155 play_mod_SOURCES = commands/i386/pc/play.c
156 play_mod_CFLAGS = $(COMMON_CFLAGS)
157 play_mod_LDFLAGS = $(COMMON_LDFLAGS)
160 ata_mod_SOURCES = disk/ata.c
161 ata_mod_CFLAGS = $(COMMON_CFLAGS)
162 ata_mod_LDFLAGS = $(COMMON_LDFLAGS)
165 memdisk_mod_SOURCES = disk/memdisk.c
166 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
167 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
170 pci_mod_SOURCES = bus/pci.c
171 pci_mod_CFLAGS = $(COMMON_CFLAGS)
172 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
175 lspci_mod_SOURCES = commands/lspci.c
176 lspci_mod_CFLAGS = $(COMMON_CFLAGS)
177 lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
180 datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c
181 datetime_mod_CFLAGS = $(COMMON_CFLAGS)
182 datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
185 date_mod_SOURCES = commands/date.c
186 date_mod_CFLAGS = $(COMMON_CFLAGS)
187 date_mod_LDFLAGS = $(COMMON_LDFLAGS)
190 datehook_mod_SOURCES = hook/datehook.c
191 datehook_mod_CFLAGS = $(COMMON_CFLAGS)
192 datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
195 lsmmap_mod_SOURCES = commands/lsmmap.c
196 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
197 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
199 include $(srcdir)/conf/i386.mk
200 include $(srcdir)/conf/common.mk