]>
Commit | Line | Data |
---|---|---|
ca25d8f0 | 1 | # -*- makefile -*- |
2 | ||
5e15ee3d | 3 | COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 |
4 | COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 | |
5 | COMMON_LDFLAGS = -m32 -nostdlib | |
ca25d8f0 | 6 | |
7d31f41f | 7 | # Used by various components. These rules need to precede them. |
8a594a17 | 8 | normal/lexer.c_DEPENDENCIES = grub_script.tab.h |
7d31f41f | 9 | |
ca25d8f0 | 10 | # Images. |
4931827f | 11 | pkglib_PROGRAMS = kernel.elf |
ca25d8f0 | 12 | |
13 | # For kernel.elf. | |
20024ab0 | 14 | kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ |
15 | kern/i386/coreboot/init.c \ | |
95b841d3 | 16 | kern/i386/multiboot_mmap.c \ |
ca25d8f0 | 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 \ | |
9c2ff3ee | 20 | kern/time.c \ |
ca25d8f0 | 21 | kern/i386/dl.c kern/parser.c kern/partition.c \ |
24371d26 | 22 | kern/i386/tsc.c kern/i386/pit.c \ |
23 | kern/generic/rtc_get_time_ms.c \ | |
24 | kern/generic/millisleep.c \ | |
ca25d8f0 | 25 | kern/env.c \ |
76679cd3 | 26 | term/i386/pc/vga_text.c term/i386/vga_common.c \ |
27 | term/i386/pc/at_keyboard.c \ | |
ca25d8f0 | 28 | symlist.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) | |
057bc4ac | 35 | kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) |
ca25d8f0 | 36 | kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic |
37 | ||
38 | MOSTLYCLEANFILES += symlist.c kernel_syms.lst | |
39 | DEFSYMFILES += kernel_syms.lst | |
40 | ||
41 | symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh | |
42 | /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) | |
43 | ||
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) | |
46 | ||
47 | # Utilities. | |
ccaa8a5f | 48 | sbin_UTILITIES = grub-mkdevicemap |
ca25d8f0 | 49 | ifeq ($(enable_grub_emu), yes) |
50 | sbin_UTILITIES += grub-emu | |
51 | endif | |
52 | ||
ca25d8f0 | 53 | # For grub-mkdevicemap. |
d2a367b8 | 54 | grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c |
ca25d8f0 | 55 | |
ca25d8f0 | 56 | # For grub-emu. |
e1907778 | 57 | util/grub-emu.c_DEPENDENCIES = grub_emu_init.h |
ca25d8f0 | 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 \ | |
c405c391 | 61 | commands/search.c commands/blocklist.c commands/hexdump.c \ |
a85cd5a0 | 62 | lib/hexdump.c commands/i386/cpuid.c \ |
bf748642 | 63 | disk/host.c disk/loopback.c \ |
2a9525e6 | 64 | \ |
96da9407 | 65 | fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ |
0d16e571 | 66 | fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ |
2a9525e6 | 67 | fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ |
f821ce59 | 68 | fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ |
2a9525e6 | 69 | \ |
70 | fs/fshelp.c \ | |
ca25d8f0 | 71 | io/gzio.c \ |
72 | kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ | |
73 | kern/err.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\ | |
772e23da | 78 | normal/completion.c normal/main.c normal/menu_text.c \ |
d2c2b4cd | 79 | normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ |
80 | normal/misc.c normal/script.c \ | |
0ece25b1 | 81 | normal/color.c \ |
ca25d8f0 | 82 | partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ |
83 | partmap/acorn.c partmap/gpt.c \ | |
84 | util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ | |
ddbf5556 | 85 | util/hostdisk.c util/getroot.c \ |
bf748642 | 86 | util/i386/pc/misc.c \ |
87 | \ | |
5ed20adc | 88 | disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ |
89 | disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ | |
bf748642 | 90 | grub_emu_init.c |
ca25d8f0 | 91 | |
92 | grub_emu_LDFLAGS = $(LIBCURSES) | |
93 | ||
15257703 | 94 | sbin_SCRIPTS += grub-install |
95 | grub_install_SOURCES = util/i386/pc/grub-install.in | |
96 | ||
ca25d8f0 | 97 | # Modules. |
4931827f | 98 | pkglib_MODULES = _linux.mod linux.mod normal.mod \ |
7dc15d8e | 99 | _multiboot.mod multiboot.mod aout.mod \ |
548e2ea5 | 100 | play.mod serial.mod ata.mod \ |
a55d42e0 | 101 | memdisk.mod pci.mod lspci.mod reboot.mod \ |
60d6b16e | 102 | halt.mod datetime.mod date.mod datehook.mod \ |
103 | lsmmap.mod | |
ca25d8f0 | 104 | |
105 | # For _linux.mod. | |
c9baafe7 | 106 | _linux_mod_SOURCES = loader/i386/linux.c |
ca25d8f0 | 107 | _linux_mod_CFLAGS = $(COMMON_CFLAGS) |
108 | _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
109 | ||
110 | # For linux.mod. | |
dd6bd6ab | 111 | linux_mod_SOURCES = loader/linux_normal.c |
ca25d8f0 | 112 | linux_mod_CFLAGS = $(COMMON_CFLAGS) |
113 | linux_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
114 | ||
6fa42fa6 | 115 | # |
116 | # Only arch dependant part of normal.mod will be here. Common part for | |
117 | # all architecures of normal.mod is at start and should be kept at sync | |
118 | # with other makefiles. | |
119 | # | |
120 | # Please put arch dependant part of normal.mod at the end of list to | |
121 | # keep it simpler to update to different architectures. | |
122 | # | |
ca25d8f0 | 123 | normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ |
124 | normal/completion.c normal/execute.c \ | |
125 | normal/function.c normal/lexer.c normal/main.c normal/menu.c \ | |
772e23da | 126 | normal/menu_text.c \ |
6fa42fa6 | 127 | normal/color.c \ |
128 | normal/menu_viewer.c normal/menu_entry.c \ | |
129 | normal/misc.c grub_script.tab.c \ | |
130 | normal/script.c \ | |
131 | normal/i386/setjmp.S | |
ca25d8f0 | 132 | normal_mod_CFLAGS = $(COMMON_CFLAGS) |
133 | normal_mod_ASFLAGS = $(COMMON_ASFLAGS) | |
134 | normal_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
135 | ||
a55d42e0 | 136 | # For reboot.mod. |
137 | reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c | |
138 | reboot_mod_CFLAGS = $(COMMON_CFLAGS) | |
139 | reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
140 | ||
141 | # For halt.mod. | |
142 | halt_mod_SOURCES = commands/halt.c kern/i386/halt.c | |
143 | halt_mod_CFLAGS = $(COMMON_CFLAGS) | |
144 | halt_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
145 | ||
ca25d8f0 | 146 | # For serial.mod. |
147 | serial_mod_SOURCES = term/i386/pc/serial.c | |
148 | serial_mod_CFLAGS = $(COMMON_CFLAGS) | |
149 | serial_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
150 | ||
151 | # For _multiboot.mod. | |
152 | _multiboot_mod_SOURCES = loader/i386/pc/multiboot.c \ | |
153 | loader/i386/pc/multiboot2.c \ | |
154 | loader/multiboot2.c \ | |
155 | loader/multiboot_loader.c | |
156 | _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) | |
157 | _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
158 | ||
159 | # For multiboot.mod. | |
160 | multiboot_mod_SOURCES = loader/multiboot_loader_normal.c | |
161 | multiboot_mod_CFLAGS = $(COMMON_CFLAGS) | |
162 | multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
163 | ||
7dc15d8e | 164 | # For aout.mod. |
165 | aout_mod_SOURCES = loader/aout.c | |
166 | aout_mod_CFLAGS = $(COMMON_CFLAGS) | |
167 | aout_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
168 | ||
ca25d8f0 | 169 | # For play.mod. |
170 | play_mod_SOURCES = commands/i386/pc/play.c | |
171 | play_mod_CFLAGS = $(COMMON_CFLAGS) | |
172 | play_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
173 | ||
5ab33bba | 174 | # For ata.mod. |
175 | ata_mod_SOURCES = disk/ata.c | |
176 | ata_mod_CFLAGS = $(COMMON_CFLAGS) | |
177 | ata_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
178 | ||
3bd0a12a | 179 | # For memdisk.mod. |
180 | memdisk_mod_SOURCES = disk/memdisk.c | |
181 | memdisk_mod_CFLAGS = $(COMMON_CFLAGS) | |
182 | memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
183 | ||
dd19c7d7 | 184 | # For pci.mod |
185 | pci_mod_SOURCES = bus/pci.c | |
186 | pci_mod_CFLAGS = $(COMMON_CFLAGS) | |
187 | pci_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
188 | ||
189 | # For lspci.mod | |
190 | lspci_mod_SOURCES = commands/lspci.c | |
191 | lspci_mod_CFLAGS = $(COMMON_CFLAGS) | |
192 | lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
193 | ||
42ce5170 | 194 | # For datetime.mod |
195 | datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c | |
196 | datetime_mod_CFLAGS = $(COMMON_CFLAGS) | |
197 | datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
198 | ||
199 | # For date.mod | |
200 | date_mod_SOURCES = commands/date.c | |
201 | date_mod_CFLAGS = $(COMMON_CFLAGS) | |
202 | date_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
203 | ||
204 | # For datehook.mod | |
205 | datehook_mod_SOURCES = hook/datehook.c | |
206 | datehook_mod_CFLAGS = $(COMMON_CFLAGS) | |
207 | datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
208 | ||
60d6b16e | 209 | # For lsmmap.mod |
210 | lsmmap_mod_SOURCES = commands/lsmmap.c | |
211 | lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) | |
212 | lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
213 | ||
548e2ea5 | 214 | include $(srcdir)/conf/i386.mk |
ca25d8f0 | 215 | include $(srcdir)/conf/common.mk |