Merge branch 'makefile' into haiku
[grub2/phcoder.git] / conf / powerpc-ieee1275.rmk
blobd018379d3fa44d42b2d172cf620ea44ec6ecebdb
2 # -*- makefile -*-
4 COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
5 COMMON_CFLAGS = -ffreestanding
6 COMMON_LDFLAGS += -nostdlib
8 # Used by various components.  These rules need to precede them.
9 script/sh/lexer.c.dep: grub_script.tab.h
10         $(TRUE)
12 # Images.
14 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
15 DEFSYMFILES += kernel_syms.lst
17 kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
18         env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
19         symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
20         pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \
21         command.h
23 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
24         /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
26 kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
27         /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
29 # Programs
30 pkglib_PROGRAMS = kernel.img
32 # Utilities.
33 sbin_UTILITIES = grub-mkdevicemap
34 ifeq ($(enable_grub_emu), yes)
35 sbin_UTILITIES += grub-emu
36 endif
38 # For grub-mkdevicemap.
39 grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
40         util/devicemap.c util/misc.c
42 # For grub-emu
43 util/grub-emu.c.dep: grub_emu_init.h
44         $(TRUE)
45 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c     \
46         commands/configfile.c commands/help.c                           \
47         commands/search.c commands/handler.c commands/test.c            \
48         commands/ls.c commands/blocklist.c commands/hexdump.c           \
49         lib/hexdump.c commands/halt.c commands/reboot.c                 \
50         commands/gptsync.c commands/probe.c commands/xnu_uuid.c         \
51         disk/loopback.c                                                 \
52         \
53         fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c                 \
54         fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c          \
55         fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c                  \
56         fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c                           \
57         \
58         io/gzio.c                                                       \
59         kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c       \
60         kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c    \
61         kern/misc.c kern/parser.c kern/partition.c kern/reader.c        \
62         kern/rescue_reader.c kern/rescue_parser.c                       \
63         kern/term.c kern/list.c kern/handler.c fs/fshelp.c              \
64         kern/command.c kern/corecmd.c commands/extcmd.c                 \
65         lib/arg.c normal/cmdline.c normal/datetime.c                    \
66         normal/completion.c normal/misc.c                               \
67         normal/handler.c normal/autofs.c normal/main.c                  \
68         normal/menu.c                                                   \
69         normal/menu_text.c                                              \
70         normal/menu_entry.c normal/menu_viewer.c                        \
71         normal/color.c                                                  \
72         script/sh/main.c script/sh/execute.c script/sh/function.c       \
73         script/sh/lexer.c script/sh/script.c                            \
74         partmap/amiga.c partmap/apple.c partmap/pc.c partmap/bsdlabel.c \
75         partmap/sun.c partmap/acorn.c                                   \
76         util/console.c util/hostfs.c util/grub-emu.c util/misc.c        \
77         util/hostdisk.c util/getroot.c                                  \
78         \
79         disk/raid.c disk/raid5_recover.c disk/raid6_recover.c           \
80         disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c             \
81         commands/parttool.c parttool/pcpart.c                           \
82         grub_script.tab.c grub_emu_init.c
84 grub_emu_LDFLAGS = $(LIBCURSES)
86 kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \
87         kern/ieee1275/ieee1275.c kern/main.c kern/device.c              \
88         kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c          \
89         kern/misc.c kern/mm.c kern/reader.c kern/term.c         \
90         kern/rescue_parser.c kern/rescue_reader.c \
91         kern/list.c kern/handler.c kern/command.c kern/corecmd.c        \
92         kern/ieee1275/init.c                                            \
93         kern/ieee1275/mmap.c                                            \
94         term/ieee1275/ofconsole.c               \
95         kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c           \
96         kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c       \
97         kern/generic/millisleep.c kern/time.c                            \
98         symlist.c kern/$(target_cpu)/cache.S
99 kernel_img_CFLAGS = $(COMMON_CFLAGS)
100 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
101 kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
102         -Wl,-N,-S,-Ttext,0x200000,-Bstatic
104 # Scripts.
105 sbin_SCRIPTS = grub-install
106 bin_SCRIPTS = grub-mkrescue
108 # For grub-install.
109 grub_install_SOURCES = util/ieee1275/grub-install.in
111 # For grub-mkrescue.
112 grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in
114 # Modules.
115 pkglib_MODULES = halt.mod \
116         linux.mod \
117         reboot.mod \
118         suspend.mod \
119         multiboot.mod \
120         memdisk.mod \
121         lsmmap.mod
123 # For boot.mod.
124 pkglib_MODULES += boot.mod 
125 boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
126 boot_mod_CFLAGS = $(COMMON_CFLAGS)
127 boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
129 # For linux.mod.
130 linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
131 linux_mod_CFLAGS = $(COMMON_CFLAGS)
132 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
134 # For suspend.mod
135 suspend_mod_SOURCES = commands/ieee1275/suspend.c
136 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
137 suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
139 # For reboot.mod
140 reboot_mod_SOURCES = commands/reboot.c
141 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
142 reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
144 # For halt.mod
145 halt_mod_SOURCES = commands/halt.c
146 halt_mod_CFLAGS = $(COMMON_CFLAGS)
147 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
149 # For multiboot.mod
150 multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
151                          loader/multiboot2.c \
152                          loader/multiboot_loader.c
153 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
154 multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
156 # For memdisk.mod.
157 memdisk_mod_SOURCES = disk/memdisk.c
158 memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
159 memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
161 # For lsmmap.mod
162 lsmmap_mod_SOURCES = commands/lsmmap.c
163 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
164 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
166 include $(srcdir)/conf/common.mk