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