Forgot tar.c
[grub2/phcoder.git] / conf / i386-pc.rmk
blobe7de5e9a7a5fc87fbadf590bfff8db3da087a42b
1 # -*- makefile -*-
3 GRUB_MEMORY_MACHINE_LINK_ADDR = 0x8200
5 COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
6 COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
7 COMMON_LDFLAGS = -m32 -nostdlib
9 # Used by various components.  These rules need to precede them.
10 normal/lexer.c_DEPENDENCIES = grub_script.tab.h
12 # Images.
13 pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \
14                 cdboot.img
16 # For boot.img.
17 boot_img_SOURCES = boot/i386/pc/boot.S
18 boot_img_ASFLAGS = $(COMMON_ASFLAGS)
19 boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
21 # For pxeboot.img
22 pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S
23 pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS)
24 pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
26 # For diskboot.img.
27 diskboot_img_SOURCES = boot/i386/pc/diskboot.S
28 diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)
29 diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000
31 # For lnxboot.img.
32 lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S
33 lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS)
34 lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000
36 # For cdboot.img.
37 cdboot_img_SOURCES = boot/i386/pc/cdboot.S
38 cdboot_img_ASFLAGS = $(COMMON_ASFLAGS)
39 cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
41 # For kernel.img.
42 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \
43         kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
44         kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
45         kern/time.c \
46         kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \
47         kern/parser.c kern/partition.c \
48         kern/i386/tsc.c kern/i386/pit.c \
49         kern/generic/rtc_get_time_ms.c \
50         kern/generic/millisleep.c \
51         kern/env.c \
52         term/i386/pc/console.c term/i386/vga_common.c \
53         symlist.c
54 kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
55         env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
56         partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \
57         machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \
58         machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \
59         machine/kernel.h machine/pxe.h
60 kernel_img_CFLAGS = $(COMMON_CFLAGS)
61 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
62 kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
64 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
65 DEFSYMFILES += kernel_syms.lst
67 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
68         /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
70 kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
71         /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
73 # Utilities.
74 bin_UTILITIES = grub-mkimage
75 sbin_UTILITIES = grub-setup grub-mkdevicemap
76 ifeq ($(enable_grub_emu), yes)
77 sbin_UTILITIES += grub-emu
78 endif
80 # For grub-mkimage.
81 ifeq ($(enable_lzo), yes)
82 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
83         util/resolve.c
84 grub_mkimage_LDFLAGS = $(LIBLZO)
85 else
86 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
87         util/resolve.c lib/LzmaEnc.c lib/LzFind.c
88 endif
89 grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR)
90 util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile
92 # For grub-setup.
93 util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h
94 grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c  \
95         util/misc.c util/getroot.c kern/device.c kern/disk.c    \
96         kern/err.c kern/misc.c kern/parser.c kern/partition.c   \
97         kern/file.c kern/fs.c kern/env.c fs/fshelp.c            \
98         \
99         fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c         \
100         fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c  \
101         fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c          \
102         fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c                     \
103         \
104         partmap/pc.c partmap/gpt.c                              \
105         \
106         disk/raid.c disk/mdraid_linux.c disk/lvm.c              \
107         util/raid.c util/lvm.c                                  \
108         grub_setup_init.c
110 # For grub-mkdevicemap.
111 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c
113 # For grub-emu.
114 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
115 grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c        \
116         commands/configfile.c commands/echo.c commands/help.c           \
117         commands/terminal.c commands/ls.c commands/test.c               \
118         commands/search.c commands/blocklist.c commands/hexdump.c       \
119         lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c         \
120         commands/i386/cpuid.c                                           \
121         disk/host.c disk/loopback.c                                     \
122         fs/fshelp.c     \
123         \
124         io/gzio.c                                                       \
125         kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c       \
126         kern/err.c                                                      \
127         normal/execute.c kern/file.c kern/fs.c normal/lexer.c           \
128         kern/loader.c kern/main.c kern/misc.c kern/parser.c             \
129         grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c    \
130         normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
131         normal/completion.c normal/main.c normal/color.c                \
132         normal/menu.c normal/menu_entry.c normal/menu_viewer.c          \
133         normal/misc.c normal/script.c                                   \
134         partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
135         partmap/acorn.c partmap/gpt.c                                   \
136         \
137         fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c                 \
138         fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c          \
139         fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c                  \
140         fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c                             \
141         \
142         util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
143         util/hostdisk.c util/getroot.c                                  \
144         util/i386/pc/misc.c                                             \
145         \
146         disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
147         disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
148         grub_emu_init.c
150 grub_emu_LDFLAGS = $(LIBCURSES)
152 # Scripts.
153 sbin_SCRIPTS = grub-install
154 bin_SCRIPTS = grub-mkrescue
156 # For grub-install.
157 grub_install_SOURCES = util/i386/pc/grub-install.in
159 # For grub-mkrescue.
160 grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in
162 # Modules.
163 pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \
164         _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod      \
165         vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod     \
166         ata.mod vga.mod memdisk.mod pci.mod lspci.mod \
167         aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \
168         datehook.mod lsmmap.mod
170 # For biosdisk.mod.
171 biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c
172 biosdisk_mod_CFLAGS = $(COMMON_CFLAGS)
173 biosdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
175 # For _chain.mod.
176 _chain_mod_SOURCES = loader/i386/pc/chainloader.c
177 _chain_mod_CFLAGS = $(COMMON_CFLAGS)
178 _chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
180 # For chain.mod.
181 chain_mod_SOURCES = loader/i386/pc/chainloader_normal.c
182 chain_mod_CFLAGS = $(COMMON_CFLAGS)
183 chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
185 # For _linux.mod.
186 _linux_mod_SOURCES = loader/i386/pc/linux.c
187 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
188 _linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
190 # For linux.mod.
191 linux_mod_SOURCES = loader/linux_normal.c
192 linux_mod_CFLAGS = $(COMMON_CFLAGS)
193 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
196 # Only arch dependant part of normal.mod will be here. Common part for
197 # all architecures of normal.mod is at start and should be kept at sync
198 # with other makefiles.
200 # Please put arch dependant part of normal.mod at the end of list to
201 # keep it simpler to update to different architectures.
203 normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c     \
204         normal/completion.c normal/execute.c                            \
205         normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
206         normal/color.c                                                  \
207         normal/menu_viewer.c normal/menu_entry.c                        \
208         normal/misc.c grub_script.tab.c                                 \
209         normal/script.c                                                 \
210         normal/i386/setjmp.S
211 normal_mod_CFLAGS = $(COMMON_CFLAGS)
212 normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
213 normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
215 # For reboot.mod.
216 reboot_mod_SOURCES = commands/reboot.c
217 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
218 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
220 # For halt.mod.
221 halt_mod_SOURCES = commands/i386/pc/halt.c
222 halt_mod_CFLAGS = $(COMMON_CFLAGS)
223 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
225 # For serial.mod.
226 serial_mod_SOURCES = term/i386/pc/serial.c
227 serial_mod_CFLAGS = $(COMMON_CFLAGS)
228 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
230 # For _multiboot.mod.
231 _multiboot_mod_SOURCES = loader/i386/pc/multiboot.c \
232                          loader/i386/pc/multiboot2.c \
233                          loader/multiboot2.c \
234                          loader/multiboot_loader.c
235 _multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
236 _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
238 # For multiboot.mod.
239 multiboot_mod_SOURCES = loader/multiboot_loader_normal.c 
240 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
241 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
243 # For vbe.mod.
244 vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \
245                   video/i386/pc/vbefill.c video/i386/pc/vbeutil.c
246 vbe_mod_CFLAGS = $(COMMON_CFLAGS)
247 vbe_mod_LDFLAGS = $(COMMON_LDFLAGS)
249 # For vbeinfo.mod.
250 vbeinfo_mod_SOURCES = commands/i386/pc/vbeinfo.c
251 vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS)
252 vbeinfo_mod_LDFLAGS = $(COMMON_LDFLAGS)
254 # For vbetest.mod.
255 vbetest_mod_SOURCES = commands/i386/pc/vbetest.c
256 vbetest_mod_CFLAGS = $(COMMON_CFLAGS)
257 vbetest_mod_LDFLAGS = $(COMMON_LDFLAGS)
259 # For play.mod.
260 play_mod_SOURCES = commands/i386/pc/play.c
261 play_mod_CFLAGS = $(COMMON_CFLAGS)
262 play_mod_LDFLAGS = $(COMMON_LDFLAGS)
264 # For ata.mod.
265 ata_mod_SOURCES = disk/ata.c
266 ata_mod_CFLAGS = $(COMMON_CFLAGS)
267 ata_mod_LDFLAGS = $(COMMON_LDFLAGS)
269 # For vga.mod.
270 vga_mod_SOURCES = term/i386/pc/vga.c
271 vga_mod_CFLAGS = $(COMMON_CFLAGS)
272 vga_mod_LDFLAGS = $(COMMON_LDFLAGS)
274 # For memdisk.mod.
275 memdisk_mod_SOURCES = disk/memdisk.c
276 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
277 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
279 # For pci.mod
280 pci_mod_SOURCES = bus/pci.c
281 pci_mod_CFLAGS = $(COMMON_CFLAGS)
282 pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
284 # For lspci.mod
285 lspci_mod_SOURCES = commands/lspci.c
286 lspci_mod_CFLAGS = $(COMMON_CFLAGS)
287 lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
289 # For aout.mod
290 aout_mod_SOURCES = loader/aout.c
291 aout_mod_CFLAGS = $(COMMON_CFLAGS)
292 aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
294 # For _bsd.mod
295 _bsd_mod_SOURCES = loader/i386/bsd.c
296 _bsd_mod_CFLAGS = $(COMMON_CFLAGS)
297 _bsd_mod_LDFLAGS = $(COMMON_LDFLAGS)
299 # For bsd.mod
300 bsd_mod_SOURCES = loader/i386/bsd_normal.c
301 bsd_mod_CFLAGS = $(COMMON_CFLAGS)
302 bsd_mod_LDFLAGS = $(COMMON_LDFLAGS)
304 # For pxe.mod
305 pxe_mod_SOURCES = fs/i386/pc/pxe.c
306 pxe_mod_CFLAGS = $(COMMON_CFLAGS)
307 pxe_mod_LDFLAGS = $(COMMON_LDFLAGS)
309 # For pxecmd.mod
310 pxecmd_mod_SOURCES = commands/i386/pc/pxecmd.c
311 pxecmd_mod_CFLAGS = $(COMMON_CFLAGS)
312 pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS)
314 # For datetime.mod
315 datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c
316 datetime_mod_CFLAGS = $(COMMON_CFLAGS)
317 datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
319 # For date.mod
320 date_mod_SOURCES = commands/date.c
321 date_mod_CFLAGS = $(COMMON_CFLAGS)
322 date_mod_LDFLAGS = $(COMMON_LDFLAGS)
324 # For datehook.mod
325 datehook_mod_SOURCES = hook/datehook.c
326 datehook_mod_CFLAGS = $(COMMON_CFLAGS)
327 datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
329 # For lsmmap.mod
330 lsmmap_mod_SOURCES = commands/lsmmap.c
331 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
332 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
334 include $(srcdir)/conf/i386.mk
335 include $(srcdir)/conf/common.mk