]>
Commit | Line | Data |
---|---|---|
3d04eab8 | 1 | # -*- makefile -*- |
2 | ||
3 | COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin | |
4 | COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 | |
5 | COMMON_LDFLAGS = -nostdlib -static -lgcc | |
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 | |
3d04eab8 | 10 | # Images. |
11 | pkglib_PROGRAMS = kernel.elf | |
12 | ||
13 | # For kernel.elf. | |
14 | kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ | |
a91627b4 | 15 | kern/ieee1275/init.c \ |
79d29fd7 | 16 | kern/ieee1275/mmap.c \ |
a91627b4 | 17 | kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ |
3d04eab8 | 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 \ | |
22 | kern/env.c \ | |
b1b797cb | 23 | kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ |
9c2ff3ee | 24 | kern/generic/millisleep.c \ |
3d04eab8 | 25 | kern/ieee1275/ieee1275.c \ |
651c29b7 | 26 | term/ieee1275/ofconsole.c \ |
5882ae4b | 27 | disk/ieee1275/ofdisk.c \ |
3d04eab8 | 28 | symlist.c |
b1b797cb | 29 | kernel_elf_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ |
3d04eab8 | 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 \ | |
71b9f361 | 32 | ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ |
b1b797cb | 33 | list.h handler.h command.h |
3d04eab8 | 34 | kernel_elf_CFLAGS = $(COMMON_CFLAGS) |
35 | kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic | |
36 | ||
37 | MOSTLYCLEANFILES += symlist.c kernel_syms.lst | |
38 | DEFSYMFILES += kernel_syms.lst | |
39 | ||
40 | symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh | |
41 | /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) | |
42 | ||
43 | kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh | |
44 | /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) | |
45 | ||
46 | # Utilities. | |
ccaa8a5f | 47 | sbin_UTILITIES = grub-mkdevicemap |
3d04eab8 | 48 | ifeq ($(enable_grub_emu), yes) |
49 | sbin_UTILITIES += grub-emu | |
50 | endif | |
51 | ||
3d04eab8 | 52 | # For grub-mkdevicemap. |
d2a367b8 | 53 | grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c |
3d04eab8 | 54 | |
3d04eab8 | 55 | # For grub-emu. |
e1907778 | 56 | util/grub-emu.c_DEPENDENCIES = grub_emu_init.h |
b1b797cb | 57 | grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ |
3d04eab8 | 58 | commands/configfile.c commands/echo.c commands/help.c \ |
71b9f361 | 59 | commands/handler.c commands/ls.c commands/test.c \ |
3d04eab8 | 60 | commands/search.c commands/blocklist.c commands/hexdump.c \ |
a85cd5a0 | 61 | lib/hexdump.c commands/halt.c commands/reboot.c \ |
3d04eab8 | 62 | 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 | \ |
e1907778 | 70 | fs/fshelp.c \ |
3d04eab8 | 71 | io/gzio.c \ |
72 | kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ | |
2ba60b62 | 73 | kern/err.c kern/list.c kern/handler.c \ |
b1b797cb | 74 | kern/command.c kern/corecmd.c commands/extcmd.c \ |
3d04eab8 | 75 | normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ |
76 | kern/loader.c kern/main.c kern/misc.c kern/parser.c \ | |
77 | grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ | |
05aaebfb | 78 | lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ |
79 | normal/function.c\ | |
772e23da | 80 | normal/completion.c normal/main.c normal/menu_text.c \ |
d2c2b4cd | 81 | normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ |
82 | normal/misc.c normal/script.c \ | |
3d04eab8 | 83 | normal/color.c \ |
84 | partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ | |
85 | partmap/acorn.c partmap/gpt.c \ | |
86 | util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ | |
ddbf5556 | 87 | util/hostdisk.c util/getroot.c \ |
bf748642 | 88 | util/i386/pc/misc.c \ |
89 | \ | |
5ed20adc | 90 | disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ |
91 | disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ | |
bf748642 | 92 | grub_emu_init.c |
3d04eab8 | 93 | |
94 | grub_emu_LDFLAGS = $(LIBCURSES) | |
95 | ||
eee96e08 | 96 | # Scripts. |
97 | sbin_SCRIPTS = grub-install | |
98 | ||
99 | # For grub-install. | |
100 | grub_install_SOURCES = util/ieee1275/grub-install.in | |
101 | ||
3d04eab8 | 102 | # Modules. |
548e2ea5 | 103 | pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ |
b1b797cb | 104 | multiboot.mod aout.mod serial.mod linux.mod \ |
105 | nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ | |
60d6b16e | 106 | date.mod datehook.mod lsmmap.mod |
3d04eab8 | 107 | |
6fa42fa6 | 108 | # |
109 | # Only arch dependant part of normal.mod will be here. Common part for | |
110 | # all architecures of normal.mod is at start and should be kept at sync | |
111 | # with other makefiles. | |
112 | # | |
113 | # Please put arch dependant part of normal.mod at the end of list to | |
114 | # keep it simpler to update to different architectures. | |
115 | # | |
b1b797cb | 116 | normal_mod_SOURCES = normal/cmdline.c normal/command.c \ |
05aaebfb | 117 | normal/completion.c normal/datetime.c normal/execute.c \ |
3d04eab8 | 118 | normal/function.c normal/lexer.c normal/main.c normal/menu.c \ |
772e23da | 119 | normal/menu_text.c \ |
6fa42fa6 | 120 | normal/color.c \ |
121 | normal/menu_viewer.c normal/menu_entry.c \ | |
122 | normal/misc.c grub_script.tab.c \ | |
123 | normal/script.c \ | |
124 | normal/i386/setjmp.S | |
3d04eab8 | 125 | normal_mod_CFLAGS = $(COMMON_CFLAGS) |
126 | normal_mod_ASFLAGS = $(COMMON_ASFLAGS) | |
127 | normal_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
128 | ||
b1b797cb | 129 | # For multiboot.mod. |
130 | multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ | |
c04d6e05 | 131 | loader/i386/multiboot_helper.S \ |
dbb475a4 | 132 | loader/multiboot2.c \ |
133 | loader/multiboot_loader.c | |
dbb475a4 | 134 | multiboot_mod_CFLAGS = $(COMMON_CFLAGS) |
135 | multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
c04d6e05 | 136 | multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) |
dbb475a4 | 137 | |
7dc15d8e | 138 | # For aout.mod. |
139 | aout_mod_SOURCES = loader/aout.c | |
140 | aout_mod_CFLAGS = $(COMMON_CFLAGS) | |
141 | aout_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
142 | ||
3d04eab8 | 143 | # For suspend.mod |
144 | suspend_mod_SOURCES = commands/ieee1275/suspend.c | |
145 | suspend_mod_CFLAGS = $(COMMON_CFLAGS) | |
146 | suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
147 | ||
148 | # For reboot.mod | |
f714229e | 149 | reboot_mod_SOURCES = commands/reboot.c |
3d04eab8 | 150 | reboot_mod_CFLAGS = $(COMMON_CFLAGS) |
151 | reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
152 | ||
153 | # For halt.mod | |
f714229e | 154 | halt_mod_SOURCES = commands/halt.c |
3d04eab8 | 155 | halt_mod_CFLAGS = $(COMMON_CFLAGS) |
156 | halt_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
157 | ||
5882ae4b | 158 | # For serial.mod. |
159 | serial_mod_SOURCES = term/i386/pc/serial.c | |
160 | serial_mod_CFLAGS = $(COMMON_CFLAGS) | |
161 | serial_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
162 | ||
25f16ec1 | 163 | # For linux.mod. |
b1b797cb | 164 | linux_mod_SOURCES = loader/i386/ieee1275/linux.c |
25f16ec1 | 165 | linux_mod_CFLAGS = $(COMMON_CFLAGS) |
166 | linux_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
167 | ||
168 | # For nand.mod. | |
169 | nand_mod_SOURCES = disk/ieee1275/nand.c | |
170 | nand_mod_CFLAGS = $(COMMON_CFLAGS) | |
171 | nand_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
172 | ||
3bd0a12a | 173 | # For memdisk.mod. |
174 | memdisk_mod_SOURCES = disk/memdisk.c | |
175 | memdisk_mod_CFLAGS = $(COMMON_CFLAGS) | |
176 | memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
177 | ||
dd19c7d7 | 178 | # For pci.mod |
179 | pci_mod_SOURCES = bus/pci.c | |
180 | pci_mod_CFLAGS = $(COMMON_CFLAGS) | |
181 | pci_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
182 | ||
183 | # For lspci.mod | |
184 | lspci_mod_SOURCES = commands/lspci.c | |
185 | lspci_mod_CFLAGS = $(COMMON_CFLAGS) | |
186 | lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
187 | ||
42ce5170 | 188 | # For datetime.mod |
05aaebfb | 189 | datetime_mod_SOURCES = lib/i386/datetime.c |
42ce5170 | 190 | datetime_mod_CFLAGS = $(COMMON_CFLAGS) |
191 | datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
192 | ||
193 | # For date.mod | |
194 | date_mod_SOURCES = commands/date.c | |
195 | date_mod_CFLAGS = $(COMMON_CFLAGS) | |
196 | date_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
197 | ||
198 | # For datehook.mod | |
199 | datehook_mod_SOURCES = hook/datehook.c | |
200 | datehook_mod_CFLAGS = $(COMMON_CFLAGS) | |
201 | datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
202 | ||
60d6b16e | 203 | # For lsmmap.mod |
204 | lsmmap_mod_SOURCES = commands/lsmmap.c | |
205 | lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) | |
206 | lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
207 | ||
548e2ea5 | 208 | include $(srcdir)/conf/i386.mk |
3d04eab8 | 209 | include $(srcdir)/conf/common.mk |