]>
Commit | Line | Data |
---|---|---|
fb739ccd | 1 | AUTOMAKE_OPTIONS = subdir-objects -Wno-portability |
d5c3b7ce | 2 | |
019be613 | 3 | DEPDIR=.deps-core |
6304d292 | 4 | |
a5a3bccd | 5 | include $(top_srcdir)/conf/Makefile.common |
6304d292 | 6 | |
a5a3bccd BC |
7 | CC=$(TARGET_CC) |
8 | CPP=$(TARGET_CC) | |
9 | CCAS=$(TARGET_CC) | |
0e8daad0 VS |
10 | RANLIB=$(TARGET_RANLIB) |
11 | STRIP=$(TARGET_STRIP) | |
8c411768 | 12 | |
382775d1 VS |
13 | MACHO2IMG=$(top_builddir)/grub-macho2img |
14 | ||
a5a3bccd BC |
15 | AM_CFLAGS = $(TARGET_CFLAGS) |
16 | AM_LDFLAGS = $(TARGET_LDFLAGS) | |
17 | AM_CPPFLAGS = $(TARGET_CPPFLAGS) $(CPPFLAGS_DEFAULT) | |
18 | AM_CCASFLAGS = $(TARGET_CCASFLAGS) $(CCASFLAGS_DEFAULT) | |
8c411768 | 19 | |
a5a3bccd BC |
20 | CFLAGS_PROGRAM += $(CFLAGS_PLATFORM) |
21 | LDFLAGS_PROGRAM += $(LDFLAGS_PLATFORM) | |
22 | CPPFLAGS_PROGRAM += $(CPPFLAGS_PLATFORM) | |
23 | CCASFLAGS_PROGRAM += $(CCASFLAGS_PLATFORM) | |
8c411768 | 24 | |
a5a3bccd BC |
25 | CFLAGS_LIBRARY += $(CFLAGS_PLATFORM) -fno-builtin |
26 | CPPFLAGS_LIBRARY += $(CPPFLAGS_PLATFORM) | |
27 | CCASFLAGS_LIBRARY += $(CCASFLAGS_PLATFORM) | |
8c411768 | 28 | |
7b780018 VS |
29 | build-grub-pe2elf: $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c |
30 | $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pe2elf\" $^ | |
31 | ||
8c411768 | 32 | # gentrigtables |
6304d292 | 33 | gentrigtables: gentrigtables.c |
29013cba | 34 | $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< $(BUILD_LIBM) |
8c411768 BC |
35 | CLEANFILES += gentrigtables |
36 | ||
37 | # trigtables.c | |
bdf0d623 | 38 | trigtables.c: gentrigtables gentrigtables.c $(top_srcdir)/configure.ac |
3cc1878f | 39 | ./gentrigtables > $@ |
8c411768 BC |
40 | CLEANFILES += trigtables.c |
41 | ||
42 | # XXX Use Automake's LEX & YACC support | |
6304d292 BC |
43 | grub_script.tab.h: script/parser.y |
44 | $(YACC) -d -p grub_script_yy -b grub_script $< | |
02c9030a | 45 | grub_script.tab.c: grub_script.tab.h |
8c411768 BC |
46 | CLEANFILES += grub_script.tab.c grub_script.tab.h |
47 | ||
48 | # For the lexer. | |
6304d292 BC |
49 | grub_script.yy.h: script/yylex.l |
50 | $(LEX) -o grub_script.yy.c --header-file=grub_script.yy.h $< | |
02c9030a | 51 | grub_script.yy.c: grub_script.yy.h |
419cbeb0 | 52 | |
cc284112 | 53 | rs_decoder.h: $(srcdir)/lib/reed_solomon.c |
b99f3e00 | 54 | $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Os -I$(top_builddir) -S -DSTANDALONE -o $@ $< -g0 -mregparm=3 -ffreestanding |
419cbeb0 | 55 | |
8c411768 BC |
56 | CLEANFILES += grub_script.yy.c grub_script.yy.h |
57 | ||
3d9d3542 | 58 | include $(srcdir)/Makefile.core.am |
6304d292 BC |
59 | |
60 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cache.h | |
61 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h | |
62 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h | |
63 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h | |
64 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h | |
6304d292 BC |
65 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h |
66 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h | |
67 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h | |
68 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/file.h | |
69 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fs.h | |
70 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i18n.h | |
71 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/kernel.h | |
72 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/list.h | |
73 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/misc.h | |
74 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm.h | |
6304d292 BC |
75 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/parser.h |
76 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/partition.h | |
6304d292 BC |
77 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/term.h |
78 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h | |
16bd6cfa | 79 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm_private.h |
9a9852df | 80 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h |
d59849b2 | 81 | if !COND_clang |
050abaea | 82 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h |
d59849b2 | 83 | endif |
df3df23d | 84 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h |
16bd6cfa VS |
85 | |
86 | if COND_i386_pc | |
6304d292 BC |
87 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h |
88 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pxe.h | |
afba9f98 | 89 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/int.h |
5341c0fb | 90 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h |
6304d292 BC |
91 | endif |
92 | ||
93 | if COND_i386_efi | |
6304d292 | 94 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h |
6304d292 | 95 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h |
5341c0fb | 96 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h |
9d34bb85 | 97 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h |
6304d292 BC |
98 | endif |
99 | ||
100 | if COND_i386_coreboot | |
5341c0fb | 101 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h |
cc19857a | 102 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/coreboot/lbio.h |
9fc9ce37 | 103 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/i386/pc/int.h |
fc4c4fdd VS |
104 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h |
105 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h | |
106 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h | |
107 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h | |
108 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h | |
6304d292 BC |
109 | endif |
110 | ||
111 | if COND_i386_multiboot | |
5341c0fb | 112 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h |
9fc9ce37 | 113 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/i386/pc/int.h |
6304d292 BC |
114 | endif |
115 | ||
116 | if COND_i386_qemu | |
6304d292 | 117 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h |
5341c0fb | 118 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h |
6304d292 BC |
119 | endif |
120 | ||
121 | if COND_i386_ieee1275 | |
6304d292 | 122 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h |
6304d292 | 123 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h |
ee74fa48 VS |
124 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h |
125 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h | |
5341c0fb | 126 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h |
6304d292 BC |
127 | endif |
128 | ||
9612ebc0 VS |
129 | if COND_i386_xen |
130 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/xen.h | |
131 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/xen/hypercall.h | |
132 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h | |
133 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h | |
134 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h | |
135 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h | |
136 | endif | |
137 | ||
138 | if COND_x86_64_xen | |
139 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/xen.h | |
140 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/x86_64/xen/hypercall.h | |
141 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h | |
142 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h | |
143 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h | |
144 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h | |
145 | endif | |
146 | ||
6304d292 | 147 | if COND_x86_64_efi |
6304d292 | 148 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h |
6304d292 | 149 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h |
5341c0fb | 150 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h |
9d34bb85 | 151 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h |
6304d292 BC |
152 | endif |
153 | ||
6585de4c VS |
154 | if COND_ia64_efi |
155 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h | |
6585de4c | 156 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h |
6585de4c VS |
157 | endif |
158 | ||
8906c3dd VS |
159 | if COND_mips |
160 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/kernel.h | |
161 | endif | |
162 | ||
163 | if COND_mips_arc | |
164 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h | |
165 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arc/arc.h | |
b04b5990 | 166 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h |
8906c3dd VS |
167 | endif |
168 | ||
3666d5f6 | 169 | if COND_mips_qemu_mips |
d7345994 VS |
170 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h |
171 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h | |
d7345994 VS |
172 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h |
173 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h | |
174 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h | |
3666d5f6 | 175 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h |
d7345994 | 176 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h |
3666d5f6 VS |
177 | endif |
178 | ||
54da1feb | 179 | if COND_mips_loongson |
5aaf2c18 | 180 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h |
6304d292 | 181 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h |
7da036bb | 182 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/time.h |
6304d292 | 183 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h |
813c1622 | 184 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h |
6304d292 BC |
185 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h |
186 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h | |
6304d292 BC |
187 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h |
188 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h | |
6304d292 BC |
189 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cs5536.h |
190 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pci.h | |
df3df23d | 191 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h |
685475e5 | 192 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h |
ee74fa48 VS |
193 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h |
194 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h | |
195 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h | |
6304d292 BC |
196 | endif |
197 | ||
f440c33f VS |
198 | if COND_mips_qemu_mips |
199 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h | |
200 | KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h | |
201 | endif | |
202 | ||
6304d292 | 203 | if COND_powerpc_ieee1275 |
6304d292 | 204 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h |
ee74fa48 VS |
205 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h |
206 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h | |
207 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h | |
6304d292 BC |
208 | endif |
209 | ||
210 | if COND_sparc64_ieee1275 | |
6304d292 | 211 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h |
6304d292 | 212 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sparc64/ieee1275/ieee1275.h |
ee74fa48 VS |
213 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h |
214 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h | |
215 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h | |
6304d292 BC |
216 | endif |
217 | ||
389b31cd LL |
218 | if COND_arm_uboot |
219 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/uboot.h | |
220 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/disk.h | |
221 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h | |
222 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h | |
223 | endif | |
224 | ||
225 | if COND_arm_efi | |
226 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/efi/loader.h | |
227 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h | |
228 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h | |
229 | endif | |
230 | ||
15a463d7 LL |
231 | if COND_arm64_efi |
232 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h | |
233 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h | |
234 | endif | |
235 | ||
6304d292 | 236 | if COND_emu |
6304d292 BC |
237 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/datetime.h |
238 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/misc.h | |
70671037 | 239 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/net.h |
25ac643a | 240 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostdisk.h |
d7750b32 | 241 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostfile.h |
db99fbe8 | 242 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h |
6304d292 BC |
243 | if COND_GRUB_EMU_SDL |
244 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h | |
245 | endif | |
246 | if COND_GRUB_EMU_USB | |
247 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libusb.h | |
248 | endif | |
249 | if COND_GRUB_EMU_PCI | |
250 | KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libpciaccess.h | |
251 | endif | |
252 | endif | |
253 | ||
254 | symlist.h: $(top_builddir)/config.h $(KERNEL_HEADER_FILES) | |
255 | @list='$^'; \ | |
256 | for p in $$list; do \ | |
257 | echo "#include <$$p>" >> $@ || (rm -f $@; exit 1); \ | |
258 | done | |
259 | CLEANFILES += symlist.h | |
260 | BUILT_SOURCES += symlist.h | |
261 | ||
262 | symlist.c: symlist.h gensymlist.sh | |
263 | $(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) -DGRUB_SYMBOL_GENERATOR=1 symlist.h > symlist.p || (rm -f symlist.p; exit 1) | |
264 | cat symlist.p | /bin/sh $(srcdir)/gensymlist.sh $(top_builddir)/config.h $(KERNEL_HEADER_FILES) >$@ || (rm -f $@; exit 1) | |
265 | rm -f symlist.p | |
266 | CLEANFILES += symlist.c | |
267 | BUILT_SOURCES += symlist.c | |
268 | ||
742f9232 | 269 | if COND_HAVE_ASM_USCORE |
f772623b | 270 | ASM_PREFIX=_ |
742f9232 VS |
271 | else |
272 | ASM_PREFIX= | |
273 | endif | |
274 | ||
6304d292 | 275 | noinst_DATA += kernel_syms.lst |
742f9232 | 276 | |
6304d292 BC |
277 | kernel_syms.lst: $(KERNEL_HEADER_FILES) $(top_builddir)/config.h |
278 | $(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DGRUB_SYMBOL_GENERATOR=1 $^ >kernel_syms.input | |
6304d292 | 279 | cat kernel_syms.input | grep -v '^#' | sed -n \ |
f772623b YB |
280 | -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined kernel '"$(ASM_PREFIX)"'\1/;p;}' \ |
281 | -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined kernel '"$(ASM_PREFIX)"'\1/;p;}' \ | |
6304d292 BC |
282 | | sort -u >$@ |
283 | rm -f kernel_syms.input | |
284 | CLEANFILES += kernel_syms.lst | |
285 | ||
286 | if COND_emu | |
287 | kern/emu/grub_emu-main.$(OBJEXT):grub_emu_init.h | |
288 | grub_emu-grub_emu_init.$(OBJEXT):grub_emu_init.h | |
289 | kern/emu/grub_emu_dyn-main.$(OBJEXT):grub_emu_init.h | |
290 | grub_emu_dyn-grub_emu_init.$(OBJEXT):grub_emu_init.h | |
291 | ||
292 | grub_emu_init.h: genemuinitheader.sh $(MOD_FILES) | |
fc97214f | 293 | rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@ |
6304d292 BC |
294 | CLEANFILES += grub_emu_init.h |
295 | ||
296 | grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES) | |
fc97214f | 297 | rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@ |
6304d292 BC |
298 | CLEANFILES += grub_emu_init.c |
299 | endif | |
8c411768 | 300 | |
a0bf9fc9 | 301 | # List files |
8c411768 | 302 | |
6568636e | 303 | fs.lst: $(MARKER_FILES) |
a0bf9fc9 | 304 | (for pp in $^; do \ |
6568636e BC |
305 | b=`basename $$pp .marker`; \ |
306 | if grep 'FS_LIST_MARKER' $$pp >/dev/null 2>&1; then \ | |
a0bf9fc9 BC |
307 | echo $$b; \ |
308 | fi; \ | |
309 | done) | sort -u > $@ | |
8c411768 | 310 | platform_DATA += fs.lst |
6304d292 BC |
311 | CLEANFILES += fs.lst |
312 | ||
6568636e | 313 | command.lst: $(MARKER_FILES) |
a0bf9fc9 | 314 | (for pp in $^; do \ |
6568636e BC |
315 | b=`basename $$pp .marker`; \ |
316 | sed -n \ | |
6568636e | 317 | -e "/EXTCOMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \ |
bf16e98e CW |
318 | -e "/P1COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \ |
319 | -e "/COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" $$pp; \ | |
a0bf9fc9 BC |
320 | done) | sort -u > $@ |
321 | platform_DATA += command.lst | |
6304d292 BC |
322 | CLEANFILES += command.lst |
323 | ||
6568636e | 324 | partmap.lst: $(MARKER_FILES) |
a0bf9fc9 | 325 | (for pp in $^; do \ |
6568636e BC |
326 | b=`basename $$pp .marker`; \ |
327 | if grep 'PARTMAP_LIST_MARKER' $$pp >/dev/null 2>&1; then \ | |
a0bf9fc9 BC |
328 | echo $$b; \ |
329 | fi; \ | |
330 | done) | sort -u > $@ | |
331 | platform_DATA += partmap.lst | |
6304d292 BC |
332 | CLEANFILES += partmap.lst |
333 | ||
6568636e | 334 | terminal.lst: $(MARKER_FILES) |
a0bf9fc9 | 335 | (for pp in $^; do \ |
6568636e BC |
336 | b=`basename $$pp .marker`; \ |
337 | sed -n \ | |
338 | -e "/INPUT_TERMINAL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \ | |
339 | -e "/OUTPUT_TERMINAL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}" $$pp; \ | |
a0bf9fc9 BC |
340 | done) | sort -u > $@ |
341 | platform_DATA += terminal.lst | |
6304d292 BC |
342 | CLEANFILES += terminal.lst |
343 | ||
6568636e | 344 | parttool.lst: $(MARKER_FILES) |
a0bf9fc9 | 345 | (for pp in $^; do \ |
6568636e BC |
346 | b=`basename $$pp .marker`; \ |
347 | sed -n \ | |
348 | -e "/PARTTOOL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" $$pp; \ | |
a0bf9fc9 BC |
349 | done) | sort -u > $@ |
350 | platform_DATA += parttool.lst | |
6304d292 BC |
351 | CLEANFILES += parttool.lst |
352 | ||
6568636e | 353 | video.lst: $(MARKER_FILES) |
a0bf9fc9 | 354 | (for pp in $^; do \ |
6568636e BC |
355 | b=`basename $$pp .marker`; \ |
356 | if grep 'VIDEO_LIST_MARKER' $$pp >/dev/null 2>&1; then \ | |
a0bf9fc9 BC |
357 | echo $$b; \ |
358 | fi; \ | |
359 | done) | sort -u > $@ | |
360 | platform_DATA += video.lst | |
6304d292 | 361 | CLEANFILES += video.lst |
8c411768 BC |
362 | |
363 | # but, crypto.lst is simply copied | |
6304d292 | 364 | crypto.lst: $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst |
8c411768 | 365 | cp $^ $@ |
a0bf9fc9 | 366 | platform_DATA += crypto.lst |
6304d292 | 367 | CLEANFILES += crypto.lst |
8c411768 | 368 | |
0d4552fa BC |
369 | syminfo.lst: gensyminfo.sh kernel_syms.lst $(MODULE_FILES) |
370 | cat kernel_syms.lst > $@.new | |
371 | for m in $(MODULE_FILES); do \ | |
372 | sh $< $$m >> $@.new || exit 1; \ | |
373 | done | |
374 | mv $@.new $@ | |
a0bf9fc9 | 375 | |
8c411768 | 376 | # generate global module dependencies list |
22c7ce85 | 377 | moddep.lst: syminfo.lst genmoddep.awk video.lst |
9e0bee42 | 378 | cat $< | sort | $(AWK) -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1) |
0d4552fa | 379 | platform_DATA += moddep.lst |
ea943e89 | 380 | CLEANFILES += config.log syminfo.lst moddep.lst |
6b5f780f BC |
381 | |
382 | $(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) | |
f1632d4d | 383 | TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@ |
6b5f780f | 384 | platform_DATA += $(MOD_FILES) |
6ad6223e | 385 | platform_DATA += modinfo.sh |
6b5f780f | 386 | CLEANFILES += $(MOD_FILES) |
8c411768 | 387 | |
8c411768 BC |
388 | if COND_ENABLE_EFIEMU |
389 | efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF) | |
9208367d VS |
390 | -rm -f $@ |
391 | -rm -f $@.bin | |
392 | $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m32 -Wall -Werror -nostdlib -static -O2 -c -o $@.bin $< | |
a9f25a08 | 393 | if test "x$(TARGET_APPLE_LINKER)" = x1; then \ |
b700a427 | 394 | $(TARGET_OBJCONV) -felf32 -nu -nd $@.bin $@ || exit 1; \ |
9208367d VS |
395 | rm -f $@.bin ; \ |
396 | elif test ! -z "$(TARGET_OBJ2ELF)"; then \ | |
397 | $(TARGET_OBJ2ELF) $@.bin || (rm -f $@.bin; exit 1); \ | |
398 | mv $@.bin $@ ; \ | |
8c411768 | 399 | else \ |
9208367d | 400 | mv $@.bin $@ ; \ |
8c411768 BC |
401 | fi |
402 | ||
c2b70d09 | 403 | # Link format -arch,x86_64 means Apple linker |
8c411768 | 404 | efiemu64_c.o: efiemu/runtime/efiemu.c |
9208367d | 405 | $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -nostdlib -Wall -Werror -O2 -mcmodel=large -mno-red-zone -c -o $@ $< |
8c411768 BC |
406 | |
407 | efiemu64_s.o: efiemu/runtime/efiemu.S | |
9208367d | 408 | $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -Wall -Werror -nostdlib -O2 -mcmodel=large -mno-red-zone -c -o $@ $< |
8c411768 BC |
409 | |
410 | efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELEF) | |
9208367d VS |
411 | -rm -f $@ |
412 | -rm -f $@.bin | |
413 | $(TARGET_CC) -m64 $(EFIEMU64_LINK_FORMAT) -nostdlib -static -Wl,-r -o $@.bin $^ | |
c2b70d09 | 414 | if test "x$(EFIEMU64_LINK_FORMAT)" = x-arch,x86_64; then \ |
b700a427 | 415 | $(TARGET_OBJCONV) -felf64 -nu -nd $@.bin $@ || exit 1; \ |
8c411768 BC |
416 | rm -f $@.bin; \ |
417 | else \ | |
9208367d | 418 | mv $@.bin $@ ; \ |
8c411768 BC |
419 | fi |
420 | ||
421 | platform_DATA += efiemu32.o efiemu64.o | |
422 | CLEANFILES += efiemu32.o efiemu64.o efiemu64_c.o efiemu64_s.o | |
423 | endif | |
cd46aa6c VS |
424 | |
425 | windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows | |
426 | windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA) | |
427 | test -d $(windowsdir)/$(target_cpu)-$(platform) || mkdir $(windowsdir)/$(target_cpu)-$(platform) | |
428 | for x in $(platform_DATA); do \ | |
429 | cp -fp $$x $(windowsdir)/$(target_cpu)-$(platform)/$$x; \ | |
430 | done |