]>
Commit | Line | Data |
---|---|---|
6a161fa9 | 1 | # -*- makefile -*- |
2 | ||
43e7f879 | 3 | COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 |
59b8208a | 4 | COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 |
6b146090 | 5 | COMMON_LDFLAGS = -m32 -nostdlib |
6a161fa9 | 6 | |
7 | # Images. | |
020616c2 | 8 | pkgdata_IMAGES = boot.img diskboot.img kernel.img pxeboot.img |
6a161fa9 | 9 | |
10 | # For boot.img. | |
11 | boot_img_SOURCES = boot/i386/pc/boot.S | |
12 | boot_img_ASFLAGS = $(COMMON_ASFLAGS) | |
13 | boot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 | |
14 | ||
020616c2 | 15 | # For pxeboot.img |
16 | pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S | |
17 | pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) | |
ebedfd00 | 18 | pxeboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 |
020616c2 | 19 | |
6a161fa9 | 20 | # For diskboot.img. |
21 | diskboot_img_SOURCES = boot/i386/pc/diskboot.S | |
22 | diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) | |
23 | diskboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000 | |
24 | ||
25 | # For kernel.img. | |
26 | kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ | |
27 | kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ | |
28 | kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ | |
04ccf3ec | 29 | kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ |
db1771cf | 30 | kern/env.c disk/i386/pc/biosdisk.c \ |
6a161fa9 | 31 | term/i386/pc/console.c \ |
32 | symlist.c | |
2166cc83 | 33 | kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ |
34 | env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ | |
35 | partition.h pc_partition.h rescue.h symbol.h term.h types.h \ | |
8ceafda2 | 36 | machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ |
e85e144b | 37 | machine/memory.h machine/loader.h machine/time.h machine/vga.h \ |
38 | machine/vbe.h | |
6a161fa9 | 39 | kernel_img_CFLAGS = $(COMMON_CFLAGS) |
40 | kernel_img_ASFLAGS = $(COMMON_ASFLAGS) | |
59b8208a | 41 | kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8200 $(COMMON_CFLAGS) |
6a161fa9 | 42 | |
43 | MOSTLYCLEANFILES += symlist.c kernel_syms.lst | |
44 | DEFSYMFILES += kernel_syms.lst | |
45 | ||
7b455f4d | 46 | symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh |
47 | /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) | |
6a161fa9 | 48 | |
7b455f4d | 49 | kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh |
50 | /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) | |
6a161fa9 | 51 | |
52 | # Utilities. | |
4b13b216 | 53 | bin_UTILITIES = grub-mkimage |
ddd5cee9 | 54 | sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probe |
6a161fa9 | 55 | |
4b13b216 | 56 | # For grub-mkimage. |
57 | grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ | |
6a161fa9 | 58 | util/resolve.c |
4ac9bd04 | 59 | grub_mkimage_LDFLAGS = $(LIBLZO) |
6a161fa9 | 60 | |
4b13b216 | 61 | # For grub-setup. |
50214199 | 62 | grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ |
63 | util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \ | |
64 | kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ | |
65 | fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ | |
66 | fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ | |
2b002173 | 67 | kern/fs.c kern/env.c fs/fshelp.c util/raid.c util/lvm.c |
1f7315a3 | 68 | |
e0f050c2 | 69 | # For grub-mkdevicemap. |
70 | grub_mkdevicemap_SOURCES = util/i386/pc/grub-mkdevicemap.c util/misc.c | |
71 | ||
ddd5cee9 | 72 | # For grub-probe. |
73 | grub_probe_SOURCES = util/i386/pc/grub-probe.c \ | |
8b5f3938 | 74 | util/i386/pc/biosdisk.c util/misc.c util/i386/pc/getroot.c \ |
75 | kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \ | |
04ccf3ec | 76 | fs/ext2.c kern/parser.c kern/partition.c partmap/pc.c fs/ufs.c \ |
77 | fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c \ | |
790707f2 | 78 | fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c disk/lvm.c disk/raid.c |
8b5f3938 | 79 | |
e0f050c2 | 80 | # For grub-emu. |
e02ac02c | 81 | grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \ |
82 | grub_modules_init.h | |
4e93851c | 83 | grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ |
b5ef1102 | 84 | commands/configfile.c commands/echo.c commands/help.c \ |
daac212a | 85 | commands/terminal.c commands/ls.c commands/test.c \ |
89a7d726 | 86 | commands/search.c commands/blocklist.c \ |
e6b92c8a | 87 | commands/i386/pc/halt.c commands/i386/pc/reboot.c \ |
2b002173 | 88 | disk/loopback.c disk/raid.c disk/lvm.c \ |
57bdbde3 | 89 | fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ |
50214199 | 90 | fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c \ |
d9864ee1 | 91 | io/gzio.c \ |
2166cc83 | 92 | kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ |
93 | kern/err.c \ | |
daac212a | 94 | normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ |
95 | kern/loader.c kern/main.c kern/misc.c kern/parser.c \ | |
96 | grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ | |
97 | normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ | |
4e93851c | 98 | normal/completion.c normal/main.c \ |
daac212a | 99 | normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ |
4ed2e1dd | 100 | partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ |
b04216ab | 101 | partmap/acorn.c partmap/gpt.c \ |
e6b92c8a | 102 | util/console.c util/grub-emu.c util/misc.c \ |
103 | util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ | |
6d099807 | 104 | util/i386/pc/misc.c grub_emu_init.c |
e6b92c8a | 105 | |
f4917dfd | 106 | grub_emu_LDFLAGS = $(LIBCURSES) |
1cc73a62 | 107 | |
075a1650 | 108 | # Scripts. |
109 | sbin_SCRIPTS = grub-install | |
110 | ||
111 | # For grub-install. | |
112 | grub_install_SOURCES = util/i386/pc/grub-install.in | |
113 | ||
6a161fa9 | 114 | # Modules. |
bd0d7896 | 115 | pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod \ |
233b1628 | 116 | _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ |
bd0d7896 | 117 | vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ |
ad2a06ed | 118 | videotest.mod play.mod bitmap.mod tga.mod |
6a161fa9 | 119 | |
ce5bf700 | 120 | # For _chain.mod. |
121 | _chain_mod_SOURCES = loader/i386/pc/chainloader.c | |
122 | _chain_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 123 | _chain_mod_LDFLAGS = $(COMMON_LDFLAGS) |
6a161fa9 | 124 | |
8ddad845 | 125 | # For chain.mod. |
126 | chain_mod_SOURCES = loader/i386/pc/chainloader_normal.c | |
127 | chain_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 128 | chain_mod_LDFLAGS = $(COMMON_LDFLAGS) |
8ddad845 | 129 | |
ce5bf700 | 130 | # For _linux.mod. |
131 | _linux_mod_SOURCES = loader/i386/pc/linux.c | |
132 | _linux_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 133 | _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) |
134 | ||
b47efe30 | 135 | # For linux.mod. |
136 | linux_mod_SOURCES = loader/i386/pc/linux_normal.c | |
137 | linux_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 138 | linux_mod_LDFLAGS = $(COMMON_LDFLAGS) |
ce5bf700 | 139 | |
140 | # For normal.mod. | |
e02ac02c | 141 | normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h |
4d4e372e | 142 | normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ |
4e93851c | 143 | normal/completion.c normal/execute.c \ |
daac212a | 144 | normal/function.c normal/lexer.c normal/main.c normal/menu.c \ |
145 | normal/menu_entry.c normal/misc.c grub_script.tab.c \ | |
146 | normal/script.c normal/i386/setjmp.S | |
ce5bf700 | 147 | normal_mod_CFLAGS = $(COMMON_CFLAGS) |
43e7f879 | 148 | normal_mod_ASFLAGS = $(COMMON_ASFLAGS) |
59b8208a | 149 | normal_mod_LDFLAGS = $(COMMON_LDFLAGS) |
977329f5 | 150 | |
990cf3aa | 151 | # For reboot.mod. |
152 | reboot_mod_SOURCES = commands/i386/pc/reboot.c | |
153 | reboot_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 154 | reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) |
990cf3aa | 155 | |
156 | # For halt.mod. | |
157 | halt_mod_SOURCES = commands/i386/pc/halt.c | |
158 | halt_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 159 | halt_mod_LDFLAGS = $(COMMON_LDFLAGS) |
990cf3aa | 160 | |
47d2d65e | 161 | # For serial.mod. |
162 | serial_mod_SOURCES = term/i386/pc/serial.c | |
163 | serial_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 164 | serial_mod_LDFLAGS = $(COMMON_LDFLAGS) |
47d2d65e | 165 | |
9a5c1ade | 166 | # For _multiboot.mod. |
167 | _multiboot_mod_SOURCES = loader/i386/pc/multiboot.c | |
168 | _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 169 | _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) |
b47efe30 | 170 | |
171 | # For multiboot.mod. | |
172 | multiboot_mod_SOURCES = loader/i386/pc/multiboot_normal.c | |
173 | multiboot_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 174 | multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) |
3f1578fe | 175 | |
6323696a | 176 | # For vbe.mod. |
b4b93674 | 177 | vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \ |
ad2a06ed | 178 | video/i386/pc/vbefill.c video/i386/pc/vbeutil.c |
6323696a | 179 | vbe_mod_CFLAGS = $(COMMON_CFLAGS) |
59b8208a | 180 | vbe_mod_LDFLAGS = $(COMMON_LDFLAGS) |
6323696a | 181 | |
1f0a95e4 | 182 | # For vbeinfo.mod. |
183 | vbeinfo_mod_SOURCES = commands/i386/pc/vbeinfo.c | |
184 | vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 185 | vbeinfo_mod_LDFLAGS = $(COMMON_LDFLAGS) |
6323696a | 186 | |
1f0a95e4 | 187 | # For vbetest.mod. |
188 | vbetest_mod_SOURCES = commands/i386/pc/vbetest.c | |
189 | vbetest_mod_CFLAGS = $(COMMON_CFLAGS) | |
59b8208a | 190 | vbetest_mod_LDFLAGS = $(COMMON_LDFLAGS) |
6a85ce79 | 191 | |
41730ed9 | 192 | # For play.mod. |
193 | play_mod_SOURCES = commands/i386/pc/play.c | |
194 | play_mod_CFLAGS = $(COMMON_CFLAGS) | |
195 | play_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
196 | ||
bd0d7896 | 197 | # For video.mod. |
198 | video_mod_SOURCES = video/video.c | |
199 | video_mod_CFLAGS = $(COMMON_CFLAGS) | |
200 | video_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
201 | ||
202 | # For gfxterm.mod. | |
203 | gfxterm_mod_SOURCES = term/gfxterm.c | |
204 | gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) | |
205 | gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
206 | ||
207 | # For videotest.mod. | |
208 | videotest_mod_SOURCES = commands/videotest.c | |
209 | videotest_mod_CFLAGS = $(COMMON_CFLAGS) | |
210 | videotest_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
211 | ||
ad2a06ed | 212 | # For bitmap.mod |
213 | bitmap_mod_SOURCES = video/bitmap.c | |
214 | bitmap_mod_CFLAGS = $(COMMON_CFLAGS) | |
215 | bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
216 | ||
217 | # For tga.mod | |
218 | tga_mod_SOURCES = video/readers/tga.c | |
219 | tga_mod_CFLAGS = $(COMMON_CFLAGS) | |
220 | tga_mod_LDFLAGS = $(COMMON_LDFLAGS) | |
221 | ||
233b1628 | 222 | include $(srcdir)/conf/common.mk |